@solarpunkltd/swarm-chat-js 0.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.esm.js +43198 -23601
- package/dist/index.js +23 -26
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/{libs → src/lib}/constants.d.ts +5 -5
- package/dist/src/lib/constants.d.ts.map +1 -0
- package/dist/src/lib/core.d.ts +47 -0
- package/dist/src/lib/core.d.ts.map +1 -0
- package/dist/src/lib/history.d.ts +49 -0
- package/dist/src/lib/history.d.ts.map +1 -0
- package/dist/src/lib/mine.d.ts +2 -0
- package/dist/src/lib/mine.d.ts.map +1 -0
- package/dist/src/lib/swarmEventEmitterReader.d.ts +15 -0
- package/dist/src/lib/swarmEventEmitterReader.d.ts.map +1 -0
- package/dist/src/lib/types/chat.d.ts +57 -0
- package/dist/src/lib/types/chat.d.ts.map +1 -0
- package/dist/src/lib/types/index.d.ts +4 -0
- package/dist/src/lib/types/index.d.ts.map +1 -0
- package/dist/src/lib/types/message.d.ts +14 -0
- package/dist/src/lib/types/message.d.ts.map +1 -0
- package/dist/src/lib/types/user.d.ts +35 -0
- package/dist/src/lib/types/user.d.ts.map +1 -0
- package/dist/src/lib/utils.d.ts +31 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/utils/bee.d.ts +18 -0
- package/dist/src/utils/bee.d.ts.map +1 -0
- package/dist/src/utils/common.d.ts +4 -0
- package/dist/src/utils/common.d.ts.map +1 -0
- package/dist/src/utils/error.d.ts +6 -0
- package/dist/src/utils/error.d.ts.map +1 -0
- package/dist/src/utils/eventEmitter.d.ts.map +1 -0
- package/dist/src/utils/logger.d.ts +12 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/{utils → src/utils}/queue.d.ts +3 -8
- package/dist/src/utils/queue.d.ts.map +1 -0
- package/dist/src/utils/validation.d.ts +7 -0
- package/dist/src/utils/validation.d.ts.map +1 -0
- package/dist/src/utils/waitForBroadcast.d.ts +10 -0
- package/dist/src/utils/waitForBroadcast.d.ts.map +1 -0
- package/dist/swarm-chat-umd.js +27 -0
- package/package.json +12 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/libs/constants.d.ts.map +0 -1
- package/dist/libs/core.d.ts +0 -59
- package/dist/libs/core.d.ts.map +0 -1
- package/dist/libs/mine.d.ts +0 -4
- package/dist/libs/mine.d.ts.map +0 -1
- package/dist/libs/types.d.ts +0 -85
- package/dist/libs/types.d.ts.map +0 -1
- package/dist/libs/utils.d.ts +0 -34
- package/dist/libs/utils.d.ts.map +0 -1
- package/dist/swarm-stream-umd.js +0 -30
- package/dist/utils/common.d.ts +0 -2
- package/dist/utils/common.d.ts.map +0 -1
- package/dist/utils/eventEmitter.d.ts.map +0 -1
- package/dist/utils/queue.d.ts.map +0 -1
- /package/dist/{utils → src/utils}/eventEmitter.d.ts +0 -0
package/dist/swarm-stream-umd.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
(function(Fe,He){typeof exports=="object"&&typeof module<"u"?He(exports,require("@ethersphere/bee-js")):typeof define=="function"&&define.amd?define(["exports","@ethersphere/bee-js"],He):(Fe=typeof globalThis<"u"?globalThis:Fe||self,He(Fe.SwarmStreamJs={},Fe.BeeJs))})(this,function(exports,beeJs){"use strict";var Er=Object.defineProperty;var wr=Fe=>{throw TypeError(Fe)};var Ar=(Fe,He,at)=>He in Fe?Er(Fe,He,{enumerable:!0,configurable:!0,writable:!0,value:at}):Fe[He]=at;var Ue=(Fe,He,at)=>Ar(Fe,typeof He!="symbol"?He+"":He,at),xr=(Fe,He,at)=>He.has(Fe)||wr("Cannot "+at);var Re=(Fe,He,at)=>(xr(Fe,He,"read from private field"),at?at.call(Fe):He.get(Fe)),Le=(Fe,He,at)=>He.has(Fe)?wr("Cannot add the same private member more than once"):He instanceof WeakSet?He.add(Fe):He.set(Fe,at),we=(Fe,He,at,wt)=>(xr(Fe,He,"write to private field"),wt?wt.call(Fe,at):He.set(Fe,at),at),st=(Fe,He,at)=>(xr(Fe,He,"access private method"),at);var Fe,He,at,wt,ot,St,_t,Ut,Ht,jt,Gt,Kt,zt,Vt,Wt,Jt,Zt,Xt,It,Rt,Et,$t,Yt,ur,ir,Bt,Qt,cr,_r,er,dr,tr,rr,nr,Pt,ar,yr,sr,vr,Tt,fr,or,gr;const version$1="6.13.4";async function resolveProperties(t){const e=Object.keys(t);return(await Promise.all(e.map(a=>Promise.resolve(t[a])))).reduce((a,c,o)=>(a[e[o]]=c,a),{})}function defineProperties(t,e,n){for(let a in e){let c=e[a];Object.defineProperty(t,a,{enumerable:!0,value:c,writable:!1})}}function stringify(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(stringify).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let a=0;a<t.length;a++)n+=e[t[a]>>4],n+=e[t[a]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return stringify(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${stringify(n)}: ${stringify(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function makeError(t,e,n){let a=t;{const o=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${stringify(n)}`);for(const u in n){if(u==="shortMessage")continue;const h=n[u];o.push(u+"="+stringify(h))}}o.push(`code=${e}`),o.push(`version=${version$1}`),o.length&&(t+=" ("+o.join(", ")+")")}let c;switch(e){case"INVALID_ARGUMENT":c=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":c=new RangeError(t);break;default:c=new Error(t)}return defineProperties(c,{code:e}),n&&Object.assign(c,n),c.shortMessage==null&&defineProperties(c,{shortMessage:a}),c}function assert$f(t,e,n,a){if(!t)throw makeError(e,n,a)}function assertArgument(t,e,n,a){assert$f(t,e,"INVALID_ARGUMENT",{argument:n,value:a})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function assertNormalize(t){assert$f(_normalizeForms.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function assertPrivate(t,e,n){if(n==null&&(n=""),t!==e){let a=n,c="new";n&&(a+=".",c+=" "+n),assert$f(!1,`private constructor; use ${a}from* methods`,"UNSUPPORTED_OPERATION",{operation:c})}}function _getBytes(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const a=new Uint8Array((t.length-2)/2);let c=2;for(let o=0;o<a.length;o++)a[o]=parseInt(t.substring(c,c+2),16),c+=2;return a}assertArgument(!1,"invalid BytesLike value",e||"value",t)}function getBytes(t,e){return _getBytes(t,e,!1)}function getBytesCopy(t,e){return _getBytes(t,e,!0)}function isHexString$1(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function isBytesLike(t){return isHexString$1(t,!0)||t instanceof Uint8Array}const HexCharacters="0123456789abcdef";function hexlify(t){const e=getBytes(t);let n="0x";for(let a=0;a<e.length;a++){const c=e[a];n+=HexCharacters[(c&240)>>4]+HexCharacters[c&15]}return n}function concat(t){return"0x"+t.map(e=>hexlify(e).substring(2)).join("")}function dataLength(t){return isHexString$1(t,!0)?(t.length-2)/2:getBytes(t).length}function dataSlice(t,e,n){const a=getBytes(t);return n>a.length&&assert$f(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:a,length:a.length,offset:n}),hexlify(a.slice(e,n))}function zeroPad(t,e,n){const a=getBytes(t);assert$f(e>=a.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(a),length:e,offset:e+1});const c=new Uint8Array(e);return c.fill(0),c.set(a,e-a.length),hexlify(c)}function zeroPadValue(t,e){return zeroPad(t,e)}const BN_0$5=BigInt(0),BN_1$2=BigInt(1),maxValue=9007199254740991;function toTwos(t,e){let n=getBigInt(t,"value");const a=BigInt(getNumber(e,"width")),c=BN_1$2<<a-BN_1$2;if(n<BN_0$5){n=-n,assert$f(n<=c,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const o=(BN_1$2<<a)-BN_1$2;return(~n&o)+BN_1$2}else assert$f(n<c,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return n}function mask(t,e){const n=getUint(t,"value"),a=BigInt(getNumber(e,"bits"));return n&(BN_1$2<<a)-BN_1$2}function getBigInt(t,e){switch(typeof t){case"bigint":return t;case"number":return assertArgument(Number.isInteger(t),"underflow",e||"value",t),assertArgument(t>=-maxValue&&t<=maxValue,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){assertArgument(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}assertArgument(!1,"invalid BigNumberish value",e||"value",t)}function getUint(t,e){const n=getBigInt(t,e);return assert$f(n>=BN_0$5,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const Nibbles$1="0123456789abcdef";function toBigInt(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Nibbles$1[n>>4],e+=Nibbles$1[n&15];return BigInt(e)}return getBigInt(t)}function getNumber(t,e){switch(typeof t){case"bigint":return assertArgument(t>=-maxValue&&t<=maxValue,"overflow",e||"value",t),Number(t);case"number":return assertArgument(Number.isInteger(t),"underflow",e||"value",t),assertArgument(t>=-maxValue&&t<=maxValue,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return getNumber(BigInt(t),e)}catch(n){assertArgument(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}assertArgument(!1,"invalid numeric value",e||"value",t)}function toBeHex(t,e){let a=getUint(t,"value").toString(16);{const c=getNumber(e,"width");for(assert$f(c*2>=a.length,`value exceeds width (${c} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});a.length<c*2;)a="0"+a}return"0x"+a}function toBeArray(t){const e=getUint(t,"value");if(e===BN_0$5)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const a=new Uint8Array(n.length/2);for(let c=0;c<a.length;c++){const o=c*2;a[c]=parseInt(n.substring(o,o+2),16)}return a}function toQuantity(t){let e=hexlify(isBytesLike(t)?t:toBeArray(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const Alphabet="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let Lookup=null;function getAlpha(t){if(Lookup==null){Lookup={};for(let n=0;n<Alphabet.length;n++)Lookup[Alphabet[n]]=BigInt(n)}const e=Lookup[t];return assertArgument(e!=null,"invalid base58 value","letter",t),e}const BN_0$4=BigInt(0),BN_58=BigInt(58);function encodeBase58(t){const e=getBytes(t);let n=toBigInt(e),a="";for(;n;)a=Alphabet[Number(n%BN_58)]+a,n/=BN_58;for(let c=0;c<e.length&&!e[c];c++)a=Alphabet[0]+a;return a}function decodeBase58(t){let e=BN_0$4;for(let n=0;n<t.length;n++)e*=BN_58,e+=getAlpha(t[n]);return e}function toUtf8Bytes(t,e){assertArgument(typeof t=="string","invalid string value","str",t),e!=null&&(assertNormalize(e),t=t.normalize(e));let n=[];for(let a=0;a<t.length;a++){const c=t.charCodeAt(a);if(c<128)n.push(c);else if(c<2048)n.push(c>>6|192),n.push(c&63|128);else if((c&64512)==55296){a++;const o=t.charCodeAt(a);assertArgument(a<t.length&&(o&64512)===56320,"invalid surrogate pair","str",t);const u=65536+((c&1023)<<10)+(o&1023);n.push(u>>18|240),n.push(u>>12&63|128),n.push(u>>6&63|128),n.push(u&63|128)}else n.push(c>>12|224),n.push(c>>6&63|128),n.push(c&63|128)}return new Uint8Array(n)}function hexlifyByte(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function unarrayifyInteger(t,e,n){let a=0;for(let c=0;c<n;c++)a=a*256+t[e+c];return a}function _decodeChildren(t,e,n,a){const c=[];for(;n<e+1+a;){const o=_decode(t,n);c.push(o.result),n+=o.consumed,assert$f(n<=e+1+a,"child data too short","BUFFER_OVERRUN",{buffer:t,length:a,offset:e})}return{consumed:1+a,result:c}}function _decode(t,e){assert$f(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const n=a=>{assert$f(a<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:a})};if(t[e]>=248){const a=t[e]-247;n(e+1+a);const c=unarrayifyInteger(t,e+1,a);return n(e+1+a+c),_decodeChildren(t,e,e+1+a,a+c)}else if(t[e]>=192){const a=t[e]-192;return n(e+1+a),_decodeChildren(t,e,e+1,a)}else if(t[e]>=184){const a=t[e]-183;n(e+1+a);const c=unarrayifyInteger(t,e+1,a);n(e+1+a+c);const o=hexlify(t.slice(e+1+a,e+1+a+c));return{consumed:1+a+c,result:o}}else if(t[e]>=128){const a=t[e]-128;n(e+1+a);const c=hexlify(t.slice(e+1,e+1+a));return{consumed:1+a,result:c}}return{consumed:1,result:hexlifyByte(t[e])}}function decodeRlp(t){const e=getBytes(t,"data"),n=_decode(e,0);return assertArgument(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function arrayifyInteger(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function _encode(t){if(Array.isArray(t)){let a=[];if(t.forEach(function(o){a=a.concat(_encode(o))}),a.length<=55)return a.unshift(192+a.length),a;const c=arrayifyInteger(a.length);return c.unshift(247+c.length),c.concat(a)}const e=Array.prototype.slice.call(getBytes(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=arrayifyInteger(e.length);return n.unshift(183+n.length),n.concat(e)}const nibbles="0123456789abcdef";function encodeRlp(t){let e="0x";for(const n of _encode(t))e+=nibbles[n>>4],e+=nibbles[n&15];return e}function uuidV4(t){const e=getBytes(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const n=hexlify(e);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join("-")}const global$1=globalThis||void 0||self;function number(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function bytes(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function hash$4(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(t.outputLen),number(t.blockLen)}function exists(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function output(t,e){bytes(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const crypto$2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u8a$1=t=>t instanceof Uint8Array,u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),rotr=(t,e)=>t<<32-e|t>>>e,isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");const nextTick=async()=>{};async function asyncLoop(t,e,n){let a=Date.now();for(let c=0;c<t;c++){n(c);const o=Date.now()-a;o>=0&&o<e||(await nextTick(),a+=o)}}function utf8ToBytes$1(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function toBytes(t){if(typeof t=="string"&&(t=utf8ToBytes$1(t)),!u8a$1(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function concatBytes$1(...t){const e=new Uint8Array(t.reduce((a,c)=>a+c.length,0));let n=0;return t.forEach(a=>{if(!u8a$1(a))throw new Error("Uint8Array expected");e.set(a,n),n+=a.length}),e}class Hash{clone(){return this._cloneInto()}}const toStr={}.toString;function checkOpts(t,e){if(e!==void 0&&toStr.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function wrapConstructor(t){const e=a=>t().update(toBytes(a)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function randomBytes$2(t=32){if(crypto$2&&typeof crypto$2.getRandomValues=="function")return crypto$2.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class HMAC extends Hash{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,hash$4(e);const a=toBytes(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const c=this.blockLen,o=new Uint8Array(c);o.set(a.length>c?e.create().update(a).digest():a);for(let u=0;u<o.length;u++)o[u]^=54;this.iHash.update(o),this.oHash=e.create();for(let u=0;u<o.length;u++)o[u]^=106;this.oHash.update(o),o.fill(0)}update(e){return exists(this),this.iHash.update(e),this}digestInto(e){exists(this),bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:a,finished:c,destroyed:o,blockLen:u,outputLen:h}=this;return e=e,e.finished=c,e.destroyed=o,e.blockLen=u,e.outputLen=h,e.oHash=n._cloneInto(e.oHash),e.iHash=a._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const hmac$1=(t,e,n)=>new HMAC(t,e).update(n).digest();hmac$1.create=(t,e)=>new HMAC(t,e);function pbkdf2Init(t,e,n,a){hash$4(t);const c=checkOpts({dkLen:32,asyncTick:10},a),{c:o,dkLen:u,asyncTick:h}=c;if(number(o),number(u),number(h),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=toBytes(e),b=toBytes(n),d=new Uint8Array(u),p=hmac$1.create(t,l),x=p._cloneInto().update(b);return{c:o,dkLen:u,asyncTick:h,DK:d,PRF:p,PRFSalt:x}}function pbkdf2Output(t,e,n,a,c){return t.destroy(),e.destroy(),a&&a.destroy(),c.fill(0),n}function pbkdf2$1(t,e,n,a){const{c,dkLen:o,DK:u,PRF:h,PRFSalt:l}=pbkdf2Init(t,e,n,a);let b;const d=new Uint8Array(4),p=createView(d),x=new Uint8Array(h.outputLen);for(let m=1,v=0;v<o;m++,v+=h.outputLen){const g=u.subarray(v,v+h.outputLen);p.setInt32(0,m,!1),(b=l._cloneInto(b)).update(d).digestInto(x),g.set(x.subarray(0,g.length));for(let $=1;$<c;$++){h._cloneInto(b).update(x).digestInto(x);for(let B=0;B<g.length;B++)g[B]^=x[B]}}return pbkdf2Output(h,l,u,b,x)}function setBigUint64(t,e,n,a){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,a);const c=BigInt(32),o=BigInt(4294967295),u=Number(n>>c&o),h=Number(n&o),l=a?4:0,b=a?0:4;t.setUint32(e+l,u,a),t.setUint32(e+b,h,a)}class SHA2 extends Hash{constructor(e,n,a,c){super(),this.blockLen=e,this.outputLen=n,this.padOffset=a,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=createView(this.buffer)}update(e){exists(this);const{view:n,buffer:a,blockLen:c}=this;e=toBytes(e);const o=e.length;for(let u=0;u<o;){const h=Math.min(c-this.pos,o-u);if(h===c){const l=createView(e);for(;c<=o-u;u+=c)this.process(l,u);continue}a.set(e.subarray(u,u+h),this.pos),this.pos+=h,u+=h,this.pos===c&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){exists(this),output(e,this),this.finished=!0;const{buffer:n,view:a,blockLen:c,isLE:o}=this;let{pos:u}=this;n[u++]=128,this.buffer.subarray(u).fill(0),this.padOffset>c-u&&(this.process(a,0),u=0);for(let p=u;p<c;p++)n[p]=0;setBigUint64(a,c-8,BigInt(this.length*8),o),this.process(a,0);const h=createView(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const b=l/4,d=this.get();if(b>d.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<b;p++)h.setUint32(4*p,d[p],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const a=e.slice(0,n);return this.destroy(),a}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:a,length:c,finished:o,destroyed:u,pos:h}=this;return e.length=c,e.pos=h,e.finished=o,e.destroyed=u,c%n&&e.buffer.set(a),e}}const Chi=(t,e,n)=>t&e^~t&n,Maj=(t,e,n)=>t&e^t&n^e&n,SHA256_K=new Uint32Array([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]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);let SHA256$2=class extends SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:e,B:n,C:a,D:c,E:o,F:u,G:h,H:l}=this;return[e,n,a,c,o,u,h,l]}set(e,n,a,c,o,u,h,l){this.A=e|0,this.B=n|0,this.C=a|0,this.D=c|0,this.E=o|0,this.F=u|0,this.G=h|0,this.H=l|0}process(e,n){for(let p=0;p<16;p++,n+=4)SHA256_W[p]=e.getUint32(n,!1);for(let p=16;p<64;p++){const x=SHA256_W[p-15],m=SHA256_W[p-2],v=rotr(x,7)^rotr(x,18)^x>>>3,g=rotr(m,17)^rotr(m,19)^m>>>10;SHA256_W[p]=g+SHA256_W[p-7]+v+SHA256_W[p-16]|0}let{A:a,B:c,C:o,D:u,E:h,F:l,G:b,H:d}=this;for(let p=0;p<64;p++){const x=rotr(h,6)^rotr(h,11)^rotr(h,25),m=d+x+Chi(h,l,b)+SHA256_K[p]+SHA256_W[p]|0,g=(rotr(a,2)^rotr(a,13)^rotr(a,22))+Maj(a,c,o)|0;d=b,b=l,l=h,h=u+m|0,u=o,o=c,c=a,a=m+g|0}a=a+this.A|0,c=c+this.B|0,o=o+this.C|0,u=u+this.D|0,h=h+this.E|0,l=l+this.F|0,b=b+this.G|0,d=d+this.H|0,this.set(a,c,o,u,h,l,b,d)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const sha256$3=wrapConstructor(()=>new SHA256$2),U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(t,e=!1){return e?{h:Number(t&U32_MASK64),l:Number(t>>_32n&U32_MASK64)}:{h:Number(t>>_32n&U32_MASK64)|0,l:Number(t&U32_MASK64)|0}}function split(t,e=!1){let n=new Uint32Array(t.length),a=new Uint32Array(t.length);for(let c=0;c<t.length;c++){const{h:o,l:u}=fromBig(t[c],e);[n[c],a[c]]=[o,u]}return[n,a]}const toBig=(t,e)=>BigInt(t>>>0)<<_32n|BigInt(e>>>0),shrSH=(t,e,n)=>t>>>n,shrSL=(t,e,n)=>t<<32-n|e>>>n,rotrSH=(t,e,n)=>t>>>n|e<<32-n,rotrSL=(t,e,n)=>t<<32-n|e>>>n,rotrBH=(t,e,n)=>t<<64-n|e>>>n-32,rotrBL=(t,e,n)=>t>>>n-32|e<<64-n,rotr32H=(t,e)=>e,rotr32L=(t,e)=>t,rotlSH=(t,e,n)=>t<<n|e>>>32-n,rotlSL=(t,e,n)=>e<<n|t>>>32-n,rotlBH=(t,e,n)=>e<<n-32|t>>>64-n,rotlBL=(t,e,n)=>t<<n-32|e>>>64-n;function add(t,e,n,a){const c=(e>>>0)+(a>>>0);return{h:t+n+(c/2**32|0)|0,l:c|0}}const add3L=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),add3H=(t,e,n,a)=>e+n+a+(t/2**32|0)|0,add4L=(t,e,n,a)=>(t>>>0)+(e>>>0)+(n>>>0)+(a>>>0),add4H=(t,e,n,a,c)=>e+n+a+c+(t/2**32|0)|0,add5L=(t,e,n,a,c)=>(t>>>0)+(e>>>0)+(n>>>0)+(a>>>0)+(c>>>0),add5H=(t,e,n,a,c,o)=>e+n+a+c+o+(t/2**32|0)|0,u64={fromBig,split,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH,rotlSL,rotlBH,rotlBL,add,add3L,add3H,add4L,add4H,add5H,add5L},[SHA512_Kh,SHA512_Kl]=u64.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),SHA512_W_H=new Uint32Array(80),SHA512_W_L=new Uint32Array(80);let SHA512$2=class extends SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:a,Bl:c,Ch:o,Cl:u,Dh:h,Dl:l,Eh:b,El:d,Fh:p,Fl:x,Gh:m,Gl:v,Hh:g,Hl:$}=this;return[e,n,a,c,o,u,h,l,b,d,p,x,m,v,g,$]}set(e,n,a,c,o,u,h,l,b,d,p,x,m,v,g,$){this.Ah=e|0,this.Al=n|0,this.Bh=a|0,this.Bl=c|0,this.Ch=o|0,this.Cl=u|0,this.Dh=h|0,this.Dl=l|0,this.Eh=b|0,this.El=d|0,this.Fh=p|0,this.Fl=x|0,this.Gh=m|0,this.Gl=v|0,this.Hh=g|0,this.Hl=$|0}process(e,n){for(let F=0;F<16;F++,n+=4)SHA512_W_H[F]=e.getUint32(n),SHA512_W_L[F]=e.getUint32(n+=4);for(let F=16;F<80;F++){const H=SHA512_W_H[F-15]|0,W=SHA512_W_L[F-15]|0,Z=u64.rotrSH(H,W,1)^u64.rotrSH(H,W,8)^u64.shrSH(H,W,7),ie=u64.rotrSL(H,W,1)^u64.rotrSL(H,W,8)^u64.shrSL(H,W,7),te=SHA512_W_H[F-2]|0,ae=SHA512_W_L[F-2]|0,de=u64.rotrSH(te,ae,19)^u64.rotrBH(te,ae,61)^u64.shrSH(te,ae,6),J=u64.rotrSL(te,ae,19)^u64.rotrBL(te,ae,61)^u64.shrSL(te,ae,6),R=u64.add4L(ie,J,SHA512_W_L[F-7],SHA512_W_L[F-16]),A=u64.add4H(R,Z,de,SHA512_W_H[F-7],SHA512_W_H[F-16]);SHA512_W_H[F]=A|0,SHA512_W_L[F]=R|0}let{Ah:a,Al:c,Bh:o,Bl:u,Ch:h,Cl:l,Dh:b,Dl:d,Eh:p,El:x,Fh:m,Fl:v,Gh:g,Gl:$,Hh:B,Hl:C}=this;for(let F=0;F<80;F++){const H=u64.rotrSH(p,x,14)^u64.rotrSH(p,x,18)^u64.rotrBH(p,x,41),W=u64.rotrSL(p,x,14)^u64.rotrSL(p,x,18)^u64.rotrBL(p,x,41),Z=p&m^~p&g,ie=x&v^~x&$,te=u64.add5L(C,W,ie,SHA512_Kl[F],SHA512_W_L[F]),ae=u64.add5H(te,B,H,Z,SHA512_Kh[F],SHA512_W_H[F]),de=te|0,J=u64.rotrSH(a,c,28)^u64.rotrBH(a,c,34)^u64.rotrBH(a,c,39),R=u64.rotrSL(a,c,28)^u64.rotrBL(a,c,34)^u64.rotrBL(a,c,39),A=a&o^a&h^o&h,y=c&u^c&l^u&l;B=g|0,C=$|0,g=m|0,$=v|0,m=p|0,v=x|0,{h:p,l:x}=u64.add(b|0,d|0,ae|0,de|0),b=h|0,d=l|0,h=o|0,l=u|0,o=a|0,u=c|0;const w=u64.add3L(de,R,y);a=u64.add3H(w,ae,J,A),c=w|0}({h:a,l:c}=u64.add(this.Ah|0,this.Al|0,a|0,c|0)),{h:o,l:u}=u64.add(this.Bh|0,this.Bl|0,o|0,u|0),{h,l}=u64.add(this.Ch|0,this.Cl|0,h|0,l|0),{h:b,l:d}=u64.add(this.Dh|0,this.Dl|0,b|0,d|0),{h:p,l:x}=u64.add(this.Eh|0,this.El|0,p|0,x|0),{h:m,l:v}=u64.add(this.Fh|0,this.Fl|0,m|0,v|0),{h:g,l:$}=u64.add(this.Gh|0,this.Gl|0,g|0,$|0),{h:B,l:C}=u64.add(this.Hh|0,this.Hl|0,B|0,C|0),this.set(a,c,o,u,h,l,b,d,p,x,m,v,g,$,B,C)}roundClean(){SHA512_W_H.fill(0),SHA512_W_L.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const sha512$2=wrapConstructor(()=>new SHA512$2);function getGlobal(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global$1<"u")return global$1;throw new Error("unable to locate global object")}const anyGlobal=getGlobal(),crypto$1=anyGlobal.crypto||anyGlobal.msCrypto;function createHash(t){switch(t){case"sha256":return sha256$3.create();case"sha512":return sha512$2.create()}assertArgument(!1,"invalid hashing algorithm name","algorithm",t)}function createHmac(t,e){const n={sha256:sha256$3,sha512:sha512$2}[t];return assertArgument(n!=null,"invalid hmac algorithm","algorithm",t),hmac$1.create(n,e)}function pbkdf2Sync(t,e,n,a,c){const o={sha256:sha256$3,sha512:sha512$2}[c];return assertArgument(o!=null,"invalid pbkdf2 algorithm","algorithm",c),pbkdf2$1(o,t,e,{c:n,dkLen:a})}function randomBytes$1(t){assert$f(crypto$1!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),assertArgument(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return crypto$1.getRandomValues(e),e}let locked$4=!1;const _computeHmac=function(t,e,n){return createHmac(t,e).update(n).digest()};let __computeHmac=_computeHmac;function computeHmac(t,e,n){const a=getBytes(e,"key"),c=getBytes(n,"data");return hexlify(__computeHmac(t,a,c))}computeHmac._=_computeHmac,computeHmac.lock=function(){locked$4=!0},computeHmac.register=function(t){if(locked$4)throw new Error("computeHmac is locked");__computeHmac=t},Object.freeze(computeHmac);const[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]],_0n$4=BigInt(0),_1n$5=BigInt(1),_2n$3=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let t=0,e=_1n$5,n=1,a=0;t<24;t++){[n,a]=[a,(2*n+3*a)%5],SHA3_PI.push(2*(5*a+n)),SHA3_ROTL.push((t+1)*(t+2)/2%64);let c=_0n$4;for(let o=0;o<7;o++)e=(e<<_1n$5^(e>>_7n)*_0x71n)%_256n,e&_2n$3&&(c^=_1n$5<<(_1n$5<<BigInt(o))-_1n$5);_SHA3_IOTA.push(c)}const[SHA3_IOTA_H,SHA3_IOTA_L]=split(_SHA3_IOTA,!0),rotlH=(t,e,n)=>n>32?rotlBH(t,e,n):rotlSH(t,e,n),rotlL=(t,e,n)=>n>32?rotlBL(t,e,n):rotlSL(t,e,n);function keccakP(t,e=24){const n=new Uint32Array(10);for(let a=24-e;a<24;a++){for(let u=0;u<10;u++)n[u]=t[u]^t[u+10]^t[u+20]^t[u+30]^t[u+40];for(let u=0;u<10;u+=2){const h=(u+8)%10,l=(u+2)%10,b=n[l],d=n[l+1],p=rotlH(b,d,1)^n[h],x=rotlL(b,d,1)^n[h+1];for(let m=0;m<50;m+=10)t[u+m]^=p,t[u+m+1]^=x}let c=t[2],o=t[3];for(let u=0;u<24;u++){const h=SHA3_ROTL[u],l=rotlH(c,o,h),b=rotlL(c,o,h),d=SHA3_PI[u];c=t[d],o=t[d+1],t[d]=l,t[d+1]=b}for(let u=0;u<50;u+=10){for(let h=0;h<10;h++)n[h]=t[u+h];for(let h=0;h<10;h++)t[u+h]^=~n[(h+2)%10]&n[(h+4)%10]}t[0]^=SHA3_IOTA_H[a],t[1]^=SHA3_IOTA_L[a]}n.fill(0)}class Keccak extends Hash{constructor(e,n,a,c=!1,o=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=a,this.enableXOF=c,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number(a),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){exists(this);const{blockLen:n,state:a}=this;e=toBytes(e);const c=e.length;for(let o=0;o<c;){const u=Math.min(n-this.pos,c-o);for(let h=0;h<u;h++)a[this.pos++]^=e[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:a,blockLen:c}=this;e[a]^=n,n&128&&a===c-1&&this.keccak(),e[c-1]^=128,this.keccak()}writeInto(e){exists(this,!1),bytes(e),this.finish();const n=this.state,{blockLen:a}=this;for(let c=0,o=e.length;c<o;){this.posOut>=a&&this.keccak();const u=Math.min(a-this.posOut,o-c);e.set(n.subarray(this.posOut,this.posOut+u),c),this.posOut+=u,c+=u}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:a,outputLen:c,rounds:o,enableXOF:u}=this;return e||(e=new Keccak(n,a,c,u,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=a,e.outputLen=c,e.enableXOF=u,e.destroyed=this.destroyed,e}}const gen=(t,e,n)=>wrapConstructor(()=>new Keccak(e,t,n)),keccak_256=gen(1,136,256/8);let locked$3=!1;const _keccak256=function(t){return keccak_256(t)};let __keccak256=_keccak256;function keccak256(t){const e=getBytes(t,"data");return hexlify(__keccak256(e))}keccak256._=_keccak256,keccak256.lock=function(){locked$3=!0},keccak256.register=function(t){if(locked$3)throw new TypeError("keccak256 is locked");__keccak256=t},Object.freeze(keccak256);const Rho=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Id=Uint8Array.from({length:16},(t,e)=>e),Pi=Id.map(t=>(9*t+5)%16);let idxL=[Id],idxR=[Pi];for(let t=0;t<4;t++)for(let e of[idxL,idxR])e.push(e[t].map(n=>Rho[n]));const shifts=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),shiftsL=idxL.map((t,e)=>t.map(n=>shifts[e][n])),shiftsR=idxR.map((t,e)=>t.map(n=>shifts[e][n])),Kl=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Kr=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),rotl$1=(t,e)=>t<<e|t>>>32-e;function f$1(t,e,n,a){return t===0?e^n^a:t===1?e&n|~e&a:t===2?(e|~n)^a:t===3?e&a|n&~a:e^(n|~a)}const BUF=new Uint32Array(16);let RIPEMD160$1=class extends SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:n,h2:a,h3:c,h4:o}=this;return[e,n,a,c,o]}set(e,n,a,c,o){this.h0=e|0,this.h1=n|0,this.h2=a|0,this.h3=c|0,this.h4=o|0}process(e,n){for(let m=0;m<16;m++,n+=4)BUF[m]=e.getUint32(n,!0);let a=this.h0|0,c=a,o=this.h1|0,u=o,h=this.h2|0,l=h,b=this.h3|0,d=b,p=this.h4|0,x=p;for(let m=0;m<5;m++){const v=4-m,g=Kl[m],$=Kr[m],B=idxL[m],C=idxR[m],F=shiftsL[m],H=shiftsR[m];for(let W=0;W<16;W++){const Z=rotl$1(a+f$1(m,o,h,b)+BUF[B[W]]+g,F[W])+p|0;a=p,p=b,b=rotl$1(h,10)|0,h=o,o=Z}for(let W=0;W<16;W++){const Z=rotl$1(c+f$1(v,u,l,d)+BUF[C[W]]+$,H[W])+x|0;c=x,x=d,d=rotl$1(l,10)|0,l=u,u=Z}}this.set(this.h1+h+d|0,this.h2+b+x|0,this.h3+p+c|0,this.h4+a+u|0,this.h0+o+l|0)}roundClean(){BUF.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};const ripemd160$2=wrapConstructor(()=>new RIPEMD160$1);let locked$2=!1;const _ripemd160=function(t){return ripemd160$2(t)};let __ripemd160=_ripemd160;function ripemd160$1(t){const e=getBytes(t,"data");return hexlify(__ripemd160(e))}ripemd160$1._=_ripemd160,ripemd160$1.lock=function(){locked$2=!0},ripemd160$1.register=function(t){if(locked$2)throw new TypeError("ripemd160 is locked");__ripemd160=t},Object.freeze(ripemd160$1);let locked$1=!1;const _pbkdf2=function(t,e,n,a,c){return pbkdf2Sync(t,e,n,a,c)};let __pbkdf2=_pbkdf2;function pbkdf2(t,e,n,a,c){const o=getBytes(t,"password"),u=getBytes(e,"salt");return hexlify(__pbkdf2(o,u,n,a,c))}pbkdf2._=_pbkdf2,pbkdf2.lock=function(){locked$1=!0},pbkdf2.register=function(t){if(locked$1)throw new Error("pbkdf2 is locked");__pbkdf2=t},Object.freeze(pbkdf2);let locked=!1;const _randomBytes=function(t){return new Uint8Array(randomBytes$1(t))};let __randomBytes=_randomBytes;function randomBytes(t){return __randomBytes(t)}randomBytes._=_randomBytes,randomBytes.lock=function(){locked=!0},randomBytes.register=function(t){if(locked)throw new Error("randomBytes is locked");__randomBytes=t},Object.freeze(randomBytes);const rotl=(t,e)=>t<<e|t>>>32-e;function XorAndSalsa(t,e,n,a,c,o){let u=t[e++]^n[a++],h=t[e++]^n[a++],l=t[e++]^n[a++],b=t[e++]^n[a++],d=t[e++]^n[a++],p=t[e++]^n[a++],x=t[e++]^n[a++],m=t[e++]^n[a++],v=t[e++]^n[a++],g=t[e++]^n[a++],$=t[e++]^n[a++],B=t[e++]^n[a++],C=t[e++]^n[a++],F=t[e++]^n[a++],H=t[e++]^n[a++],W=t[e++]^n[a++],Z=u,ie=h,te=l,ae=b,de=d,J=p,R=x,A=m,y=v,w=g,I=$,M=B,k=C,P=F,_=H,q=W;for(let E=0;E<8;E+=2)de^=rotl(Z+k|0,7),y^=rotl(de+Z|0,9),k^=rotl(y+de|0,13),Z^=rotl(k+y|0,18),w^=rotl(J+ie|0,7),P^=rotl(w+J|0,9),ie^=rotl(P+w|0,13),J^=rotl(ie+P|0,18),_^=rotl(I+R|0,7),te^=rotl(_+I|0,9),R^=rotl(te+_|0,13),I^=rotl(R+te|0,18),ae^=rotl(q+M|0,7),A^=rotl(ae+q|0,9),M^=rotl(A+ae|0,13),q^=rotl(M+A|0,18),ie^=rotl(Z+ae|0,7),te^=rotl(ie+Z|0,9),ae^=rotl(te+ie|0,13),Z^=rotl(ae+te|0,18),R^=rotl(J+de|0,7),A^=rotl(R+J|0,9),de^=rotl(A+R|0,13),J^=rotl(de+A|0,18),M^=rotl(I+w|0,7),y^=rotl(M+I|0,9),w^=rotl(y+M|0,13),I^=rotl(w+y|0,18),k^=rotl(q+_|0,7),P^=rotl(k+q|0,9),_^=rotl(P+k|0,13),q^=rotl(_+P|0,18);c[o++]=u+Z|0,c[o++]=h+ie|0,c[o++]=l+te|0,c[o++]=b+ae|0,c[o++]=d+de|0,c[o++]=p+J|0,c[o++]=x+R|0,c[o++]=m+A|0,c[o++]=v+y|0,c[o++]=g+w|0,c[o++]=$+I|0,c[o++]=B+M|0,c[o++]=C+k|0,c[o++]=F+P|0,c[o++]=H+_|0,c[o++]=W+q|0}function BlockMix(t,e,n,a,c){let o=a+0,u=a+16*c;for(let h=0;h<16;h++)n[u+h]=t[e+(2*c-1)*16+h];for(let h=0;h<c;h++,o+=16,e+=16)XorAndSalsa(n,u,t,e,n,o),h>0&&(u+=16),XorAndSalsa(n,o,t,e+=16,n,u)}function scryptInit(t,e,n){const a=checkOpts({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:c,r:o,p:u,dkLen:h,asyncTick:l,maxmem:b,onProgress:d}=a;if(number(c),number(o),number(u),number(h),number(l),number(b),d!==void 0&&typeof d!="function")throw new Error("progressCb should be function");const p=128*o,x=p/4;if(c<=1||c&c-1||c>=2**(p/8)||c>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(u<0||u>(2**32-1)*32/p)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(h<0||h>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const m=p*(c+u);if(m>b)throw new Error(`Scrypt: parameters too large, ${m} (128 * r * (N + p)) > ${b} (maxmem)`);const v=pbkdf2$1(sha256$3,t,e,{c:1,dkLen:p*u}),g=u32(v),$=u32(new Uint8Array(p*c)),B=u32(new Uint8Array(p));let C=()=>{};if(d){const F=2*c*u,H=Math.max(Math.floor(F/1e4),1);let W=0;C=()=>{W++,d&&(!(W%H)||W===F)&&d(W/F)}}return{N:c,r:o,p:u,dkLen:h,blockSize32:x,V:$,B32:g,B:v,tmp:B,blockMixCb:C,asyncTick:l}}function scryptOutput(t,e,n,a,c){const o=pbkdf2$1(sha256$3,t,n,{c:1,dkLen:e});return n.fill(0),a.fill(0),c.fill(0),o}function scrypt$1(t,e,n){const{N:a,r:c,p:o,dkLen:u,blockSize32:h,V:l,B32:b,B:d,tmp:p,blockMixCb:x}=scryptInit(t,e,n);for(let m=0;m<o;m++){const v=h*m;for(let g=0;g<h;g++)l[g]=b[v+g];for(let g=0,$=0;g<a-1;g++)BlockMix(l,$,l,$+=h,c),x();BlockMix(l,(a-1)*h,b,v,c),x();for(let g=0;g<a;g++){const $=b[v+h-16]%a;for(let B=0;B<h;B++)p[B]=b[v+B]^l[$*h+B];BlockMix(p,0,b,v,c),x()}}return scryptOutput(t,u,d,l,p)}async function scryptAsync(t,e,n){const{N:a,r:c,p:o,dkLen:u,blockSize32:h,V:l,B32:b,B:d,tmp:p,blockMixCb:x,asyncTick:m}=scryptInit(t,e,n);for(let v=0;v<o;v++){const g=h*v;for(let B=0;B<h;B++)l[B]=b[g+B];let $=0;await asyncLoop(a-1,m,()=>{BlockMix(l,$,l,$+=h,c),x()}),BlockMix(l,(a-1)*h,b,g,c),x(),await asyncLoop(a,m,()=>{const B=b[g+h-16]%a;for(let C=0;C<h;C++)p[C]=b[g+C]^l[B*h+C];BlockMix(p,0,b,g,c),x()})}return scryptOutput(t,u,d,l,p)}let lockedSync=!1,lockedAsync=!1;const _scryptAsync=async function(t,e,n,a,c,o,u){return await scryptAsync(t,e,{N:n,r:a,p:c,dkLen:o,onProgress:u})},_scryptSync=function(t,e,n,a,c,o){return scrypt$1(t,e,{N:n,r:a,p:c,dkLen:o})};let __scryptAsync=_scryptAsync,__scryptSync=_scryptSync;async function scrypt(t,e,n,a,c,o,u){const h=getBytes(t,"passwd"),l=getBytes(e,"salt");return hexlify(await __scryptAsync(h,l,n,a,c,o,u))}scrypt._=_scryptAsync,scrypt.lock=function(){lockedAsync=!0},scrypt.register=function(t){if(lockedAsync)throw new Error("scrypt is locked");__scryptAsync=t},Object.freeze(scrypt);function scryptSync(t,e,n,a,c,o){const u=getBytes(t,"passwd"),h=getBytes(e,"salt");return hexlify(__scryptSync(u,h,n,a,c,o))}scryptSync._=_scryptSync,scryptSync.lock=function(){lockedSync=!0},scryptSync.register=function(t){if(lockedSync)throw new Error("scryptSync is locked");__scryptSync=t},Object.freeze(scryptSync);const _sha256=function(t){return createHash("sha256").update(t).digest()};let __sha256=_sha256,locked256=!1;function sha256$2(t){const e=getBytes(t,"data");return hexlify(__sha256(e))}sha256$2._=_sha256,sha256$2.lock=function(){locked256=!0},sha256$2.register=function(t){if(locked256)throw new Error("sha256 is locked");__sha256=t},Object.freeze(sha256$2),Object.freeze(sha256$2);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$3=BigInt(0),_1n$4=BigInt(1),_2n$2=BigInt(2),u8a=t=>t instanceof Uint8Array,hexes=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function bytesToHex$2(t){if(!u8a(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=hexes[t[n]];return e}function numberToHexUnpadded(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function hexToNumber(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function hexToBytes$1(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let a=0;a<n.length;a++){const c=a*2,o=t.slice(c,c+2),u=Number.parseInt(o,16);if(Number.isNaN(u)||u<0)throw new Error("Invalid byte sequence");n[a]=u}return n}function bytesToNumberBE(t){return hexToNumber(bytesToHex$2(t))}function bytesToNumberLE(t){if(!u8a(t))throw new Error("Uint8Array expected");return hexToNumber(bytesToHex$2(Uint8Array.from(t).reverse()))}function numberToBytesBE(t,e){return hexToBytes$1(t.toString(16).padStart(e*2,"0"))}function numberToBytesLE(t,e){return numberToBytesBE(t,e).reverse()}function numberToVarBytesBE(t){return hexToBytes$1(numberToHexUnpadded(t))}function ensureBytes(t,e,n){let a;if(typeof e=="string")try{a=hexToBytes$1(e)}catch(o){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${o}`)}else if(u8a(e))a=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const c=a.length;if(typeof n=="number"&&c!==n)throw new Error(`${t} expected ${n} bytes, got ${c}`);return a}function concatBytes(...t){const e=new Uint8Array(t.reduce((a,c)=>a+c.length,0));let n=0;return t.forEach(a=>{if(!u8a(a))throw new Error("Uint8Array expected");e.set(a,n),n+=a.length}),e}function equalBytes$1(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function utf8ToBytes(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function bitLen(t){let e;for(e=0;t>_0n$3;t>>=_1n$4,e+=1);return e}function bitGet(t,e){return t>>BigInt(e)&_1n$4}const bitSet=(t,e,n)=>t|(n?_1n$4:_0n$3)<<BigInt(e),bitMask=t=>(_2n$2<<BigInt(t-1))-_1n$4,u8n=t=>new Uint8Array(t),u8fr=t=>Uint8Array.from(t);function createHmacDrbg(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let a=u8n(t),c=u8n(t),o=0;const u=()=>{a.fill(1),c.fill(0),o=0},h=(...p)=>n(c,a,...p),l=(p=u8n())=>{c=h(u8fr([0]),p),a=h(),p.length!==0&&(c=h(u8fr([1]),p),a=h())},b=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let p=0;const x=[];for(;p<e;){a=h();const m=a.slice();x.push(m),p+=a.length}return concatBytes(...x)};return(p,x)=>{u(),l(p);let m;for(;!(m=x(b()));)l();return u(),m}}const validatorFns={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function validateObject(t,e,n={}){const a=(c,o,u)=>{const h=validatorFns[o];if(typeof h!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=t[c];if(!(u&&l===void 0)&&!h(l,t))throw new Error(`Invalid param ${String(c)}=${l} (${typeof l}), expected ${o}`)};for(const[c,o]of Object.entries(e))a(c,o,!1);for(const[c,o]of Object.entries(n))a(c,o,!0);return t}const ut=Object.freeze(Object.defineProperty({__proto__:null,bitGet,bitLen,bitMask,bitSet,bytesToHex:bytesToHex$2,bytesToNumberBE,bytesToNumberLE,concatBytes,createHmacDrbg,ensureBytes,equalBytes:equalBytes$1,hexToBytes:hexToBytes$1,hexToNumber,numberToBytesBE,numberToBytesLE,numberToHexUnpadded,numberToVarBytesBE,utf8ToBytes,validateObject},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$1=BigInt(2),_3n$1=BigInt(3),_4n=BigInt(4),_5n=BigInt(5),_8n=BigInt(8);BigInt(9),BigInt(16);function mod(t,e){const n=t%e;return n>=_0n$2?n:e+n}function pow(t,e,n){if(n<=_0n$2||e<_0n$2)throw new Error("Expected power/modulo > 0");if(n===_1n$3)return _0n$2;let a=_1n$3;for(;e>_0n$2;)e&_1n$3&&(a=a*t%n),t=t*t%n,e>>=_1n$3;return a}function pow2(t,e,n){let a=t;for(;e-- >_0n$2;)a*=a,a%=n;return a}function invert(t,e){if(t===_0n$2||e<=_0n$2)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=mod(t,e),a=e,c=_0n$2,o=_1n$3;for(;n!==_0n$2;){const h=a/n,l=a%n,b=c-o*h;a=n,n=l,c=o,o=b}if(a!==_1n$3)throw new Error("invert: does not exist");return mod(c,e)}function tonelliShanks(t){const e=(t-_1n$3)/_2n$1;let n,a,c;for(n=t-_1n$3,a=0;n%_2n$1===_0n$2;n/=_2n$1,a++);for(c=_2n$1;c<t&&pow(c,e,t)!==t-_1n$3;c++);if(a===1){const u=(t+_1n$3)/_4n;return function(l,b){const d=l.pow(b,u);if(!l.eql(l.sqr(d),b))throw new Error("Cannot find square root");return d}}const o=(n+_1n$3)/_2n$1;return function(h,l){if(h.pow(l,e)===h.neg(h.ONE))throw new Error("Cannot find square root");let b=a,d=h.pow(h.mul(h.ONE,c),n),p=h.pow(l,o),x=h.pow(l,n);for(;!h.eql(x,h.ONE);){if(h.eql(x,h.ZERO))return h.ZERO;let m=1;for(let g=h.sqr(x);m<b&&!h.eql(g,h.ONE);m++)g=h.sqr(g);const v=h.pow(d,_1n$3<<BigInt(b-m-1));d=h.sqr(v),p=h.mul(p,v),x=h.mul(x,d),b=m}return p}}function FpSqrt(t){if(t%_4n===_3n$1){const e=(t+_1n$3)/_4n;return function(a,c){const o=a.pow(c,e);if(!a.eql(a.sqr(o),c))throw new Error("Cannot find square root");return o}}if(t%_8n===_5n){const e=(t-_5n)/_8n;return function(a,c){const o=a.mul(c,_2n$1),u=a.pow(o,e),h=a.mul(c,u),l=a.mul(a.mul(h,_2n$1),u),b=a.mul(h,a.sub(l,a.ONE));if(!a.eql(a.sqr(b),c))throw new Error("Cannot find square root");return b}}return tonelliShanks(t)}const FIELD_FIELDS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=FIELD_FIELDS.reduce((a,c)=>(a[c]="function",a),e);return validateObject(t,n)}function FpPow(t,e,n){if(n<_0n$2)throw new Error("Expected power > 0");if(n===_0n$2)return t.ONE;if(n===_1n$3)return e;let a=t.ONE,c=e;for(;n>_0n$2;)n&_1n$3&&(a=t.mul(a,c)),c=t.sqr(c),n>>=_1n$3;return a}function FpInvertBatch(t,e){const n=new Array(e.length),a=e.reduce((o,u,h)=>t.is0(u)?o:(n[h]=o,t.mul(o,u)),t.ONE),c=t.inv(a);return e.reduceRight((o,u,h)=>t.is0(u)?o:(n[h]=t.mul(o,n[h]),t.mul(o,u)),c),n}function nLength(t,e){const n=e!==void 0?e:t.toString(2).length,a=Math.ceil(n/8);return{nBitLength:n,nByteLength:a}}function Field(t,e,n=!1,a={}){if(t<=_0n$2)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:c,nByteLength:o}=nLength(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const u=FpSqrt(t),h=Object.freeze({ORDER:t,BITS:c,BYTES:o,MASK:bitMask(c),ZERO:_0n$2,ONE:_1n$3,create:l=>mod(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return _0n$2<=l&&l<t},is0:l=>l===_0n$2,isOdd:l=>(l&_1n$3)===_1n$3,neg:l=>mod(-l,t),eql:(l,b)=>l===b,sqr:l=>mod(l*l,t),add:(l,b)=>mod(l+b,t),sub:(l,b)=>mod(l-b,t),mul:(l,b)=>mod(l*b,t),pow:(l,b)=>FpPow(h,l,b),div:(l,b)=>mod(l*invert(b,t),t),sqrN:l=>l*l,addN:(l,b)=>l+b,subN:(l,b)=>l-b,mulN:(l,b)=>l*b,inv:l=>invert(l,t),sqrt:a.sqrt||(l=>u(h,l)),invertBatch:l=>FpInvertBatch(h,l),cmov:(l,b,d)=>d?b:l,toBytes:l=>n?numberToBytesLE(l,o):numberToBytesBE(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return n?bytesToNumberLE(l):bytesToNumberBE(l)}});return Object.freeze(h)}function getFieldBytesLength(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function getMinHashLength(t){const e=getFieldBytesLength(t);return e+Math.ceil(e/2)}function mapHashToField(t,e,n=!1){const a=t.length,c=getFieldBytesLength(e),o=getMinHashLength(e);if(a<16||a<o||a>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${a}`);const u=n?bytesToNumberBE(t):bytesToNumberLE(t),h=mod(u,e-_1n$3)+_1n$3;return n?numberToBytesLE(h,c):numberToBytesBE(h,c)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$1=BigInt(0),_1n$2=BigInt(1);function wNAF(t,e){const n=(c,o)=>{const u=o.negate();return c?u:o},a=c=>{const o=Math.ceil(e/c)+1,u=2**(c-1);return{windows:o,windowSize:u}};return{constTimeNegate:n,unsafeLadder(c,o){let u=t.ZERO,h=c;for(;o>_0n$1;)o&_1n$2&&(u=u.add(h)),h=h.double(),o>>=_1n$2;return u},precomputeWindow(c,o){const{windows:u,windowSize:h}=a(o),l=[];let b=c,d=b;for(let p=0;p<u;p++){d=b,l.push(d);for(let x=1;x<h;x++)d=d.add(b),l.push(d);b=d.double()}return l},wNAF(c,o,u){const{windows:h,windowSize:l}=a(c);let b=t.ZERO,d=t.BASE;const p=BigInt(2**c-1),x=2**c,m=BigInt(c);for(let v=0;v<h;v++){const g=v*l;let $=Number(u&p);u>>=m,$>l&&($-=x,u+=_1n$2);const B=g,C=g+Math.abs($)-1,F=v%2!==0,H=$<0;$===0?d=d.add(n(F,o[B])):b=b.add(n(H,o[C]))}return{p:b,f:d}},wNAFCached(c,o,u,h){const l=c._WINDOW_SIZE||1;let b=o.get(c);return b||(b=this.precomputeWindow(c,l),l!==1&&o.set(c,h(b))),this.wNAF(l,b,u)}}}function validateBasic(t){return validateField(t.Fp),validateObject(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validatePointOpts(t){const e=validateBasic(t);validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:a,a:c}=e;if(n){if(!a.eql(c,a.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=ut,DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=DER;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],a=t.subarray(2,n+2);if(!n||a.length!==n)throw new e("Invalid signature integer: wrong length");if(a[0]&128)throw new e("Invalid signature integer: negative");if(a[0]===0&&!(a[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:b2n(a),l:t.subarray(n+2)}},toSig(t){const{Err:e}=DER,n=typeof t=="string"?h2b(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let a=n.length;if(a<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==a-2)throw new e("Invalid signature: incorrect length");const{d:c,l:o}=DER._parseInt(n.subarray(2)),{d:u,l:h}=DER._parseInt(o);if(h.length)throw new e("Invalid signature: left bytes after parsing");return{r:c,s:u}},hexFromSig(t){const e=b=>Number.parseInt(b[0],16)&8?"00"+b:b,n=b=>{const d=b.toString(16);return d.length&1?`0${d}`:d},a=e(n(t.s)),c=e(n(t.r)),o=a.length/2,u=c.length/2,h=n(o),l=n(u);return`30${n(u+o+4)}02${l}${c}02${h}${a}`}},_0n=BigInt(0),_1n$1=BigInt(1);BigInt(2);const _3n=BigInt(3);BigInt(4);function weierstrassPoints(t){const e=validatePointOpts(t),{Fp:n}=e,a=e.toBytes||((v,g,$)=>{const B=g.toAffine();return concatBytes(Uint8Array.from([4]),n.toBytes(B.x),n.toBytes(B.y))}),c=e.fromBytes||(v=>{const g=v.subarray(1),$=n.fromBytes(g.subarray(0,n.BYTES)),B=n.fromBytes(g.subarray(n.BYTES,2*n.BYTES));return{x:$,y:B}});function o(v){const{a:g,b:$}=e,B=n.sqr(v),C=n.mul(B,v);return n.add(n.add(C,n.mul(v,g)),$)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function u(v){return typeof v=="bigint"&&_0n<v&&v<e.n}function h(v){if(!u(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(v){const{allowedPrivateKeyLengths:g,nByteLength:$,wrapPrivateKey:B,n:C}=e;if(g&&typeof v!="bigint"){if(v instanceof Uint8Array&&(v=bytesToHex$2(v)),typeof v!="string"||!g.includes(v.length))throw new Error("Invalid key");v=v.padStart($*2,"0")}let F;try{F=typeof v=="bigint"?v:bytesToNumberBE(ensureBytes("private key",v,$))}catch{throw new Error(`private key must be ${$} bytes, hex or bigint, not ${typeof v}`)}return B&&(F=mod(F,C)),h(F),F}const b=new Map;function d(v){if(!(v instanceof p))throw new Error("ProjectivePoint expected")}class p{constructor(g,$,B){if(this.px=g,this.py=$,this.pz=B,g==null||!n.isValid(g))throw new Error("x required");if($==null||!n.isValid($))throw new Error("y required");if(B==null||!n.isValid(B))throw new Error("z required")}static fromAffine(g){const{x:$,y:B}=g||{};if(!g||!n.isValid($)||!n.isValid(B))throw new Error("invalid affine point");if(g instanceof p)throw new Error("projective point not allowed");const C=F=>n.eql(F,n.ZERO);return C($)&&C(B)?p.ZERO:new p($,B,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(g){const $=n.invertBatch(g.map(B=>B.pz));return g.map((B,C)=>B.toAffine($[C])).map(p.fromAffine)}static fromHex(g){const $=p.fromAffine(c(ensureBytes("pointHex",g)));return $.assertValidity(),$}static fromPrivateKey(g){return p.BASE.multiply(l(g))}_setWindowSize(g){this._WINDOW_SIZE=g,b.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:g,y:$}=this.toAffine();if(!n.isValid(g)||!n.isValid($))throw new Error("bad point: x or y not FE");const B=n.sqr($),C=o(g);if(!n.eql(B,C))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:g}=this.toAffine();if(n.isOdd)return!n.isOdd(g);throw new Error("Field doesn't support isOdd")}equals(g){d(g);const{px:$,py:B,pz:C}=this,{px:F,py:H,pz:W}=g,Z=n.eql(n.mul($,W),n.mul(F,C)),ie=n.eql(n.mul(B,W),n.mul(H,C));return Z&&ie}negate(){return new p(this.px,n.neg(this.py),this.pz)}double(){const{a:g,b:$}=e,B=n.mul($,_3n),{px:C,py:F,pz:H}=this;let W=n.ZERO,Z=n.ZERO,ie=n.ZERO,te=n.mul(C,C),ae=n.mul(F,F),de=n.mul(H,H),J=n.mul(C,F);return J=n.add(J,J),ie=n.mul(C,H),ie=n.add(ie,ie),W=n.mul(g,ie),Z=n.mul(B,de),Z=n.add(W,Z),W=n.sub(ae,Z),Z=n.add(ae,Z),Z=n.mul(W,Z),W=n.mul(J,W),ie=n.mul(B,ie),de=n.mul(g,de),J=n.sub(te,de),J=n.mul(g,J),J=n.add(J,ie),ie=n.add(te,te),te=n.add(ie,te),te=n.add(te,de),te=n.mul(te,J),Z=n.add(Z,te),de=n.mul(F,H),de=n.add(de,de),te=n.mul(de,J),W=n.sub(W,te),ie=n.mul(de,ae),ie=n.add(ie,ie),ie=n.add(ie,ie),new p(W,Z,ie)}add(g){d(g);const{px:$,py:B,pz:C}=this,{px:F,py:H,pz:W}=g;let Z=n.ZERO,ie=n.ZERO,te=n.ZERO;const ae=e.a,de=n.mul(e.b,_3n);let J=n.mul($,F),R=n.mul(B,H),A=n.mul(C,W),y=n.add($,B),w=n.add(F,H);y=n.mul(y,w),w=n.add(J,R),y=n.sub(y,w),w=n.add($,C);let I=n.add(F,W);return w=n.mul(w,I),I=n.add(J,A),w=n.sub(w,I),I=n.add(B,C),Z=n.add(H,W),I=n.mul(I,Z),Z=n.add(R,A),I=n.sub(I,Z),te=n.mul(ae,w),Z=n.mul(de,A),te=n.add(Z,te),Z=n.sub(R,te),te=n.add(R,te),ie=n.mul(Z,te),R=n.add(J,J),R=n.add(R,J),A=n.mul(ae,A),w=n.mul(de,w),R=n.add(R,A),A=n.sub(J,A),A=n.mul(ae,A),w=n.add(w,A),J=n.mul(R,w),ie=n.add(ie,J),J=n.mul(I,w),Z=n.mul(y,Z),Z=n.sub(Z,J),J=n.mul(y,R),te=n.mul(I,te),te=n.add(te,J),new p(Z,ie,te)}subtract(g){return this.add(g.negate())}is0(){return this.equals(p.ZERO)}wNAF(g){return m.wNAFCached(this,b,g,$=>{const B=n.invertBatch($.map(C=>C.pz));return $.map((C,F)=>C.toAffine(B[F])).map(p.fromAffine)})}multiplyUnsafe(g){const $=p.ZERO;if(g===_0n)return $;if(h(g),g===_1n$1)return this;const{endo:B}=e;if(!B)return m.unsafeLadder(this,g);let{k1neg:C,k1:F,k2neg:H,k2:W}=B.splitScalar(g),Z=$,ie=$,te=this;for(;F>_0n||W>_0n;)F&_1n$1&&(Z=Z.add(te)),W&_1n$1&&(ie=ie.add(te)),te=te.double(),F>>=_1n$1,W>>=_1n$1;return C&&(Z=Z.negate()),H&&(ie=ie.negate()),ie=new p(n.mul(ie.px,B.beta),ie.py,ie.pz),Z.add(ie)}multiply(g){h(g);let $=g,B,C;const{endo:F}=e;if(F){const{k1neg:H,k1:W,k2neg:Z,k2:ie}=F.splitScalar($);let{p:te,f:ae}=this.wNAF(W),{p:de,f:J}=this.wNAF(ie);te=m.constTimeNegate(H,te),de=m.constTimeNegate(Z,de),de=new p(n.mul(de.px,F.beta),de.py,de.pz),B=te.add(de),C=ae.add(J)}else{const{p:H,f:W}=this.wNAF($);B=H,C=W}return p.normalizeZ([B,C])[0]}multiplyAndAddUnsafe(g,$,B){const C=p.BASE,F=(W,Z)=>Z===_0n||Z===_1n$1||!W.equals(C)?W.multiplyUnsafe(Z):W.multiply(Z),H=F(this,$).add(F(g,B));return H.is0()?void 0:H}toAffine(g){const{px:$,py:B,pz:C}=this,F=this.is0();g==null&&(g=F?n.ONE:n.inv(C));const H=n.mul($,g),W=n.mul(B,g),Z=n.mul(C,g);if(F)return{x:n.ZERO,y:n.ZERO};if(!n.eql(Z,n.ONE))throw new Error("invZ was invalid");return{x:H,y:W}}isTorsionFree(){const{h:g,isTorsionFree:$}=e;if(g===_1n$1)return!0;if($)return $(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:g,clearCofactor:$}=e;return g===_1n$1?this:$?$(p,this):this.multiplyUnsafe(e.h)}toRawBytes(g=!0){return this.assertValidity(),a(p,this,g)}toHex(g=!0){return bytesToHex$2(this.toRawBytes(g))}}p.BASE=new p(e.Gx,e.Gy,n.ONE),p.ZERO=new p(n.ZERO,n.ONE,n.ZERO);const x=e.nBitLength,m=wNAF(p,e.endo?Math.ceil(x/2):x);return{CURVE:e,ProjectivePoint:p,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:u}}function validateOpts(t){const e=validateBasic(t);return validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function weierstrass(t){const e=validateOpts(t),{Fp:n,n:a}=e,c=n.BYTES+1,o=2*n.BYTES+1;function u(w){return _0n<w&&w<n.ORDER}function h(w){return mod(w,a)}function l(w){return invert(w,a)}const{ProjectivePoint:b,normPrivateKeyToScalar:d,weierstrassEquation:p,isWithinCurveOrder:x}=weierstrassPoints({...e,toBytes(w,I,M){const k=I.toAffine(),P=n.toBytes(k.x),_=concatBytes;return M?_(Uint8Array.from([I.hasEvenY()?2:3]),P):_(Uint8Array.from([4]),P,n.toBytes(k.y))},fromBytes(w){const I=w.length,M=w[0],k=w.subarray(1);if(I===c&&(M===2||M===3)){const P=bytesToNumberBE(k);if(!u(P))throw new Error("Point is not on curve");const _=p(P);let q=n.sqrt(_);const E=(q&_1n$1)===_1n$1;return(M&1)===1!==E&&(q=n.neg(q)),{x:P,y:q}}else if(I===o&&M===4){const P=n.fromBytes(k.subarray(0,n.BYTES)),_=n.fromBytes(k.subarray(n.BYTES,2*n.BYTES));return{x:P,y:_}}else throw new Error(`Point of length ${I} was invalid. Expected ${c} compressed bytes or ${o} uncompressed bytes`)}}),m=w=>bytesToHex$2(numberToBytesBE(w,e.nByteLength));function v(w){const I=a>>_1n$1;return w>I}function g(w){return v(w)?h(-w):w}const $=(w,I,M)=>bytesToNumberBE(w.slice(I,M));class B{constructor(I,M,k){this.r=I,this.s=M,this.recovery=k,this.assertValidity()}static fromCompact(I){const M=e.nByteLength;return I=ensureBytes("compactSignature",I,M*2),new B($(I,0,M),$(I,M,2*M))}static fromDER(I){const{r:M,s:k}=DER.toSig(ensureBytes("DER",I));return new B(M,k)}assertValidity(){if(!x(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!x(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(I){return new B(this.r,this.s,I)}recoverPublicKey(I){const{r:M,s:k,recovery:P}=this,_=ie(ensureBytes("msgHash",I));if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");const q=P===2||P===3?M+e.n:M;if(q>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const E=P&1?"03":"02",j=b.fromHex(E+m(q)),ee=l(q),oe=h(-_*ee),Y=h(k*ee),L=b.BASE.multiplyAndAddUnsafe(j,oe,Y);if(!L)throw new Error("point at infinify");return L.assertValidity(),L}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new B(this.r,h(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes$1(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes$1(this.toCompactHex())}toCompactHex(){return m(this.r)+m(this.s)}}const C={isValidPrivateKey(w){try{return d(w),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const w=getMinHashLength(e.n);return mapHashToField(e.randomBytes(w),e.n)},precompute(w=8,I=b.BASE){return I._setWindowSize(w),I.multiply(BigInt(3)),I}};function F(w,I=!0){return b.fromPrivateKey(w).toRawBytes(I)}function H(w){const I=w instanceof Uint8Array,M=typeof w=="string",k=(I||M)&&w.length;return I?k===c||k===o:M?k===2*c||k===2*o:w instanceof b}function W(w,I,M=!0){if(H(w))throw new Error("first arg must be private key");if(!H(I))throw new Error("second arg must be public key");return b.fromHex(I).multiply(d(w)).toRawBytes(M)}const Z=e.bits2int||function(w){const I=bytesToNumberBE(w),M=w.length*8-e.nBitLength;return M>0?I>>BigInt(M):I},ie=e.bits2int_modN||function(w){return h(Z(w))},te=bitMask(e.nBitLength);function ae(w){if(typeof w!="bigint")throw new Error("bigint expected");if(!(_0n<=w&&w<te))throw new Error(`bigint expected < 2^${e.nBitLength}`);return numberToBytesBE(w,e.nByteLength)}function de(w,I,M=J){if(["recovered","canonical"].some(re=>re in M))throw new Error("sign() legacy options not supported");const{hash:k,randomBytes:P}=e;let{lowS:_,prehash:q,extraEntropy:E}=M;_==null&&(_=!0),w=ensureBytes("msgHash",w),q&&(w=ensureBytes("prehashed msgHash",k(w)));const j=ie(w),ee=d(I),oe=[ae(ee),ae(j)];if(E!=null){const re=E===!0?P(n.BYTES):E;oe.push(ensureBytes("extraEntropy",re))}const Y=concatBytes(...oe),L=j;function z(re){const D=Z(re);if(!x(D))return;const G=l(D),U=b.BASE.multiply(D).toAffine(),Q=h(U.x);if(Q===_0n)return;const fe=h(G*h(L+Q*ee));if(fe===_0n)return;let he=(U.x===Q?0:2)|Number(U.y&_1n$1),le=fe;return _&&v(fe)&&(le=g(fe),he^=1),new B(Q,le,he)}return{seed:Y,k2sig:z}}const J={lowS:e.lowS,prehash:!1},R={lowS:e.lowS,prehash:!1};function A(w,I,M=J){const{seed:k,k2sig:P}=de(w,I,M),_=e;return createHmacDrbg(_.hash.outputLen,_.nByteLength,_.hmac)(k,P)}b.BASE._setWindowSize(8);function y(w,I,M,k=R){var U;const P=w;if(I=ensureBytes("msgHash",I),M=ensureBytes("publicKey",M),"strict"in k)throw new Error("options.strict was renamed to lowS");const{lowS:_,prehash:q}=k;let E,j;try{if(typeof P=="string"||P instanceof Uint8Array)try{E=B.fromDER(P)}catch(Q){if(!(Q instanceof DER.Err))throw Q;E=B.fromCompact(P)}else if(typeof P=="object"&&typeof P.r=="bigint"&&typeof P.s=="bigint"){const{r:Q,s:fe}=P;E=new B(Q,fe)}else throw new Error("PARSE");j=b.fromHex(M)}catch(Q){if(Q.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(_&&E.hasHighS())return!1;q&&(I=e.hash(I));const{r:ee,s:oe}=E,Y=ie(I),L=l(oe),z=h(Y*L),re=h(ee*L),D=(U=b.BASE.multiplyAndAddUnsafe(j,z,re))==null?void 0:U.toAffine();return D?h(D.x)===ee:!1}return{CURVE:e,getPublicKey:F,getSharedSecret:W,sign:A,verify:y,ProjectivePoint:b,Signature:B,utils:C}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(t){return{hash:t,hmac:(e,...n)=>hmac$1(t,e,concatBytes$1(...n)),randomBytes:randomBytes$2}}function createCurve(t,e){const n=a=>weierstrass({...t,...getHash(a)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n=BigInt(1),_2n=BigInt(2),divNearest=(t,e)=>(t+e/_2n)/e;function sqrtMod(t){const e=secp256k1P,n=BigInt(3),a=BigInt(6),c=BigInt(11),o=BigInt(22),u=BigInt(23),h=BigInt(44),l=BigInt(88),b=t*t*t%e,d=b*b*t%e,p=pow2(d,n,e)*d%e,x=pow2(p,n,e)*d%e,m=pow2(x,_2n,e)*b%e,v=pow2(m,c,e)*m%e,g=pow2(v,o,e)*v%e,$=pow2(g,h,e)*g%e,B=pow2($,l,e)*$%e,C=pow2(B,h,e)*g%e,F=pow2(C,n,e)*d%e,H=pow2(F,u,e)*v%e,W=pow2(H,a,e)*b%e,Z=pow2(W,_2n,e);if(!Fp.eql(Fp.sqr(Z),t))throw new Error("Cannot find square root");return Z}const Fp=Field(secp256k1P,void 0,void 0,{sqrt:sqrtMod}),secp256k1$1=createCurve({a:BigInt(0),b:BigInt(7),Fp,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=secp256k1N,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),a=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),c=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,u=BigInt("0x100000000000000000000000000000000"),h=divNearest(o*t,e),l=divNearest(-a*t,e);let b=mod(t-h*n-l*c,e),d=mod(-h*a-l*o,e);const p=b>u,x=d>u;if(p&&(b=e-b),x&&(d=e-d),b>u||d>u)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:p,k1:b,k2neg:x,k2:d}}}},sha256$3);BigInt(0),secp256k1$1.ProjectivePoint;const ZeroAddress="0x0000000000000000000000000000000000000000",ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000",MessagePrefix=`Ethereum Signed Message:
|
|
2
|
-
`,BN_0$3=BigInt(0),BN_1$1=BigInt(1),BN_2$1=BigInt(2),BN_27$1=BigInt(27),BN_28$1=BigInt(28),BN_35$1=BigInt(35),_guard$2={};function toUint256(t){return zeroPadValue(toBeArray(t),32)}let Signature$3=(ot=class{constructor(e,n,a,c){Le(this,Fe);Le(this,He);Le(this,at);Le(this,wt);assertPrivate(e,_guard$2,"Signature"),we(this,Fe,n),we(this,He,a),we(this,at,c),we(this,wt,null)}get r(){return Re(this,Fe)}set r(e){assertArgument(dataLength(e)===32,"invalid r","value",e),we(this,Fe,hexlify(e))}get s(){return Re(this,He)}set s(e){assertArgument(dataLength(e)===32,"invalid s","value",e);const n=hexlify(e);assertArgument(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),we(this,He,n)}get v(){return Re(this,at)}set v(e){const n=getNumber(e,"value");assertArgument(n===27||n===28,"invalid v","v",e),we(this,at,n)}get networkV(){return Re(this,wt)}get legacyChainId(){const e=this.networkV;return e==null?null:ot.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=getBytes(this.s);return this.yParity&&(e[0]|=128),hexlify(e)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new ot(_guard$2,this.r,this.s,this.v);return this.networkV&&we(e,wt,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=getBigInt(e,"v");return n==BN_27$1||n==BN_28$1?BN_0$3:(assertArgument(n>=BN_35$1,"invalid EIP-155 v","v",e),(n-BN_35$1)/BN_2$1)}static getChainIdV(e,n){return getBigInt(e)*BN_2$1+BigInt(35+n-27)}static getNormalizedV(e){const n=getBigInt(e);return n===BN_0$3||n===BN_27$1?27:n===BN_1$1||n===BN_28$1?28:(assertArgument(n>=BN_35$1,"invalid v","v",e),n&BN_1$1?27:28)}static from(e){function n(b,d){assertArgument(b,d,"signature",e)}if(e==null)return new ot(_guard$2,ZeroHash,ZeroHash,27);if(typeof e=="string"){const b=getBytes(e,"signature");if(b.length===64){const d=hexlify(b.slice(0,32)),p=b.slice(32,64),x=p[0]&128?28:27;return p[0]&=127,new ot(_guard$2,d,hexlify(p),x)}if(b.length===65){const d=hexlify(b.slice(0,32)),p=b.slice(32,64);n((p[0]&128)===0,"non-canonical s");const x=ot.getNormalizedV(b[64]);return new ot(_guard$2,d,hexlify(p),x)}n(!1,"invalid raw signature length")}if(e instanceof ot)return e.clone();const a=e.r;n(a!=null,"missing r");const c=toUint256(a),o=function(b,d){if(b!=null)return toUint256(b);if(d!=null){n(isHexString$1(d,32),"invalid yParityAndS");const p=getBytes(d);return p[0]&=127,hexlify(p)}n(!1,"missing s")}(e.s,e.yParityAndS);n((getBytes(o)[0]&128)==0,"non-canonical s");const{networkV:u,v:h}=function(b,d,p){if(b!=null){const x=getBigInt(b);return{networkV:x>=BN_35$1?x:void 0,v:ot.getNormalizedV(x)}}if(d!=null)return n(isHexString$1(d,32),"invalid yParityAndS"),{v:getBytes(d)[0]&128?28:27};if(p!=null){switch(getNumber(p,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new ot(_guard$2,c,o,h);return u&&we(l,wt,u),n(e.yParity==null||getNumber(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}},Fe=new WeakMap,He=new WeakMap,at=new WeakMap,wt=new WeakMap,ot);const Mt=class Mt{constructor(e){Le(this,St);assertArgument(dataLength(e)===32,"invalid private key","privateKey","[REDACTED]"),we(this,St,hexlify(e))}get privateKey(){return Re(this,St)}get publicKey(){return Mt.computePublicKey(Re(this,St))}get compressedPublicKey(){return Mt.computePublicKey(Re(this,St),!0)}sign(e){assertArgument(dataLength(e)===32,"invalid digest length","digest",e);const n=secp256k1$1.sign(getBytesCopy(e),getBytesCopy(Re(this,St)),{lowS:!0});return Signature$3.from({r:toBeHex(n.r,32),s:toBeHex(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=Mt.computePublicKey(e);return hexlify(secp256k1$1.getSharedSecret(getBytesCopy(Re(this,St)),getBytes(n),!1))}static computePublicKey(e,n){let a=getBytes(e,"key");if(a.length===32){const o=secp256k1$1.getPublicKey(a,!!n);return hexlify(o)}if(a.length===64){const o=new Uint8Array(65);o[0]=4,o.set(a,1),a=o}const c=secp256k1$1.ProjectivePoint.fromHex(a);return hexlify(c.toRawBytes(n))}static recoverPublicKey(e,n){assertArgument(dataLength(e)===32,"invalid digest length","digest",e);const a=Signature$3.from(n);let c=secp256k1$1.Signature.fromCompact(getBytesCopy(concat([a.r,a.s])));c=c.addRecoveryBit(a.yParity);const o=c.recoverPublicKey(getBytesCopy(e));return assertArgument(o!=null,"invalid signautre for digest","signature",n),"0x"+o.toHex(!1)}static addPoints(e,n,a){const c=secp256k1$1.ProjectivePoint.fromHex(Mt.computePublicKey(e).substring(2)),o=secp256k1$1.ProjectivePoint.fromHex(Mt.computePublicKey(n).substring(2));return"0x"+c.add(o).toHex(!!a)}};St=new WeakMap;let SigningKey=Mt;const BN_0$2=BigInt(0),BN_36=BigInt(36);function getChecksumAddress(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let c=0;c<40;c++)n[c]=e[c].charCodeAt(0);const a=getBytes(keccak256(n));for(let c=0;c<40;c+=2)a[c>>1]>>4>=8&&(e[c]=e[c].toUpperCase()),(a[c>>1]&15)>=8&&(e[c+1]=e[c+1].toUpperCase());return"0x"+e.join("")}const ibanLookup={};for(let t=0;t<10;t++)ibanLookup[String(t)]=String(t);for(let t=0;t<26;t++)ibanLookup[String.fromCharCode(65+t)]=String(10+t);const safeDigits=15;function ibanChecksum(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(a=>ibanLookup[a]).join("");for(;e.length>=safeDigits;){let a=e.substring(0,safeDigits);e=parseInt(a,10)%97+e.substring(a.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const Base36=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function fromBase36(t){t=t.toLowerCase();let e=BN_0$2;for(let n=0;n<t.length;n++)e=e*BN_36+Base36[t[n]];return e}function getAddress(t){if(assertArgument(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=getChecksumAddress(t);return assertArgument(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){assertArgument(t.substring(2,4)===ibanChecksum(t),"bad icap checksum","address",t);let e=fromBase36(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return getChecksumAddress("0x"+e)}assertArgument(!1,"invalid address","address",t)}function isAddressable(t){return t&&typeof t.getAddress=="function"}async function checkAddress(t,e){const n=await e;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(assert$f(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),assertArgument(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),getAddress(n)}function resolveAddress(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?getAddress(t):(assert$f(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),checkAddress(t,e.resolveName(t)));if(isAddressable(t))return checkAddress(t,t.getAddress());if(t&&typeof t.then=="function")return checkAddress(t,t);assertArgument(!1,"unsupported addressable value","target",t)}function id(t){return keccak256(toUtf8Bytes(t))}function accessSetify(t,e){return{address:getAddress(t),storageKeys:e.map((n,a)=>(assertArgument(isHexString$1(n,32),"invalid slot",`storageKeys[${a}]`,n),n.toLowerCase()))}}function accessListify(t){if(Array.isArray(t))return t.map((n,a)=>Array.isArray(n)?(assertArgument(n.length===2,"invalid slot set",`value[${a}]`,n),accessSetify(n[0],n[1])):(assertArgument(n!=null&&typeof n=="object","invalid address-slot set","value",t),accessSetify(n.address,n.storageKeys)));assertArgument(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const a=t[n].reduce((c,o)=>(c[o]=!0,c),{});return accessSetify(n,Object.keys(a).sort())});return e.sort((n,a)=>n.address.localeCompare(a.address)),e}function computeAddress(t){let e;return typeof t=="string"?e=SigningKey.computePublicKey(t,!1):e=t.publicKey,getAddress(keccak256("0x"+e.substring(4)).substring(26))}function recoverAddress(t,e){return computeAddress(SigningKey.recoverPublicKey(t,e))}const BN_0$1=BigInt(0),BN_2=BigInt(2),BN_27=BigInt(27),BN_28=BigInt(28),BN_35=BigInt(35),BN_MAX_UINT=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),BLOB_SIZE=4096*32;function getVersionedHash(t,e){let n=t.toString(16);for(;n.length<2;)n="0"+n;return n+=sha256$2(e).substring(4),"0x"+n}function handleAddress(t){return t==="0x"?null:getAddress(t)}function handleAccessList(t,e){try{return accessListify(t)}catch(n){assertArgument(!1,n.message,e,t)}}function handleNumber(t,e){return t==="0x"?0:getNumber(t,e)}function handleUint(t,e){if(t==="0x")return BN_0$1;const n=getBigInt(t,e);return assertArgument(n<=BN_MAX_UINT,"value exceeds uint size",e,n),n}function formatNumber(t,e){const n=getBigInt(t,"value"),a=toBeArray(n);return assertArgument(a.length<=32,"value too large",`tx.${e}`,n),a}function formatAccessList(t){return accessListify(t).map(e=>[e.address,e.storageKeys])}function formatHashes(t,e){assertArgument(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n<t.length;n++)assertArgument(isHexString$1(t[n],32),"invalid ${ param } hash",`value[${n}]`,t[n]);return t}function _parseLegacy(t){const e=decodeRlp(t);assertArgument(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:handleNumber(e[0],"nonce"),gasPrice:handleUint(e[1],"gasPrice"),gasLimit:handleUint(e[2],"gasLimit"),to:handleAddress(e[3]),value:handleUint(e[4],"value"),data:hexlify(e[5]),chainId:BN_0$1};if(e.length===6)return n;const a=handleUint(e[6],"v"),c=handleUint(e[7],"r"),o=handleUint(e[8],"s");if(c===BN_0$1&&o===BN_0$1)n.chainId=a;else{let u=(a-BN_35)/BN_2;u<BN_0$1&&(u=BN_0$1),n.chainId=u,assertArgument(u!==BN_0$1||a===BN_27||a===BN_28,"non-canonical legacy v","v",e[6]),n.signature=Signature$3.from({r:zeroPadValue(e[7],32),s:zeroPadValue(e[8],32),v:a})}return n}function _serializeLegacy(t,e){const n=[formatNumber(t.nonce,"nonce"),formatNumber(t.gasPrice||0,"gasPrice"),formatNumber(t.gasLimit,"gasLimit"),t.to||"0x",formatNumber(t.value,"value"),t.data];let a=BN_0$1;if(t.chainId!=BN_0$1)a=getBigInt(t.chainId,"tx.chainId"),assertArgument(!e||e.networkV==null||e.legacyChainId===a,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const o=t.signature.legacyChainId;o!=null&&(a=o)}if(!e)return a!==BN_0$1&&(n.push(toBeArray(a)),n.push("0x"),n.push("0x")),encodeRlp(n);let c=BigInt(27+e.yParity);return a!==BN_0$1?c=Signature$3.getChainIdV(a,e.v):BigInt(e.v)!==c&&assertArgument(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(toBeArray(c)),n.push(toBeArray(e.r)),n.push(toBeArray(e.s)),encodeRlp(n)}function _parseEipSignature(t,e){let n;try{if(n=handleNumber(e[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{assertArgument(!1,"invalid yParity","yParity",e[0])}const a=zeroPadValue(e[1],32),c=zeroPadValue(e[2],32),o=Signature$3.from({r:a,s:c,yParity:n});t.signature=o}function _parseEip1559(t){const e=decodeRlp(getBytes(t).slice(1));assertArgument(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",hexlify(t));const n={type:2,chainId:handleUint(e[0],"chainId"),nonce:handleNumber(e[1],"nonce"),maxPriorityFeePerGas:handleUint(e[2],"maxPriorityFeePerGas"),maxFeePerGas:handleUint(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:handleUint(e[4],"gasLimit"),to:handleAddress(e[5]),value:handleUint(e[6],"value"),data:hexlify(e[7]),accessList:handleAccessList(e[8],"accessList")};return e.length===9||_parseEipSignature(n,e.slice(9)),n}function _serializeEip1559(t,e){const n=[formatNumber(t.chainId,"chainId"),formatNumber(t.nonce,"nonce"),formatNumber(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(t.maxFeePerGas||0,"maxFeePerGas"),formatNumber(t.gasLimit,"gasLimit"),t.to||"0x",formatNumber(t.value,"value"),t.data,formatAccessList(t.accessList||[])];return e&&(n.push(formatNumber(e.yParity,"yParity")),n.push(toBeArray(e.r)),n.push(toBeArray(e.s))),concat(["0x02",encodeRlp(n)])}function _parseEip2930(t){const e=decodeRlp(getBytes(t).slice(1));assertArgument(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",hexlify(t));const n={type:1,chainId:handleUint(e[0],"chainId"),nonce:handleNumber(e[1],"nonce"),gasPrice:handleUint(e[2],"gasPrice"),gasLimit:handleUint(e[3],"gasLimit"),to:handleAddress(e[4]),value:handleUint(e[5],"value"),data:hexlify(e[6]),accessList:handleAccessList(e[7],"accessList")};return e.length===8||_parseEipSignature(n,e.slice(8)),n}function _serializeEip2930(t,e){const n=[formatNumber(t.chainId,"chainId"),formatNumber(t.nonce,"nonce"),formatNumber(t.gasPrice||0,"gasPrice"),formatNumber(t.gasLimit,"gasLimit"),t.to||"0x",formatNumber(t.value,"value"),t.data,formatAccessList(t.accessList||[])];return e&&(n.push(formatNumber(e.yParity,"recoveryParam")),n.push(toBeArray(e.r)),n.push(toBeArray(e.s))),concat(["0x01",encodeRlp(n)])}function _parseEip4844(t){let e=decodeRlp(getBytes(t).slice(1)),n="3",a=null;if(e.length===4&&Array.isArray(e[0])){n="3 (network format)";const o=e[1],u=e[2],h=e[3];assertArgument(Array.isArray(o),"invalid network format: blobs not an array","fields[1]",o),assertArgument(Array.isArray(u),"invalid network format: commitments not an array","fields[2]",u),assertArgument(Array.isArray(h),"invalid network format: proofs not an array","fields[3]",h),assertArgument(o.length===u.length,"invalid network format: blobs/commitments length mismatch","fields",e),assertArgument(o.length===h.length,"invalid network format: blobs/proofs length mismatch","fields",e),a=[];for(let l=0;l<e[1].length;l++)a.push({data:o[l],commitment:u[l],proof:h[l]});e=e[0]}assertArgument(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${n}`,"data",hexlify(t));const c={type:3,chainId:handleUint(e[0],"chainId"),nonce:handleNumber(e[1],"nonce"),maxPriorityFeePerGas:handleUint(e[2],"maxPriorityFeePerGas"),maxFeePerGas:handleUint(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:handleUint(e[4],"gasLimit"),to:handleAddress(e[5]),value:handleUint(e[6],"value"),data:hexlify(e[7]),accessList:handleAccessList(e[8],"accessList"),maxFeePerBlobGas:handleUint(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};a&&(c.blobs=a),assertArgument(c.to!=null,`invalid address for transaction type: ${n}`,"data",t),assertArgument(Array.isArray(c.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let o=0;o<c.blobVersionedHashes.length;o++)assertArgument(isHexString$1(c.blobVersionedHashes[o],32),`invalid blobVersionedHash at index ${o}: must be length 32`,"data",t);return e.length===11||_parseEipSignature(c,e.slice(11)),c}function _serializeEip4844(t,e,n){const a=[formatNumber(t.chainId,"chainId"),formatNumber(t.nonce,"nonce"),formatNumber(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(t.maxFeePerGas||0,"maxFeePerGas"),formatNumber(t.gasLimit,"gasLimit"),t.to||ZeroAddress,formatNumber(t.value,"value"),t.data,formatAccessList(t.accessList||[]),formatNumber(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),formatHashes(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(a.push(formatNumber(e.yParity,"yParity")),a.push(toBeArray(e.r)),a.push(toBeArray(e.s)),n)?concat(["0x03",encodeRlp([a,n.map(c=>c.data),n.map(c=>c.commitment),n.map(c=>c.proof)])]):concat(["0x03",encodeRlp(a)])}const At=class At{constructor(){Le(this,Yt);Le(this,_t);Le(this,Ut);Le(this,Ht);Le(this,jt);Le(this,Gt);Le(this,Kt);Le(this,zt);Le(this,Vt);Le(this,Wt);Le(this,Jt);Le(this,Zt);Le(this,Xt);Le(this,It);Le(this,Rt);Le(this,Et);Le(this,$t);we(this,_t,null),we(this,Ut,null),we(this,jt,0),we(this,Gt,BN_0$1),we(this,Kt,null),we(this,zt,null),we(this,Vt,null),we(this,Ht,"0x"),we(this,Wt,BN_0$1),we(this,Jt,BN_0$1),we(this,Zt,null),we(this,Xt,null),we(this,It,null),we(this,Rt,null),we(this,$t,null),we(this,Et,null)}get type(){return Re(this,_t)}set type(e){switch(e){case null:we(this,_t,null);break;case 0:case"legacy":we(this,_t,0);break;case 1:case"berlin":case"eip-2930":we(this,_t,1);break;case 2:case"london":case"eip-1559":we(this,_t,2);break;case 3:case"cancun":case"eip-4844":we(this,_t,3);break;default:assertArgument(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=Re(this,Ut);return e==null&&this.type===3?ZeroAddress:e}set to(e){we(this,Ut,e==null?null:getAddress(e))}get nonce(){return Re(this,jt)}set nonce(e){we(this,jt,getNumber(e,"value"))}get gasLimit(){return Re(this,Gt)}set gasLimit(e){we(this,Gt,getBigInt(e))}get gasPrice(){const e=Re(this,Kt);return e==null&&(this.type===0||this.type===1)?BN_0$1:e}set gasPrice(e){we(this,Kt,e==null?null:getBigInt(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=Re(this,zt);return e??(this.type===2||this.type===3?BN_0$1:null)}set maxPriorityFeePerGas(e){we(this,zt,e==null?null:getBigInt(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=Re(this,Vt);return e??(this.type===2||this.type===3?BN_0$1:null)}set maxFeePerGas(e){we(this,Vt,e==null?null:getBigInt(e,"maxFeePerGas"))}get data(){return Re(this,Ht)}set data(e){we(this,Ht,hexlify(e))}get value(){return Re(this,Wt)}set value(e){we(this,Wt,getBigInt(e,"value"))}get chainId(){return Re(this,Jt)}set chainId(e){we(this,Jt,getBigInt(e))}get signature(){return Re(this,Zt)||null}set signature(e){we(this,Zt,e==null?null:Signature$3.from(e))}get accessList(){const e=Re(this,Xt)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){we(this,Xt,e==null?null:accessListify(e))}get maxFeePerBlobGas(){const e=Re(this,It);return e==null&&this.type===3?BN_0$1:e}set maxFeePerBlobGas(e){we(this,It,e==null?null:getBigInt(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=Re(this,Rt);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){assertArgument(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let n=0;n<e.length;n++)assertArgument(isHexString$1(e[n],32),"invalid blobVersionedHash",`value[${n}]`,e[n])}we(this,Rt,e)}get blobs(){return Re(this,$t)==null?null:Re(this,$t).map(e=>Object.assign({},e))}set blobs(e){if(e==null){we(this,$t,null);return}const n=[],a=[];for(let c=0;c<e.length;c++){const o=e[c];if(isBytesLike(o)){assert$f(Re(this,Et),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let u=getBytes(o);if(assertArgument(u.length<=BLOB_SIZE,"blob is too large",`blobs[${c}]`,o),u.length!==BLOB_SIZE){const b=new Uint8Array(BLOB_SIZE);b.set(u),u=b}const h=Re(this,Et).blobToKzgCommitment(u),l=hexlify(Re(this,Et).computeBlobKzgProof(u,h));n.push({data:hexlify(u),commitment:hexlify(h),proof:l}),a.push(getVersionedHash(1,h))}else{const u=hexlify(o.commitment);n.push({data:hexlify(o.data),commitment:u,proof:hexlify(o.proof)}),a.push(getVersionedHash(1,u))}}we(this,$t,n),we(this,Rt,a)}get kzg(){return Re(this,Et)}set kzg(e){we(this,Et,e)}get hash(){return this.signature==null?null:keccak256(st(this,Yt,ur).call(this,!0,!1))}get unsignedHash(){return keccak256(this.unsignedSerialized)}get from(){return this.signature==null?null:recoverAddress(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return st(this,Yt,ur).call(this,!0,!0)}get unsignedSerialized(){return st(this,Yt,ur).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,a=this.accessList!=null,c=Re(this,It)!=null||Re(this,Rt);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&assert$f(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),assert$f(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),assert$f(this.type!==0||!a,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const o=[];return this.type!=null?o.push(this.type):n?o.push(2):e?(o.push(1),a||o.push(0)):a?(o.push(1),o.push(2)):(c&&this.to||(o.push(0),o.push(1),o.push(2)),o.push(3)),o.sort(),o}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return At.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new At;if(typeof e=="string"){const a=getBytes(e);if(a[0]>=127)return At.from(_parseLegacy(a));switch(a[0]){case 1:return At.from(_parseEip2930(a));case 2:return At.from(_parseEip1559(a));case 3:return At.from(_parseEip4844(a))}assert$f(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new At;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Signature$3.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(n.kzg=e.kzg),e.blobs!=null&&(n.blobs=e.blobs),e.hash!=null&&(assertArgument(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),assertArgument(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(assertArgument(n.isSigned(),"unsigned transaction cannot define '.from'","tx",e),assertArgument(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};_t=new WeakMap,Ut=new WeakMap,Ht=new WeakMap,jt=new WeakMap,Gt=new WeakMap,Kt=new WeakMap,zt=new WeakMap,Vt=new WeakMap,Wt=new WeakMap,Jt=new WeakMap,Zt=new WeakMap,Xt=new WeakMap,It=new WeakMap,Rt=new WeakMap,Et=new WeakMap,$t=new WeakMap,Yt=new WeakSet,ur=function(e,n){assert$f(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const a=e?this.signature:null;switch(this.inferType()){case 0:return _serializeLegacy(this,a);case 1:return _serializeEip2930(this,a);case 2:return _serializeEip1559(this,a);case 3:return _serializeEip4844(this,a,n?this.blobs:null)}assert$f(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let Transaction=At;function hashMessage(t){return typeof t=="string"&&(t=toUtf8Bytes(t)),keccak256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(t.length)),t]))}function verifyMessage(t,e){const n=hashMessage(t);return recoverAddress(n,e)}const padding=new Uint8Array(32);padding.fill(0);const BN__1=BigInt(-1),BN_0=BigInt(0),BN_1=BigInt(1),BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(t){const e=getBytes(t),n=e.length%32;return n?concat([e,padding.slice(n)]):hexlify(e)}const hexTrue=toBeHex(BN_1,32),hexFalse=toBeHex(BN_0,32),domainFieldTypes={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},domainFieldNames=["name","version","chainId","verifyingContract","salt"];function checkString(t){return function(e){return assertArgument(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const domainChecks={name:checkString("name"),version:checkString("version"),chainId:function(t){const e=getBigInt(t,"domain.chainId");return assertArgument(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):toQuantity(e)},verifyingContract:function(t){try{return getAddress(t).toLowerCase()}catch{}assertArgument(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=getBytes(t,"domain.salt");return assertArgument(e.length===32,'invalid domain value "salt"',"domain.salt",t),hexlify(e)}};function getBaseEncoder(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",a=parseInt(e[2]);assertArgument(a%8===0&&a!==0&&a<=256&&e[2]===String(a),"invalid numeric width","type",t);const c=mask(BN_MAX_UINT256,n?a-1:a),o=n?(c+BN_1)*BN__1:BN_0;return function(u){const h=getBigInt(u,"value");return assertArgument(h>=o&&h<=c,`value out-of-bounds for ${t}`,"value",h),toBeHex(n?toTwos(h,256):h,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return assertArgument(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(a){const c=getBytes(a);return assertArgument(c.length===n,`invalid length for ${t}`,"value",a),hexPadRight(a)}}}switch(t){case"address":return function(e){return zeroPadValue(getAddress(e),32)};case"bool":return function(e){return e?hexTrue:hexFalse};case"bytes":return function(e){return keccak256(e)};case"string":return function(e){return id(e)}}return null}function encodeType(t,e){return`${t}(${e.map(({name:n,type:a})=>a+" "+n).join(",")})`}function splitArray(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}const ft=class ft{constructor(e){Le(this,cr);Ue(this,"primaryType");Le(this,ir);Le(this,Bt);Le(this,Qt);we(this,Bt,new Map),we(this,Qt,new Map);const n=new Map,a=new Map,c=new Map,o={};Object.keys(e).forEach(l=>{o[l]=e[l].map(({name:b,type:d})=>{let{base:p,index:x}=splitArray(d);return p==="int"&&!e.int&&(p="int256"),p==="uint"&&!e.uint&&(p="uint256"),{name:b,type:p+(x||"")}}),n.set(l,new Set),a.set(l,[]),c.set(l,new Set)}),we(this,ir,JSON.stringify(o));for(const l in o){const b=new Set;for(const d of o[l]){assertArgument(!b.has(d.name),`duplicate variable name ${JSON.stringify(d.name)} in ${JSON.stringify(l)}`,"types",e),b.add(d.name);const p=splitArray(d.type).base;assertArgument(p!==l,`circular type reference to ${JSON.stringify(p)}`,"types",e),!getBaseEncoder(p)&&(assertArgument(a.has(p),`unknown type ${JSON.stringify(p)}`,"types",e),a.get(p).push(l),n.get(l).add(p))}}const u=Array.from(a.keys()).filter(l=>a.get(l).length===0);assertArgument(u.length!==0,"missing primary type","types",e),assertArgument(u.length===1,`ambiguous primary types or unused types: ${u.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),defineProperties(this,{primaryType:u[0]});function h(l,b){assertArgument(!b.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),b.add(l);for(const d of n.get(l))if(a.has(d)){h(d,b);for(const p of b)c.get(p).add(d)}b.delete(l)}h(this.primaryType,new Set);for(const[l,b]of c){const d=Array.from(b);d.sort(),Re(this,Bt).set(l,encodeType(l,o[l])+d.map(p=>encodeType(p,o[p])).join(""))}}get types(){return JSON.parse(Re(this,ir))}getEncoder(e){let n=Re(this,Qt).get(e);return n||(n=st(this,cr,_r).call(this,e),Re(this,Qt).set(e,n)),n}encodeType(e){const n=Re(this,Bt).get(e);return assertArgument(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return keccak256(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,a){if(getBaseEncoder(e))return a(e,n);const c=splitArray(e).array;if(c)return assertArgument(c.count===-1||c.count===n.length,`array length mismatch; expected length ${c.count}`,"value",n),n.map(u=>this._visit(c.prefix,u,a));const o=this.types[e];if(o)return o.reduce((u,{name:h,type:l})=>(u[h]=this._visit(l,n[h],a),u),{});assertArgument(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new ft(e)}static getPrimaryType(e){return ft.from(e).primaryType}static hashStruct(e,n,a){return ft.from(n).hashStruct(e,a)}static hashDomain(e){const n=[];for(const a in e){if(e[a]==null)continue;const c=domainFieldTypes[a];assertArgument(c,`invalid typed-data domain key: ${JSON.stringify(a)}`,"domain",e),n.push({name:a,type:c})}return n.sort((a,c)=>domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(c.name)),ft.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,a){return concat(["0x1901",ft.hashDomain(e),ft.from(n).hash(a)])}static hash(e,n,a){return keccak256(ft.encode(e,n,a))}static async resolveNames(e,n,a,c){e=Object.assign({},e);for(const h in e)e[h]==null&&delete e[h];const o={};e.verifyingContract&&!isHexString$1(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const u=ft.from(n);u.visit(a,(h,l)=>(h==="address"&&!isHexString$1(l,20)&&(o[l]="0x"),l));for(const h in o)o[h]=await c(h);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),a=u.visit(a,(h,l)=>h==="address"&&o[l]?o[l]:l),{domain:e,value:a}}static getPayload(e,n,a){ft.hashDomain(e);const c={},o=[];domainFieldNames.forEach(l=>{const b=e[l];b!=null&&(c[l]=domainChecks[l](b),o.push({name:l,type:domainFieldTypes[l]}))});const u=ft.from(n);n=u.types;const h=Object.assign({},n);return assertArgument(h.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),h.EIP712Domain=o,u.encode(a),{types:h,domain:c,primaryType:u.primaryType,message:u.visit(a,(l,b)=>{if(l.match(/^bytes(\d*)/))return hexlify(getBytes(b));if(l.match(/^u?int/))return getBigInt(b).toString();switch(l){case"address":return b.toLowerCase();case"bool":return!!b;case"string":return assertArgument(typeof b=="string","invalid string","value",b),b}assertArgument(!1,"unsupported type","type",l)})}}};ir=new WeakMap,Bt=new WeakMap,Qt=new WeakMap,cr=new WeakSet,_r=function(e){{const c=getBaseEncoder(e);if(c)return c}const n=splitArray(e).array;if(n){const c=n.prefix,o=this.getEncoder(c);return u=>{assertArgument(n.count===-1||n.count===u.length,`array length mismatch; expected length ${n.count}`,"value",u);let h=u.map(o);return Re(this,Bt).has(c)&&(h=h.map(keccak256)),keccak256(concat(h))}}const a=this.types[e];if(a){const c=id(Re(this,Bt).get(e));return o=>{const u=a.map(({name:h,type:l})=>{const b=this.getEncoder(l)(o[h]);return Re(this,Bt).has(l)?keccak256(b):b});return u.unshift(c),concat(u)}}assertArgument(!1,`unknown type: ${e}`,"type",e)};let TypedDataEncoder=ft;BigInt(0);function copyRequest(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=hexlify(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const c of n)!(c in t)||t[c]==null||(e[c]=getBigInt(t[c],`request.${c}`));const a="type,nonce".split(/,/);for(const c of a)!(c in t)||t[c]==null||(e[c]=getNumber(t[c],`request.${c}`));return t.accessList&&(e.accessList=accessListify(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(c=>isBytesLike(c)?hexlify(c):Object.assign({},c))),e}function checkProvider(t,e){if(t.provider)return t.provider;assert$f(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function populate(t,e){let n=copyRequest(e);if(n.to!=null&&(n.to=resolveAddress(n.to,t)),n.from!=null){const a=n.from;n.from=Promise.all([t.getAddress(),resolveAddress(a,t)]).then(([c,o])=>(assertArgument(c.toLowerCase()===o.toLowerCase(),"transaction from mismatch","tx.from",o),c))}else n.from=t.getAddress();return await resolveProperties(n)}class AbstractSigner{constructor(e){Ue(this,"provider");defineProperties(this,{provider:e||null})}async getNonce(e){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await populate(this,e)}async populateTransaction(e){const n=checkProvider(this,"populateTransaction"),a=await populate(this,e);a.nonce==null&&(a.nonce=await this.getNonce("pending")),a.gasLimit==null&&(a.gasLimit=await this.estimateGas(a));const c=await this.provider.getNetwork();if(a.chainId!=null){const u=getBigInt(a.chainId);assertArgument(u===c.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else a.chainId=c.chainId;const o=a.maxFeePerGas!=null||a.maxPriorityFeePerGas!=null;if(a.gasPrice!=null&&(a.type===2||o)?assertArgument(!1,"eip-1559 transaction do not support gasPrice","tx",e):(a.type===0||a.type===1)&&o&&assertArgument(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(a.type===2||a.type==null)&&a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)a.type=2;else if(a.type===0||a.type===1){const u=await n.getFeeData();assert$f(u.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),a.gasPrice==null&&(a.gasPrice=u.gasPrice)}else{const u=await n.getFeeData();if(a.type==null)if(u.maxFeePerGas!=null&&u.maxPriorityFeePerGas!=null)if(a.type=2,a.gasPrice!=null){const h=a.gasPrice;delete a.gasPrice,a.maxFeePerGas=h,a.maxPriorityFeePerGas=h}else a.maxFeePerGas==null&&(a.maxFeePerGas=u.maxFeePerGas),a.maxPriorityFeePerGas==null&&(a.maxPriorityFeePerGas=u.maxPriorityFeePerGas);else u.gasPrice!=null?(assert$f(!o,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),a.gasPrice==null&&(a.gasPrice=u.gasPrice),a.type=0):assert$f(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(a.type===2||a.type===3)&&(a.maxFeePerGas==null&&(a.maxFeePerGas=u.maxFeePerGas),a.maxPriorityFeePerGas==null&&(a.maxPriorityFeePerGas=u.maxPriorityFeePerGas))}return await resolveProperties(a)}async estimateGas(e){return checkProvider(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return checkProvider(this,"call").call(await this.populateCall(e))}async resolveName(e){return await checkProvider(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=checkProvider(this,"sendTransaction"),a=await this.populateTransaction(e);delete a.from;const c=Transaction.from(a);return await n.broadcastTransaction(await this.signTransaction(c))}}const hr=class hr extends AbstractSigner{constructor(n,a){super(a);Le(this,er);Ue(this,"address");defineProperties(this,{address:n})}async getAddress(){return this.address}connect(n){return new hr(this.address,n)}async signTransaction(n){st(this,er,dr).call(this,"transactions","signTransaction")}async signMessage(n){st(this,er,dr).call(this,"messages","signMessage")}async signTypedData(n,a,c){st(this,er,dr).call(this,"typed-data","signTypedData")}};er=new WeakSet,dr=function(n,a){assert$f(!1,`VoidSigner cannot sign ${n}`,"UNSUPPORTED_OPERATION",{operation:a})};let VoidSigner=hr;const lr=class lr extends AbstractSigner{constructor(n,a){super(a);Ue(this,"address");Le(this,tr);assertArgument(n&&typeof n.sign=="function","invalid private key","privateKey","[ REDACTED ]"),we(this,tr,n);const c=computeAddress(this.signingKey.publicKey);defineProperties(this,{address:c})}get signingKey(){return Re(this,tr)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(n){return new lr(Re(this,tr),n)}async signTransaction(n){n=copyRequest(n);const{to:a,from:c}=await resolveProperties({to:n.to?resolveAddress(n.to,this.provider):void 0,from:n.from?resolveAddress(n.from,this.provider):void 0});a!=null&&(n.to=a),c!=null&&(n.from=c),n.from!=null&&(assertArgument(getAddress(n.from)===this.address,"transaction from address mismatch","tx.from",n.from),delete n.from);const o=Transaction.from(n);return o.signature=this.signingKey.sign(o.unsignedHash),o.serialized}async signMessage(n){return this.signMessageSync(n)}signMessageSync(n){return this.signingKey.sign(hashMessage(n)).serialized}async signTypedData(n,a,c){const o=await TypedDataEncoder.resolveNames(n,a,c,async u=>{assert$f(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:u}});const h=await this.provider.resolveName(u);return assert$f(h!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:u}),h});return this.signingKey.sign(TypedDataEncoder.hash(o.domain,a,o.value)).serialized}};tr=new WeakMap;let BaseWallet=lr;const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~",Word=/^[a-z]*$/i;function unfold(t,e){let n=97;return t.reduce((a,c)=>(c===e?n++:c.match(Word)?a.push(String.fromCharCode(n)+c):(n=97,a.push(c)),a),[])}function decode(t,e){for(let c=subsChrs.length-1;c>=0;c--)t=t.split(subsChrs[c]).join(e.substring(2*c,2*c+2));const n=[],a=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(c,o,u,h)=>{if(u)for(let l=parseInt(u);l>=0;l--)n.push(";");else n.push(o.toLowerCase());return""});if(a)throw new Error(`leftovers: ${JSON.stringify(a)}`);return unfold(unfold(n,";"),":")}function decodeOwl(t){return assertArgument(t[0]==="0","unsupported auwl data","data",t),decode(t.substring(1+2*subsChrs.length),t.substring(1,1+2*subsChrs.length))}class Wordlist{constructor(e){Ue(this,"locale");defineProperties(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class WordlistOwl extends Wordlist{constructor(n,a,c){super(n);Le(this,ar);Le(this,rr);Le(this,nr);Le(this,Pt);we(this,rr,a),we(this,nr,c),we(this,Pt,null)}get _data(){return Re(this,rr)}_decodeWords(){return decodeOwl(Re(this,rr))}getWord(n){const a=st(this,ar,yr).call(this);return assertArgument(n>=0&&n<a.length,`invalid word index: ${n}`,"index",n),a[n]}getWordIndex(n){return st(this,ar,yr).call(this).indexOf(n)}}rr=new WeakMap,nr=new WeakMap,Pt=new WeakMap,ar=new WeakSet,yr=function(){if(Re(this,Pt)==null){const n=this._decodeWords();if(id(n.join(`
|
|
3
|
-
`)+`
|
|
4
|
-
`)!==Re(this,nr))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);we(this,Pt,n)}return Re(this,Pt)};const words="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",checksum="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let wordlist=null;class LangEn extends WordlistOwl{constructor(){super("en",words,checksum)}static wordlist(){return wordlist==null&&(wordlist=new LangEn),wordlist}}function getUpperMask(t){return(1<<t)-1<<8-t&255}function getLowerMask(t){return(1<<t)-1&255}function mnemonicToEntropy(t,e){assertNormalize("NFKD"),e==null&&(e=LangEn.wordlist());const n=e.split(t);assertArgument(n.length%3===0&&n.length>=12&&n.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const a=new Uint8Array(Math.ceil(11*n.length/8));let c=0;for(let b=0;b<n.length;b++){let d=e.getWordIndex(n[b].normalize("NFKD"));assertArgument(d>=0,`invalid mnemonic word at index ${b}`,"mnemonic","[ REDACTED ]");for(let p=0;p<11;p++)d&1<<10-p&&(a[c>>3]|=1<<7-c%8),c++}const o=32*n.length/3,u=n.length/3,h=getUpperMask(u),l=getBytes(sha256$2(a.slice(0,o/8)))[0]&h;return assertArgument(l===(a[a.length-1]&h),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),hexlify(a.slice(0,o/8))}function entropyToMnemonic(t,e){assertArgument(t.length%4===0&&t.length>=16&&t.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=LangEn.wordlist());const n=[0];let a=11;for(let u=0;u<t.length;u++)a>8?(n[n.length-1]<<=8,n[n.length-1]|=t[u],a-=8):(n[n.length-1]<<=a,n[n.length-1]|=t[u]>>8-a,n.push(t[u]&getLowerMask(8-a)),a+=3);const c=t.length/4,o=parseInt(sha256$2(t).substring(2,4),16)&getUpperMask(c);return n[n.length-1]<<=c,n[n.length-1]|=o>>8-c,e.join(n.map(u=>e.getWord(u)))}const _guard$1={};class Mnemonic{constructor(e,n,a,c,o){Ue(this,"phrase");Ue(this,"password");Ue(this,"wordlist");Ue(this,"entropy");c==null&&(c=""),o==null&&(o=LangEn.wordlist()),assertPrivate(e,_guard$1,"Mnemonic"),defineProperties(this,{phrase:a,password:c,wordlist:o,entropy:n})}computeSeed(){const e=toUtf8Bytes("mnemonic"+this.password,"NFKD");return pbkdf2(toUtf8Bytes(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,n,a){const c=mnemonicToEntropy(e,a);return e=entropyToMnemonic(getBytes(c),a),new Mnemonic(_guard$1,c,e,n,a)}static fromEntropy(e,n,a){const c=getBytes(e,"entropy"),o=entropyToMnemonic(c,a);return new Mnemonic(_guard$1,hexlify(c),o,n,a)}static entropyToPhrase(e,n){const a=getBytes(e,"entropy");return entropyToMnemonic(a,n)}static phraseToEntropy(e,n){return mnemonicToEntropy(e,n)}static isValidMnemonic(e,n){try{return mnemonicToEntropy(e,n),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */var __classPrivateFieldGet$2=function(t,e,n,a){if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?a:n==="a"?a.call(t):a?a.value:e.get(t)},__classPrivateFieldSet$2=function(t,e,n,a,c){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!c:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?c.call(t,n):c?c.value=n:e.set(t,n),n},_AES_key,_AES_Kd,_AES_Ke;const numberOfRounds={16:10,24:12,32:14},rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],S=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Si=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],T1=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],T2=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],T3=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],T4=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],T5=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],T6=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],T7=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],T8=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],U1=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],U2=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],U3=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],U4=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(t){const e=[];for(let n=0;n<t.length;n+=4)e.push(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]);return e}class AES{get key(){return __classPrivateFieldGet$2(this,_AES_key,"f").slice()}constructor(e){if(_AES_key.set(this,void 0),_AES_Kd.set(this,void 0),_AES_Ke.set(this,void 0),!(this instanceof AES))throw Error("AES must be instanitated with `new`");__classPrivateFieldSet$2(this,_AES_key,new Uint8Array(e),"f");const n=numberOfRounds[this.key.length];if(n==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");__classPrivateFieldSet$2(this,_AES_Ke,[],"f"),__classPrivateFieldSet$2(this,_AES_Kd,[],"f");for(let d=0;d<=n;d++)__classPrivateFieldGet$2(this,_AES_Ke,"f").push([0,0,0,0]),__classPrivateFieldGet$2(this,_AES_Kd,"f").push([0,0,0,0]);const a=(n+1)*4,c=this.key.length/4,o=convertToInt32(this.key);let u;for(let d=0;d<c;d++)u=d>>2,__classPrivateFieldGet$2(this,_AES_Ke,"f")[u][d%4]=o[d],__classPrivateFieldGet$2(this,_AES_Kd,"f")[n-u][d%4]=o[d];let h=0,l=c,b;for(;l<a;){if(b=o[c-1],o[0]^=S[b>>16&255]<<24^S[b>>8&255]<<16^S[b&255]<<8^S[b>>24&255]^rcon[h]<<24,h+=1,c!=8)for(let m=1;m<c;m++)o[m]^=o[m-1];else{for(let m=1;m<c/2;m++)o[m]^=o[m-1];b=o[c/2-1],o[c/2]^=S[b&255]^S[b>>8&255]<<8^S[b>>16&255]<<16^S[b>>24&255]<<24;for(let m=c/2+1;m<c;m++)o[m]^=o[m-1]}let d=0,p,x;for(;d<c&&l<a;)p=l>>2,x=l%4,__classPrivateFieldGet$2(this,_AES_Ke,"f")[p][x]=o[d],__classPrivateFieldGet$2(this,_AES_Kd,"f")[n-p][x]=o[d++],l++}for(let d=1;d<n;d++)for(let p=0;p<4;p++)b=__classPrivateFieldGet$2(this,_AES_Kd,"f")[d][p],__classPrivateFieldGet$2(this,_AES_Kd,"f")[d][p]=U1[b>>24&255]^U2[b>>16&255]^U3[b>>8&255]^U4[b&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const n=__classPrivateFieldGet$2(this,_AES_Ke,"f").length-1,a=[0,0,0,0];let c=convertToInt32(e);for(let h=0;h<4;h++)c[h]^=__classPrivateFieldGet$2(this,_AES_Ke,"f")[0][h];for(let h=1;h<n;h++){for(let l=0;l<4;l++)a[l]=T1[c[l]>>24&255]^T2[c[(l+1)%4]>>16&255]^T3[c[(l+2)%4]>>8&255]^T4[c[(l+3)%4]&255]^__classPrivateFieldGet$2(this,_AES_Ke,"f")[h][l];c=a.slice()}const o=new Uint8Array(16);let u=0;for(let h=0;h<4;h++)u=__classPrivateFieldGet$2(this,_AES_Ke,"f")[n][h],o[4*h]=(S[c[h]>>24&255]^u>>24)&255,o[4*h+1]=(S[c[(h+1)%4]>>16&255]^u>>16)&255,o[4*h+2]=(S[c[(h+2)%4]>>8&255]^u>>8)&255,o[4*h+3]=(S[c[(h+3)%4]&255]^u)&255;return o}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const n=__classPrivateFieldGet$2(this,_AES_Kd,"f").length-1,a=[0,0,0,0];let c=convertToInt32(e);for(let h=0;h<4;h++)c[h]^=__classPrivateFieldGet$2(this,_AES_Kd,"f")[0][h];for(let h=1;h<n;h++){for(let l=0;l<4;l++)a[l]=T5[c[l]>>24&255]^T6[c[(l+3)%4]>>16&255]^T7[c[(l+2)%4]>>8&255]^T8[c[(l+1)%4]&255]^__classPrivateFieldGet$2(this,_AES_Kd,"f")[h][l];c=a.slice()}const o=new Uint8Array(16);let u=0;for(let h=0;h<4;h++)u=__classPrivateFieldGet$2(this,_AES_Kd,"f")[n][h],o[4*h]=(Si[c[h]>>24&255]^u>>24)&255,o[4*h+1]=(Si[c[(h+3)%4]>>16&255]^u>>16)&255,o[4*h+2]=(Si[c[(h+2)%4]>>8&255]^u>>8)&255,o[4*h+3]=(Si[c[(h+1)%4]&255]^u)&255;return o}}_AES_key=new WeakMap,_AES_Kd=new WeakMap,_AES_Ke=new WeakMap;class ModeOfOperation{constructor(e,n,a){if(a&&!(this instanceof a))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new AES(n)},name:{enumerable:!0,value:e}})}}var __classPrivateFieldSet$1=function(t,e,n,a,c){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!c:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?c.call(t,n):c?c.value=n:e.set(t,n),n},__classPrivateFieldGet$1=function(t,e,n,a){if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?a:n==="a"?a.call(t):a?a.value:e.get(t)},_CBC_iv,_CBC_lastBlock;class CBC extends ModeOfOperation{constructor(e,n){if(super("ECC",e,CBC),_CBC_iv.set(this,void 0),_CBC_lastBlock.set(this,void 0),n){if(n.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");__classPrivateFieldSet$1(this,_CBC_iv,new Uint8Array(n),"f")}else __classPrivateFieldSet$1(this,_CBC_iv,new Uint8Array(16),"f");__classPrivateFieldSet$1(this,_CBC_lastBlock,this.iv,"f")}get iv(){return new Uint8Array(__classPrivateFieldGet$1(this,_CBC_iv,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const n=new Uint8Array(e.length);for(let a=0;a<e.length;a+=16){for(let c=0;c<16;c++)__classPrivateFieldGet$1(this,_CBC_lastBlock,"f")[c]^=e[a+c];__classPrivateFieldSet$1(this,_CBC_lastBlock,this.aes.encrypt(__classPrivateFieldGet$1(this,_CBC_lastBlock,"f")),"f"),n.set(__classPrivateFieldGet$1(this,_CBC_lastBlock,"f"),a)}return n}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const n=new Uint8Array(e.length);for(let a=0;a<e.length;a+=16){const c=this.aes.decrypt(e.subarray(a,a+16));for(let o=0;o<16;o++)n[a+o]=c[o]^__classPrivateFieldGet$1(this,_CBC_lastBlock,"f")[o],__classPrivateFieldGet$1(this,_CBC_lastBlock,"f")[o]=e[a+o]}return n}}_CBC_iv=new WeakMap,_CBC_lastBlock=new WeakMap;var __classPrivateFieldSet=function(t,e,n,a,c){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!c:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?c.call(t,n):c?c.value=n:e.set(t,n),n},__classPrivateFieldGet=function(t,e,n,a){if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?a:n==="a"?a.call(t):a?a.value:e.get(t)},_CTR_remaining,_CTR_remainingIndex,_CTR_counter;class CTR extends ModeOfOperation{constructor(e,n){super("CTR",e,CTR),_CTR_remaining.set(this,void 0),_CTR_remainingIndex.set(this,void 0),_CTR_counter.set(this,void 0),__classPrivateFieldSet(this,_CTR_counter,new Uint8Array(16),"f"),__classPrivateFieldGet(this,_CTR_counter,"f").fill(0),__classPrivateFieldSet(this,_CTR_remaining,__classPrivateFieldGet(this,_CTR_counter,"f"),"f"),__classPrivateFieldSet(this,_CTR_remainingIndex,16,"f"),n==null&&(n=1),typeof n=="number"?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(__classPrivateFieldGet(this,_CTR_counter,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let n=15;n>=0;--n)__classPrivateFieldGet(this,_CTR_counter,"f")[n]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");__classPrivateFieldGet(this,_CTR_counter,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(__classPrivateFieldGet(this,_CTR_counter,"f")[e]===255)__classPrivateFieldGet(this,_CTR_counter,"f")[e]=0;else{__classPrivateFieldGet(this,_CTR_counter,"f")[e]++;break}}encrypt(e){var n,a;const c=new Uint8Array(e);for(let o=0;o<c.length;o++)__classPrivateFieldGet(this,_CTR_remainingIndex,"f")===16&&(__classPrivateFieldSet(this,_CTR_remaining,this.aes.encrypt(__classPrivateFieldGet(this,_CTR_counter,"f")),"f"),__classPrivateFieldSet(this,_CTR_remainingIndex,0,"f"),this.increment()),c[o]^=__classPrivateFieldGet(this,_CTR_remaining,"f")[__classPrivateFieldSet(this,_CTR_remainingIndex,(a=__classPrivateFieldGet(this,_CTR_remainingIndex,"f"),n=a++,a),"f"),n];return c}decrypt(e){return this.encrypt(e)}}_CTR_remaining=new WeakMap,_CTR_remainingIndex=new WeakMap,_CTR_counter=new WeakMap;function pkcs7Strip(t){if(t.length<16)throw new TypeError("PKCS#7 invalid length");const e=t[t.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");const n=t.length-e;for(let a=0;a<e;a++)if(t[n+a]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(t.subarray(0,n))}function looseArrayify(t){return typeof t=="string"&&!t.startsWith("0x")&&(t="0x"+t),getBytesCopy(t)}function zpad$1(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function getPassword(t){return typeof t=="string"?toUtf8Bytes(t,"NFKC"):getBytesCopy(t)}function spelunk(t,e){const n=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);assertArgument(n!=null,"invalid path","path",e);const a=n[1],c=n[3],o=n[4]==="!";let u=t;for(const h of a.toLowerCase().split(".")){if(Array.isArray(u)){if(!h.match(/^[0-9]+$/))break;u=u[parseInt(h)]}else if(typeof u=="object"){let l=null;for(const b in u)if(b.toLowerCase()===h){l=u[b];break}u=l}else u=null;if(u==null)break}if(assertArgument(!o||u!=null,"missing required value","path",a),c&&u!=null){if(c==="int"){if(typeof u=="string"&&u.match(/^-?[0-9]+$/))return parseInt(u);if(Number.isSafeInteger(u))return u}if(c==="number"&&typeof u=="string"&&u.match(/^-?[0-9.]*$/))return parseFloat(u);if(c==="data"&&typeof u=="string")return looseArrayify(u);if(c==="array"&&Array.isArray(u)||c===typeof u)return u;assertArgument(!1,`wrong type found for ${c} `,"path",a)}return u}const defaultPath$1="m/44'/60'/0'/0/0";function isKeystoreJson(t){try{const e=JSON.parse(t);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}function decrypt(t,e,n){if(spelunk(t,"crypto.cipher:string")==="aes-128-ctr"){const c=spelunk(t,"crypto.cipherparams.iv:data!"),o=new CTR(e,c);return hexlify(o.decrypt(n))}assert$f(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function getAccount(t,e){const n=getBytes(e),a=spelunk(t,"crypto.ciphertext:data!"),c=hexlify(keccak256(concat([n.slice(16,32),a]))).substring(2);assertArgument(c===spelunk(t,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const o=decrypt(t,n.slice(0,16),a),u=computeAddress(o);if(t.address){let b=t.address.toLowerCase();b.startsWith("0x")||(b="0x"+b),assertArgument(getAddress(b)===u,"keystore address/privateKey mismatch","address",t.address)}const h={address:u,privateKey:o};if(spelunk(t,"x-ethers.version:string")==="0.1"){const b=n.slice(32,64),d=spelunk(t,"x-ethers.mnemonicCiphertext:data!"),p=spelunk(t,"x-ethers.mnemonicCounter:data!"),x=new CTR(b,p);h.mnemonic={path:spelunk(t,"x-ethers.path:string")||defaultPath$1,locale:spelunk(t,"x-ethers.locale:string")||"en",entropy:hexlify(getBytes(x.decrypt(d)))}}return h}function getDecryptKdfParams(t){const e=spelunk(t,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){const n=spelunk(t,"crypto.kdfparams.salt:data!"),a=spelunk(t,"crypto.kdfparams.n:int!"),c=spelunk(t,"crypto.kdfparams.r:int!"),o=spelunk(t,"crypto.kdfparams.p:int!");assertArgument(a>0&&(a&a-1)===0,"invalid kdf.N","kdf.N",a),assertArgument(c>0&&o>0,"invalid kdf","kdf",e);const u=spelunk(t,"crypto.kdfparams.dklen:int!");return assertArgument(u===32,"invalid kdf.dklen","kdf.dflen",u),{name:"scrypt",salt:n,N:a,r:c,p:o,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const n=spelunk(t,"crypto.kdfparams.salt:data!"),a=spelunk(t,"crypto.kdfparams.prf:string!"),c=a.split("-").pop();assertArgument(c==="sha256"||c==="sha512","invalid kdf.pdf","kdf.pdf",a);const o=spelunk(t,"crypto.kdfparams.c:int!"),u=spelunk(t,"crypto.kdfparams.dklen:int!");return assertArgument(u===32,"invalid kdf.dklen","kdf.dklen",u),{name:"pbkdf2",salt:n,count:o,dkLen:u,algorithm:c}}}assertArgument(!1,"unsupported key-derivation function","kdf",e)}function decryptKeystoreJsonSync(t,e){const n=JSON.parse(t),a=getPassword(e),c=getDecryptKdfParams(n);if(c.name==="pbkdf2"){const{salt:p,count:x,dkLen:m,algorithm:v}=c,g=pbkdf2(a,p,x,m,v);return getAccount(n,g)}assert$f(c.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:c});const{salt:o,N:u,r:h,p:l,dkLen:b}=c,d=scryptSync(a,o,u,h,l,b);return getAccount(n,d)}function stall$1(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function decryptKeystoreJson(t,e,n){const a=JSON.parse(t),c=getPassword(e),o=getDecryptKdfParams(a);if(o.name==="pbkdf2"){n&&(n(0),await stall$1(0));const{salt:x,count:m,dkLen:v,algorithm:g}=o,$=pbkdf2(c,x,m,v,g);return n&&(n(1),await stall$1(0)),getAccount(a,$)}assert$f(o.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:o});const{salt:u,N:h,r:l,p:b,dkLen:d}=o,p=await scrypt(c,u,h,l,b,d,n);return getAccount(a,p)}function getEncryptKdfParams(t){const e=t.salt!=null?getBytes(t.salt,"options.salt"):randomBytes(32);let n=1<<17,a=8,c=1;return t.scrypt&&(t.scrypt.N&&(n=t.scrypt.N),t.scrypt.r&&(a=t.scrypt.r),t.scrypt.p&&(c=t.scrypt.p)),assertArgument(typeof n=="number"&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),"invalid scrypt N parameter","options.N",n),assertArgument(typeof a=="number"&&a>0&&Number.isSafeInteger(a),"invalid scrypt r parameter","options.r",a),assertArgument(typeof c=="number"&&c>0&&Number.isSafeInteger(c),"invalid scrypt p parameter","options.p",c),{name:"scrypt",dkLen:32,salt:e,N:n,r:a,p:c}}function _encryptKeystore(t,e,n,a){const c=getBytes(n.privateKey,"privateKey"),o=a.iv!=null?getBytes(a.iv,"options.iv"):randomBytes(16);assertArgument(o.length===16,"invalid options.iv length","options.iv",a.iv);const u=a.uuid!=null?getBytes(a.uuid,"options.uuid"):randomBytes(16);assertArgument(u.length===16,"invalid options.uuid length","options.uuid",a.iv);const h=t.slice(0,16),l=t.slice(16,32),b=new CTR(h,o),d=getBytes(b.encrypt(c)),p=keccak256(concat([l,d])),x={address:n.address.substring(2).toLowerCase(),id:uuidV4(u),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(o).substring(2)},ciphertext:hexlify(d).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:p.substring(2)}};if(n.mnemonic){const m=a.client!=null?a.client:`ethers/${version$1}`,v=n.mnemonic.path||defaultPath$1,g=n.mnemonic.locale||"en",$=t.slice(32,64),B=getBytes(n.mnemonic.entropy,"account.mnemonic.entropy"),C=randomBytes(16),F=new CTR($,C),H=getBytes(F.encrypt(B)),W=new Date,ie="UTC--"+(W.getUTCFullYear()+"-"+zpad$1(W.getUTCMonth()+1,2)+"-"+zpad$1(W.getUTCDate(),2)+"T"+zpad$1(W.getUTCHours(),2)+"-"+zpad$1(W.getUTCMinutes(),2)+"-"+zpad$1(W.getUTCSeconds(),2)+".0Z")+"--"+x.address;x["x-ethers"]={client:m,gethFilename:ie,path:v,locale:g,mnemonicCounter:hexlify(C).substring(2),mnemonicCiphertext:hexlify(H).substring(2),version:"0.1"}}return JSON.stringify(x)}function encryptKeystoreJsonSync(t,e,n){n==null&&(n={});const a=getPassword(e),c=getEncryptKdfParams(n),o=scryptSync(a,c.salt,c.N,c.r,c.p,64);return _encryptKeystore(getBytes(o),c,t,n)}async function encryptKeystoreJson(t,e,n){n==null&&(n={});const a=getPassword(e),c=getEncryptKdfParams(n),o=await scrypt(a,c.salt,c.N,c.r,c.p,64,n.progressCallback);return _encryptKeystore(getBytes(o),c,t,n)}const defaultPath="m/44'/60'/0'/0/0",MasterSecret=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),HardenedBit=2147483648,N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Nibbles="0123456789abcdef";function zpad(t,e){let n="";for(;t;)n=Nibbles[t%16]+n,t=Math.trunc(t/16);for(;n.length<e*2;)n="0"+n;return"0x"+n}function encodeBase58Check(t){const e=getBytes(t),n=dataSlice(sha256$2(sha256$2(e)),0,4),a=concat([e,n]);return encodeBase58(a)}const _guard={};function ser_I(t,e,n,a){const c=new Uint8Array(37);t&HardenedBit?(assert$f(a!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),c.set(getBytes(a),1)):c.set(getBytes(n));for(let u=24;u>=0;u-=8)c[33+(u>>3)]=t>>24-u&255;const o=getBytes(computeHmac("sha512",e,c));return{IL:o.slice(0,32),IR:o.slice(32)}}function derivePath(t,e){const n=e.split("/");assertArgument(n.length>0,"invalid path","path",e),n[0]==="m"&&(assertArgument(t.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${t.depth}`,"path",e),n.shift());let a=t;for(let c=0;c<n.length;c++){const o=n[c];if(o.match(/^[0-9]+'$/)){const u=parseInt(o.substring(0,o.length-1));assertArgument(u<HardenedBit,"invalid path index",`path[${c}]`,o),a=a.deriveChild(HardenedBit+u)}else if(o.match(/^[0-9]+$/)){const u=parseInt(o);assertArgument(u<HardenedBit,"invalid path index",`path[${c}]`,o),a=a.deriveChild(u)}else assertArgument(!1,"invalid path component",`path[${c}]`,o)}return a}const gt=class gt extends BaseWallet{constructor(n,a,c,o,u,h,l,b,d){super(a,d);Le(this,sr);Ue(this,"publicKey");Ue(this,"fingerprint");Ue(this,"parentFingerprint");Ue(this,"mnemonic");Ue(this,"chainCode");Ue(this,"path");Ue(this,"index");Ue(this,"depth");assertPrivate(n,_guard,"HDNodeWallet"),defineProperties(this,{publicKey:a.compressedPublicKey});const p=dataSlice(ripemd160$1(sha256$2(this.publicKey)),0,4);defineProperties(this,{parentFingerprint:c,fingerprint:p,chainCode:o,path:u,index:h,depth:l}),defineProperties(this,{mnemonic:b})}connect(n){return new gt(_guard,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,n)}async encrypt(n,a){return await encryptKeystoreJson(st(this,sr,vr).call(this),n,{progressCallback:a})}encryptSync(n){return encryptKeystoreJsonSync(st(this,sr,vr).call(this),n)}get extendedKey(){return assert$f(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),encodeBase58Check(concat(["0x0488ADE4",zpad(this.depth,1),this.parentFingerprint,zpad(this.index,4),this.chainCode,concat(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new HDNodeVoidWallet(_guard,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(n){const a=getNumber(n,"index");assertArgument(a<=4294967295,"invalid index","index",a);let c=this.path;c&&(c+="/"+(a&~HardenedBit),a&HardenedBit&&(c+="'"));const{IR:o,IL:u}=ser_I(a,this.chainCode,this.publicKey,this.privateKey),h=new SigningKey(toBeHex((toBigInt(u)+BigInt(this.privateKey))%N,32));return new gt(_guard,h,this.fingerprint,hexlify(o),c,a,this.depth+1,this.mnemonic,this.provider)}derivePath(n){return derivePath(this,n)}static fromExtendedKey(n){const a=toBeArray(decodeBase58(n));assertArgument(a.length===82||encodeBase58Check(a.slice(0,78))===n,"invalid extended key","extendedKey","[ REDACTED ]");const c=a[4],o=hexlify(a.slice(5,9)),u=parseInt(hexlify(a.slice(9,13)).substring(2),16),h=hexlify(a.slice(13,45)),l=a.slice(45,78);switch(hexlify(a.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const b=hexlify(l);return new HDNodeVoidWallet(_guard,computeAddress(b),b,o,h,null,u,c,null)}case"0x0488ade4":case"0x04358394 ":if(l[0]!==0)break;return new gt(_guard,new SigningKey(l.slice(1)),o,h,null,u,c,null,null)}assertArgument(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(n,a,c){var u;n==null&&(n=""),a==null&&(a=defaultPath),c==null&&(c=LangEn.wordlist());const o=Mnemonic.fromEntropy(randomBytes(16),n,c);return st(u=gt,Tt,fr).call(u,o.computeSeed(),o).derivePath(a)}static fromMnemonic(n,a){var c;return a||(a=defaultPath),st(c=gt,Tt,fr).call(c,n.computeSeed(),n).derivePath(a)}static fromPhrase(n,a,c,o){var h;a==null&&(a=""),c==null&&(c=defaultPath),o==null&&(o=LangEn.wordlist());const u=Mnemonic.fromPhrase(n,a,o);return st(h=gt,Tt,fr).call(h,u.computeSeed(),u).derivePath(c)}static fromSeed(n){var a;return st(a=gt,Tt,fr).call(a,n,null)}};sr=new WeakSet,vr=function(){const n={address:this.address,privateKey:this.privateKey},a=this.mnemonic;return this.path&&a&&a.wordlist.locale==="en"&&a.password===""&&(n.mnemonic={path:this.path,locale:"en",entropy:a.entropy}),n},Tt=new WeakSet,fr=function(n,a){assertArgument(isBytesLike(n),"invalid seed","seed","[REDACTED]");const c=getBytes(n,"seed");assertArgument(c.length>=16&&c.length<=64,"invalid seed","seed","[REDACTED]");const o=getBytes(computeHmac("sha512",MasterSecret,c)),u=new SigningKey(hexlify(o.slice(0,32)));return new gt(_guard,u,"0x00000000",hexlify(o.slice(32)),"m",0,0,a,null)},Le(gt,Tt);let HDNodeWallet=gt;class HDNodeVoidWallet extends VoidSigner{constructor(n,a,c,o,u,h,l,b,d){super(a,d);Ue(this,"publicKey");Ue(this,"fingerprint");Ue(this,"parentFingerprint");Ue(this,"chainCode");Ue(this,"path");Ue(this,"index");Ue(this,"depth");assertPrivate(n,_guard,"HDNodeVoidWallet"),defineProperties(this,{publicKey:c});const p=dataSlice(ripemd160$1(sha256$2(c)),0,4);defineProperties(this,{publicKey:c,fingerprint:p,parentFingerprint:o,chainCode:u,path:h,index:l,depth:b})}connect(n){return new HDNodeVoidWallet(_guard,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,n)}get extendedKey(){return assert$f(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),encodeBase58Check(concat(["0x0488B21E",zpad(this.depth,1),this.parentFingerprint,zpad(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(n){const a=getNumber(n,"index");assertArgument(a<=4294967295,"invalid index","index",a);let c=this.path;c&&(c+="/"+(a&~HardenedBit),a&HardenedBit&&(c+="'"));const{IR:o,IL:u}=ser_I(a,this.chainCode,this.publicKey,null),h=SigningKey.addPoints(u,this.publicKey,!0),l=computeAddress(h);return new HDNodeVoidWallet(_guard,l,h,this.fingerprint,hexlify(o),c,a,this.depth+1,this.provider)}derivePath(n){return derivePath(this,n)}}function isCrowdsaleJson(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function decryptCrowdsaleJson(t,e){const n=JSON.parse(t),a=getPassword(e),c=getAddress(spelunk(n,"ethaddr:string!")),o=looseArrayify(spelunk(n,"encseed:string!"));assertArgument(o&&o.length%16===0,"invalid encseed","json",t);const u=getBytes(pbkdf2(a,a,2e3,32,"sha256")).slice(0,16),h=o.slice(0,16),l=o.slice(16),b=new CBC(u,h),d=pkcs7Strip(getBytes(b.decrypt(l)));let p="";for(let x=0;x<d.length;x++)p+=String.fromCharCode(d[x]);return{address:c,privateKey:id(p)}}function stall(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}const kt=class kt extends BaseWallet{constructor(e,n){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let a=typeof e=="string"?new SigningKey(e):e;super(a,n)}connect(e){return new kt(this.signingKey,e)}async encrypt(e,n){const a={address:this.address,privateKey:this.privateKey};return await encryptKeystoreJson(a,e,{progressCallback:n})}encryptSync(e){const n={address:this.address,privateKey:this.privateKey};return encryptKeystoreJsonSync(n,e)}static async fromEncryptedJson(e,n,a){var o;let c=null;return isKeystoreJson(e)?c=await decryptKeystoreJson(e,n,a):isCrowdsaleJson(e)&&(a&&(a(0),await stall(0)),c=decryptCrowdsaleJson(e,n),a&&(a(1),await stall(0))),st(o=kt,or,gr).call(o,c)}static fromEncryptedJsonSync(e,n){var c;let a=null;return isKeystoreJson(e)?a=decryptKeystoreJsonSync(e,n):isCrowdsaleJson(e)?a=decryptCrowdsaleJson(e,n):assertArgument(!1,"invalid JSON wallet","json","[ REDACTED ]"),st(c=kt,or,gr).call(c,a)}static createRandom(e){const n=HDNodeWallet.createRandom();return e?n.connect(e):n}static fromPhrase(e,n){const a=HDNodeWallet.fromPhrase(e);return n?a.connect(n):a}};or=new WeakSet,gr=function(e){if(assertArgument(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const a=Mnemonic.fromEntropy(e.mnemonic.entropy),c=HDNodeWallet.fromMnemonic(a,e.mnemonic.path);if(c.address===e.address&&c.privateKey===e.privateKey)return c;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const n=new kt(e.privateKey);return assertArgument(n.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),n},Le(kt,or);let Wallet=kt;const byteToHex=[];for(let t=0;t<256;++t)byteToHex.push((t+256).toString(16).slice(1));function unsafeStringify(t,e=0){return(byteToHex[t[e+0]]+byteToHex[t[e+1]]+byteToHex[t[e+2]]+byteToHex[t[e+3]]+"-"+byteToHex[t[e+4]]+byteToHex[t[e+5]]+"-"+byteToHex[t[e+6]]+byteToHex[t[e+7]]+"-"+byteToHex[t[e+8]]+byteToHex[t[e+9]]+"-"+byteToHex[t[e+10]]+byteToHex[t[e+11]]+byteToHex[t[e+12]]+byteToHex[t[e+13]]+byteToHex[t[e+14]]+byteToHex[t[e+15]]).toLowerCase()}let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function v4(t,e,n){if(native.randomUUID&&!e&&!t)return native.randomUUID();t=t||{};const a=t.random||(t.rng||rng)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,unsafeStringify(a)}function sleep(t){return new Promise(e=>{setTimeout(e,t)})}class EventEmitter{constructor(){this.events={},this.on=this.on.bind(this),this.off=this.off.bind(this),this.cleanAll=this.cleanAll.bind(this),this.emit=this.emit.bind(this)}on(e,n){this.events[e]||(this.events[e]=[]),this.events[e].push(n)}off(e,n){if(!this.events[e])return;const a=this.events[e].indexOf(n);a>-1&&this.events[e].splice(a,1)}cleanAll(){this.events={}}emit(e,n){this.events[e]&&this.events[e].forEach(a=>a(n))}}class Queue{constructor(e={},n){this.tasks=[],this.isProcessing=!1,this.isWaiting=!1,this.clearWaitTime=e.clearWaitTime||500,this.handleError=n}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.tasks.length>0;){const e=this.tasks.shift();if(e)try{const n=e();n instanceof Promise&&await n}catch(n){this.handleError({error:n,context:"Error processing task",throw:!1})}}this.isProcessing=!1}}enqueue(e){this.tasks.push(e),this.processQueue()}async clearQueue(){for(this.tasks=[];this.isProcessing;)await sleep(this.clearWaitTime)}async waitForProcessing(){if(this.isWaiting)return!0;for(this.isWaiting=!0;this.isProcessing;)await sleep(this.clearWaitTime);return this.isWaiting=!1,!1}}const CONSENSUS_ID="SwarmStream",EVENTS={LOADING_INIT_USERS:"loadingInitUsers",MESSAGE_RECEIVED:"messageReceived",MESSAGE_REQUEST_SENT:"messageRequestSent",MESSAGE_REQUEST_ERROR:"messageRequestError",ERROR:"errorEvent"},SECOND=1e3,HEX_RADIX=16;var BeeType=(t=>(t.READER="reader",t.WRITER="writer",t.GSOC="gsoc",t))(BeeType||{}),buffer$1={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62,revLookup[95]=63;function getLens(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var a=n===e?0:4-n%4;return[n,a]}function byteLength(t){var e=getLens(t),n=e[0],a=e[1];return(n+a)*3/4-a}function _byteLength(t,e,n){return(e+n)*3/4-n}function toByteArray(t){var e,n=getLens(t),a=n[0],c=n[1],o=new Arr(_byteLength(t,a,c)),u=0,h=c>0?a-4:a,l;for(l=0;l<h;l+=4)e=revLookup[t.charCodeAt(l)]<<18|revLookup[t.charCodeAt(l+1)]<<12|revLookup[t.charCodeAt(l+2)]<<6|revLookup[t.charCodeAt(l+3)],o[u++]=e>>16&255,o[u++]=e>>8&255,o[u++]=e&255;return c===2&&(e=revLookup[t.charCodeAt(l)]<<2|revLookup[t.charCodeAt(l+1)]>>4,o[u++]=e&255),c===1&&(e=revLookup[t.charCodeAt(l)]<<10|revLookup[t.charCodeAt(l+1)]<<4|revLookup[t.charCodeAt(l+2)]>>2,o[u++]=e>>8&255,o[u++]=e&255),o}function tripletToBase64(t){return lookup[t>>18&63]+lookup[t>>12&63]+lookup[t>>6&63]+lookup[t&63]}function encodeChunk(t,e,n){for(var a,c=[],o=e;o<n;o+=3)a=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),c.push(tripletToBase64(a));return c.join("")}function fromByteArray(t){for(var e,n=t.length,a=n%3,c=[],o=16383,u=0,h=n-a;u<h;u+=o)c.push(encodeChunk(t,u,u+o>h?h:u+o));return a===1?(e=t[n-1],c.push(lookup[e>>2]+lookup[e<<4&63]+"==")):a===2&&(e=(t[n-2]<<8)+t[n-1],c.push(lookup[e>>10]+lookup[e>>4&63]+lookup[e<<2&63]+"=")),c.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(t,e,n,a,c){var o,u,h=c*8-a-1,l=(1<<h)-1,b=l>>1,d=-7,p=n?c-1:0,x=n?-1:1,m=t[e+p];for(p+=x,o=m&(1<<-d)-1,m>>=-d,d+=h;d>0;o=o*256+t[e+p],p+=x,d-=8);for(u=o&(1<<-d)-1,o>>=-d,d+=a;d>0;u=u*256+t[e+p],p+=x,d-=8);if(o===0)o=1-b;else{if(o===l)return u?NaN:(m?-1:1)*(1/0);u=u+Math.pow(2,a),o=o-b}return(m?-1:1)*u*Math.pow(2,o-a)},ieee754.write=function(t,e,n,a,c,o){var u,h,l,b=o*8-c-1,d=(1<<b)-1,p=d>>1,x=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:o-1,v=a?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(h=isNaN(e)?1:0,u=d):(u=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-u))<1&&(u--,l*=2),u+p>=1?e+=x/l:e+=x*Math.pow(2,1-p),e*l>=2&&(u++,l/=2),u+p>=d?(h=0,u=d):u+p>=1?(h=(e*l-1)*Math.pow(2,c),u=u+p):(h=e*Math.pow(2,p-1)*Math.pow(2,c),u=0));c>=8;t[n+m]=h&255,m+=v,h/=256,c-=8);for(u=u<<c|h,b+=c;b>0;t[n+m]=u&255,m+=v,u/=256,b-=8);t[n+m-v]|=g*128};/*!
|
|
5
|
-
* The buffer module from node.js, for the browser.
|
|
6
|
-
*
|
|
7
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
8
|
-
* @license MIT
|
|
9
|
-
*/(function(t){const e=base64Js,n=ieee754,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=W,t.INSPECT_MAX_BYTES=50;const c=2147483647;t.kMaxLength=c;const{Uint8Array:o,ArrayBuffer:u,SharedArrayBuffer:h}=globalThis;d.TYPED_ARRAY_SUPPORT=l(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const V=new o(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,o.prototype),Object.setPrototypeOf(V,T),V.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function b(V){if(V>c)throw new RangeError('The value "'+V+'" is invalid for option "size"');const T=new o(V);return Object.setPrototypeOf(T,d.prototype),T}function d(V,T,O){if(typeof V=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(V)}return p(V,T,O)}d.poolSize=8192;function p(V,T,O){if(typeof V=="string")return g(V,T);if(u.isView(V))return B(V);if(V==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof V);if(Be(V,u)||V&&Be(V.buffer,u)||typeof h<"u"&&(Be(V,h)||V&&Be(V.buffer,h)))return C(V,T,O);if(typeof V=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const X=V.valueOf&&V.valueOf();if(X!=null&&X!==V)return d.from(X,T,O);const ne=F(V);if(ne)return ne;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof V[Symbol.toPrimitive]=="function")return d.from(V[Symbol.toPrimitive]("string"),T,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof V)}d.from=function(V,T,O){return p(V,T,O)},Object.setPrototypeOf(d.prototype,o.prototype),Object.setPrototypeOf(d,o);function x(V){if(typeof V!="number")throw new TypeError('"size" argument must be of type number');if(V<0)throw new RangeError('The value "'+V+'" is invalid for option "size"')}function m(V,T,O){return x(V),V<=0?b(V):T!==void 0?typeof O=="string"?b(V).fill(T,O):b(V).fill(T):b(V)}d.alloc=function(V,T,O){return m(V,T,O)};function v(V){return x(V),b(V<0?0:H(V)|0)}d.allocUnsafe=function(V){return v(V)},d.allocUnsafeSlow=function(V){return v(V)};function g(V,T){if((typeof T!="string"||T==="")&&(T="utf8"),!d.isEncoding(T))throw new TypeError("Unknown encoding: "+T);const O=Z(V,T)|0;let X=b(O);const ne=X.write(V,T);return ne!==O&&(X=X.slice(0,ne)),X}function $(V){const T=V.length<0?0:H(V.length)|0,O=b(T);for(let X=0;X<T;X+=1)O[X]=V[X]&255;return O}function B(V){if(Be(V,o)){const T=new o(V);return C(T.buffer,T.byteOffset,T.byteLength)}return $(V)}function C(V,T,O){if(T<0||V.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(V.byteLength<T+(O||0))throw new RangeError('"length" is outside of buffer bounds');let X;return T===void 0&&O===void 0?X=new o(V):O===void 0?X=new o(V,T):X=new o(V,T,O),Object.setPrototypeOf(X,d.prototype),X}function F(V){if(d.isBuffer(V)){const T=H(V.length)|0,O=b(T);return O.length===0||V.copy(O,0,0,T),O}if(V.length!==void 0)return typeof V.length!="number"||De(V.length)?b(0):$(V);if(V.type==="Buffer"&&Array.isArray(V.data))return $(V.data)}function H(V){if(V>=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return V|0}function W(V){return+V!=V&&(V=0),d.alloc(+V)}d.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==d.prototype},d.compare=function(T,O){if(Be(T,o)&&(T=d.from(T,T.offset,T.byteLength)),Be(O,o)&&(O=d.from(O,O.offset,O.byteLength)),!d.isBuffer(T)||!d.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===O)return 0;let X=T.length,ne=O.length;for(let ce=0,ue=Math.min(X,ne);ce<ue;++ce)if(T[ce]!==O[ce]){X=T[ce],ne=O[ce];break}return X<ne?-1:ne<X?1:0},d.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(T,O){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return d.alloc(0);let X;if(O===void 0)for(O=0,X=0;X<T.length;++X)O+=T[X].length;const ne=d.allocUnsafe(O);let ce=0;for(X=0;X<T.length;++X){let ue=T[X];if(Be(ue,o))ce+ue.length>ne.length?(d.isBuffer(ue)||(ue=d.from(ue)),ue.copy(ne,ce)):o.prototype.set.call(ne,ue,ce);else if(d.isBuffer(ue))ue.copy(ne,ce);else throw new TypeError('"list" argument must be an Array of Buffers');ce+=ue.length}return ne};function Z(V,T){if(d.isBuffer(V))return V.length;if(u.isView(V)||Be(V,u))return V.byteLength;if(typeof V!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof V);const O=V.length,X=arguments.length>2&&arguments[2]===!0;if(!X&&O===0)return 0;let ne=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return ge(V).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return Ne(V).length;default:if(ne)return X?-1:ge(V).length;T=(""+T).toLowerCase(),ne=!0}}d.byteLength=Z;function ie(V,T,O){let X=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,T>>>=0,O<=T))return"";for(V||(V="utf8");;)switch(V){case"hex":return E(this,T,O);case"utf8":case"utf-8":return M(this,T,O);case"ascii":return _(this,T,O);case"latin1":case"binary":return q(this,T,O);case"base64":return I(this,T,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,T,O);default:if(X)throw new TypeError("Unknown encoding: "+V);V=(V+"").toLowerCase(),X=!0}}d.prototype._isBuffer=!0;function te(V,T,O){const X=V[T];V[T]=V[O],V[O]=X}d.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<T;O+=2)te(this,O,O+1);return this},d.prototype.swap32=function(){const T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<T;O+=4)te(this,O,O+3),te(this,O+1,O+2);return this},d.prototype.swap64=function(){const T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<T;O+=8)te(this,O,O+7),te(this,O+1,O+6),te(this,O+2,O+5),te(this,O+3,O+4);return this},d.prototype.toString=function(){const T=this.length;return T===0?"":arguments.length===0?M(this,0,T):ie.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(T){if(!d.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:d.compare(this,T)===0},d.prototype.inspect=function(){let T="";const O=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(T+=" ... "),"<Buffer "+T+">"},a&&(d.prototype[a]=d.prototype.inspect),d.prototype.compare=function(T,O,X,ne,ce){if(Be(T,o)&&(T=d.from(T,T.offset,T.byteLength)),!d.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(O===void 0&&(O=0),X===void 0&&(X=T?T.length:0),ne===void 0&&(ne=0),ce===void 0&&(ce=this.length),O<0||X>T.length||ne<0||ce>this.length)throw new RangeError("out of range index");if(ne>=ce&&O>=X)return 0;if(ne>=ce)return-1;if(O>=X)return 1;if(O>>>=0,X>>>=0,ne>>>=0,ce>>>=0,this===T)return 0;let ue=ce-ne,me=X-O;const Ee=Math.min(ue,me),xe=this.slice(ne,ce),Ae=T.slice(O,X);for(let _e=0;_e<Ee;++_e)if(xe[_e]!==Ae[_e]){ue=xe[_e],me=Ae[_e];break}return ue<me?-1:me<ue?1:0};function ae(V,T,O,X,ne){if(V.length===0)return-1;if(typeof O=="string"?(X=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,De(O)&&(O=ne?0:V.length-1),O<0&&(O=V.length+O),O>=V.length){if(ne)return-1;O=V.length-1}else if(O<0)if(ne)O=0;else return-1;if(typeof T=="string"&&(T=d.from(T,X)),d.isBuffer(T))return T.length===0?-1:de(V,T,O,X,ne);if(typeof T=="number")return T=T&255,typeof o.prototype.indexOf=="function"?ne?o.prototype.indexOf.call(V,T,O):o.prototype.lastIndexOf.call(V,T,O):de(V,[T],O,X,ne);throw new TypeError("val must be string, number or Buffer")}function de(V,T,O,X,ne){let ce=1,ue=V.length,me=T.length;if(X!==void 0&&(X=String(X).toLowerCase(),X==="ucs2"||X==="ucs-2"||X==="utf16le"||X==="utf-16le")){if(V.length<2||T.length<2)return-1;ce=2,ue/=2,me/=2,O/=2}function Ee(Ae,_e){return ce===1?Ae[_e]:Ae.readUInt16BE(_e*ce)}let xe;if(ne){let Ae=-1;for(xe=O;xe<ue;xe++)if(Ee(V,xe)===Ee(T,Ae===-1?0:xe-Ae)){if(Ae===-1&&(Ae=xe),xe-Ae+1===me)return Ae*ce}else Ae!==-1&&(xe-=xe-Ae),Ae=-1}else for(O+me>ue&&(O=ue-me),xe=O;xe>=0;xe--){let Ae=!0;for(let _e=0;_e<me;_e++)if(Ee(V,xe+_e)!==Ee(T,_e)){Ae=!1;break}if(Ae)return xe}return-1}d.prototype.includes=function(T,O,X){return this.indexOf(T,O,X)!==-1},d.prototype.indexOf=function(T,O,X){return ae(this,T,O,X,!0)},d.prototype.lastIndexOf=function(T,O,X){return ae(this,T,O,X,!1)};function J(V,T,O,X){O=Number(O)||0;const ne=V.length-O;X?(X=Number(X),X>ne&&(X=ne)):X=ne;const ce=T.length;X>ce/2&&(X=ce/2);let ue;for(ue=0;ue<X;++ue){const me=parseInt(T.substr(ue*2,2),16);if(De(me))return ue;V[O+ue]=me}return ue}function R(V,T,O,X){return ve(ge(T,V.length-O),V,O,X)}function A(V,T,O,X){return ve(ye(T),V,O,X)}function y(V,T,O,X){return ve(Ne(T),V,O,X)}function w(V,T,O,X){return ve($e(T,V.length-O),V,O,X)}d.prototype.write=function(T,O,X,ne){if(O===void 0)ne="utf8",X=this.length,O=0;else if(X===void 0&&typeof O=="string")ne=O,X=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(X)?(X=X>>>0,ne===void 0&&(ne="utf8")):(ne=X,X=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ce=this.length-O;if((X===void 0||X>ce)&&(X=ce),T.length>0&&(X<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");ne||(ne="utf8");let ue=!1;for(;;)switch(ne){case"hex":return J(this,T,O,X);case"utf8":case"utf-8":return R(this,T,O,X);case"ascii":case"latin1":case"binary":return A(this,T,O,X);case"base64":return y(this,T,O,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,T,O,X);default:if(ue)throw new TypeError("Unknown encoding: "+ne);ne=(""+ne).toLowerCase(),ue=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(V,T,O){return T===0&&O===V.length?e.fromByteArray(V):e.fromByteArray(V.slice(T,O))}function M(V,T,O){O=Math.min(V.length,O);const X=[];let ne=T;for(;ne<O;){const ce=V[ne];let ue=null,me=ce>239?4:ce>223?3:ce>191?2:1;if(ne+me<=O){let Ee,xe,Ae,_e;switch(me){case 1:ce<128&&(ue=ce);break;case 2:Ee=V[ne+1],(Ee&192)===128&&(_e=(ce&31)<<6|Ee&63,_e>127&&(ue=_e));break;case 3:Ee=V[ne+1],xe=V[ne+2],(Ee&192)===128&&(xe&192)===128&&(_e=(ce&15)<<12|(Ee&63)<<6|xe&63,_e>2047&&(_e<55296||_e>57343)&&(ue=_e));break;case 4:Ee=V[ne+1],xe=V[ne+2],Ae=V[ne+3],(Ee&192)===128&&(xe&192)===128&&(Ae&192)===128&&(_e=(ce&15)<<18|(Ee&63)<<12|(xe&63)<<6|Ae&63,_e>65535&&_e<1114112&&(ue=_e))}}ue===null?(ue=65533,me=1):ue>65535&&(ue-=65536,X.push(ue>>>10&1023|55296),ue=56320|ue&1023),X.push(ue),ne+=me}return P(X)}const k=4096;function P(V){const T=V.length;if(T<=k)return String.fromCharCode.apply(String,V);let O="",X=0;for(;X<T;)O+=String.fromCharCode.apply(String,V.slice(X,X+=k));return O}function _(V,T,O){let X="";O=Math.min(V.length,O);for(let ne=T;ne<O;++ne)X+=String.fromCharCode(V[ne]&127);return X}function q(V,T,O){let X="";O=Math.min(V.length,O);for(let ne=T;ne<O;++ne)X+=String.fromCharCode(V[ne]);return X}function E(V,T,O){const X=V.length;(!T||T<0)&&(T=0),(!O||O<0||O>X)&&(O=X);let ne="";for(let ce=T;ce<O;++ce)ne+=Se[V[ce]];return ne}function j(V,T,O){const X=V.slice(T,O);let ne="";for(let ce=0;ce<X.length-1;ce+=2)ne+=String.fromCharCode(X[ce]+X[ce+1]*256);return ne}d.prototype.slice=function(T,O){const X=this.length;T=~~T,O=O===void 0?X:~~O,T<0?(T+=X,T<0&&(T=0)):T>X&&(T=X),O<0?(O+=X,O<0&&(O=0)):O>X&&(O=X),O<T&&(O=T);const ne=this.subarray(T,O);return Object.setPrototypeOf(ne,d.prototype),ne};function ee(V,T,O){if(V%1!==0||V<0)throw new RangeError("offset is not uint");if(V+T>O)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(T,O,X){T=T>>>0,O=O>>>0,X||ee(T,O,this.length);let ne=this[T],ce=1,ue=0;for(;++ue<O&&(ce*=256);)ne+=this[T+ue]*ce;return ne},d.prototype.readUintBE=d.prototype.readUIntBE=function(T,O,X){T=T>>>0,O=O>>>0,X||ee(T,O,this.length);let ne=this[T+--O],ce=1;for(;O>0&&(ce*=256);)ne+=this[T+--O]*ce;return ne},d.prototype.readUint8=d.prototype.readUInt8=function(T,O){return T=T>>>0,O||ee(T,1,this.length),this[T]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(T,O){return T=T>>>0,O||ee(T,2,this.length),this[T]|this[T+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(T,O){return T=T>>>0,O||ee(T,2,this.length),this[T]<<8|this[T+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(T,O){return T=T>>>0,O||ee(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(T,O){return T=T>>>0,O||ee(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},d.prototype.readBigUInt64LE=Oe(function(T){T=T>>>0,le(T,"offset");const O=this[T],X=this[T+7];(O===void 0||X===void 0)&&pe(T,this.length-8);const ne=O+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,ce=this[++T]+this[++T]*2**8+this[++T]*2**16+X*2**24;return BigInt(ne)+(BigInt(ce)<<BigInt(32))}),d.prototype.readBigUInt64BE=Oe(function(T){T=T>>>0,le(T,"offset");const O=this[T],X=this[T+7];(O===void 0||X===void 0)&&pe(T,this.length-8);const ne=O*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],ce=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+X;return(BigInt(ne)<<BigInt(32))+BigInt(ce)}),d.prototype.readIntLE=function(T,O,X){T=T>>>0,O=O>>>0,X||ee(T,O,this.length);let ne=this[T],ce=1,ue=0;for(;++ue<O&&(ce*=256);)ne+=this[T+ue]*ce;return ce*=128,ne>=ce&&(ne-=Math.pow(2,8*O)),ne},d.prototype.readIntBE=function(T,O,X){T=T>>>0,O=O>>>0,X||ee(T,O,this.length);let ne=O,ce=1,ue=this[T+--ne];for(;ne>0&&(ce*=256);)ue+=this[T+--ne]*ce;return ce*=128,ue>=ce&&(ue-=Math.pow(2,8*O)),ue},d.prototype.readInt8=function(T,O){return T=T>>>0,O||ee(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},d.prototype.readInt16LE=function(T,O){T=T>>>0,O||ee(T,2,this.length);const X=this[T]|this[T+1]<<8;return X&32768?X|4294901760:X},d.prototype.readInt16BE=function(T,O){T=T>>>0,O||ee(T,2,this.length);const X=this[T+1]|this[T]<<8;return X&32768?X|4294901760:X},d.prototype.readInt32LE=function(T,O){return T=T>>>0,O||ee(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},d.prototype.readInt32BE=function(T,O){return T=T>>>0,O||ee(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},d.prototype.readBigInt64LE=Oe(function(T){T=T>>>0,le(T,"offset");const O=this[T],X=this[T+7];(O===void 0||X===void 0)&&pe(T,this.length-8);const ne=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(X<<24);return(BigInt(ne)<<BigInt(32))+BigInt(O+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),d.prototype.readBigInt64BE=Oe(function(T){T=T>>>0,le(T,"offset");const O=this[T],X=this[T+7];(O===void 0||X===void 0)&&pe(T,this.length-8);const ne=(O<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(ne)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+X)}),d.prototype.readFloatLE=function(T,O){return T=T>>>0,O||ee(T,4,this.length),n.read(this,T,!0,23,4)},d.prototype.readFloatBE=function(T,O){return T=T>>>0,O||ee(T,4,this.length),n.read(this,T,!1,23,4)},d.prototype.readDoubleLE=function(T,O){return T=T>>>0,O||ee(T,8,this.length),n.read(this,T,!0,52,8)},d.prototype.readDoubleBE=function(T,O){return T=T>>>0,O||ee(T,8,this.length),n.read(this,T,!1,52,8)};function oe(V,T,O,X,ne,ce){if(!d.isBuffer(V))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>ne||T<ce)throw new RangeError('"value" argument is out of bounds');if(O+X>V.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(T,O,X,ne){if(T=+T,O=O>>>0,X=X>>>0,!ne){const me=Math.pow(2,8*X)-1;oe(this,T,O,X,me,0)}let ce=1,ue=0;for(this[O]=T&255;++ue<X&&(ce*=256);)this[O+ue]=T/ce&255;return O+X},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(T,O,X,ne){if(T=+T,O=O>>>0,X=X>>>0,!ne){const me=Math.pow(2,8*X)-1;oe(this,T,O,X,me,0)}let ce=X-1,ue=1;for(this[O+ce]=T&255;--ce>=0&&(ue*=256);)this[O+ce]=T/ue&255;return O+X},d.prototype.writeUint8=d.prototype.writeUInt8=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,1,255,0),this[O]=T&255,O+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,2,65535,0),this[O]=T&255,this[O+1]=T>>>8,O+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,2,65535,0),this[O]=T>>>8,this[O+1]=T&255,O+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,4,4294967295,0),this[O+3]=T>>>24,this[O+2]=T>>>16,this[O+1]=T>>>8,this[O]=T&255,O+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,4,4294967295,0),this[O]=T>>>24,this[O+1]=T>>>16,this[O+2]=T>>>8,this[O+3]=T&255,O+4};function Y(V,T,O,X,ne){he(T,X,ne,V,O,7);let ce=Number(T&BigInt(4294967295));V[O++]=ce,ce=ce>>8,V[O++]=ce,ce=ce>>8,V[O++]=ce,ce=ce>>8,V[O++]=ce;let ue=Number(T>>BigInt(32)&BigInt(4294967295));return V[O++]=ue,ue=ue>>8,V[O++]=ue,ue=ue>>8,V[O++]=ue,ue=ue>>8,V[O++]=ue,O}function L(V,T,O,X,ne){he(T,X,ne,V,O,7);let ce=Number(T&BigInt(4294967295));V[O+7]=ce,ce=ce>>8,V[O+6]=ce,ce=ce>>8,V[O+5]=ce,ce=ce>>8,V[O+4]=ce;let ue=Number(T>>BigInt(32)&BigInt(4294967295));return V[O+3]=ue,ue=ue>>8,V[O+2]=ue,ue=ue>>8,V[O+1]=ue,ue=ue>>8,V[O]=ue,O+8}d.prototype.writeBigUInt64LE=Oe(function(T,O=0){return Y(this,T,O,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=Oe(function(T,O=0){return L(this,T,O,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(T,O,X,ne){if(T=+T,O=O>>>0,!ne){const Ee=Math.pow(2,8*X-1);oe(this,T,O,X,Ee-1,-Ee)}let ce=0,ue=1,me=0;for(this[O]=T&255;++ce<X&&(ue*=256);)T<0&&me===0&&this[O+ce-1]!==0&&(me=1),this[O+ce]=(T/ue>>0)-me&255;return O+X},d.prototype.writeIntBE=function(T,O,X,ne){if(T=+T,O=O>>>0,!ne){const Ee=Math.pow(2,8*X-1);oe(this,T,O,X,Ee-1,-Ee)}let ce=X-1,ue=1,me=0;for(this[O+ce]=T&255;--ce>=0&&(ue*=256);)T<0&&me===0&&this[O+ce+1]!==0&&(me=1),this[O+ce]=(T/ue>>0)-me&255;return O+X},d.prototype.writeInt8=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,1,127,-128),T<0&&(T=255+T+1),this[O]=T&255,O+1},d.prototype.writeInt16LE=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,2,32767,-32768),this[O]=T&255,this[O+1]=T>>>8,O+2},d.prototype.writeInt16BE=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,2,32767,-32768),this[O]=T>>>8,this[O+1]=T&255,O+2},d.prototype.writeInt32LE=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,4,2147483647,-2147483648),this[O]=T&255,this[O+1]=T>>>8,this[O+2]=T>>>16,this[O+3]=T>>>24,O+4},d.prototype.writeInt32BE=function(T,O,X){return T=+T,O=O>>>0,X||oe(this,T,O,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[O]=T>>>24,this[O+1]=T>>>16,this[O+2]=T>>>8,this[O+3]=T&255,O+4},d.prototype.writeBigInt64LE=Oe(function(T,O=0){return Y(this,T,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=Oe(function(T,O=0){return L(this,T,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function z(V,T,O,X,ne,ce){if(O+X>V.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(V,T,O,X,ne){return T=+T,O=O>>>0,ne||z(V,T,O,4),n.write(V,T,O,X,23,4),O+4}d.prototype.writeFloatLE=function(T,O,X){return re(this,T,O,!0,X)},d.prototype.writeFloatBE=function(T,O,X){return re(this,T,O,!1,X)};function D(V,T,O,X,ne){return T=+T,O=O>>>0,ne||z(V,T,O,8),n.write(V,T,O,X,52,8),O+8}d.prototype.writeDoubleLE=function(T,O,X){return D(this,T,O,!0,X)},d.prototype.writeDoubleBE=function(T,O,X){return D(this,T,O,!1,X)},d.prototype.copy=function(T,O,X,ne){if(!d.isBuffer(T))throw new TypeError("argument should be a Buffer");if(X||(X=0),!ne&&ne!==0&&(ne=this.length),O>=T.length&&(O=T.length),O||(O=0),ne>0&&ne<X&&(ne=X),ne===X||T.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(X<0||X>=this.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("sourceEnd out of bounds");ne>this.length&&(ne=this.length),T.length-O<ne-X&&(ne=T.length-O+X);const ce=ne-X;return this===T&&typeof o.prototype.copyWithin=="function"?this.copyWithin(O,X,ne):o.prototype.set.call(T,this.subarray(X,ne),O),ce},d.prototype.fill=function(T,O,X,ne){if(typeof T=="string"){if(typeof O=="string"?(ne=O,O=0,X=this.length):typeof X=="string"&&(ne=X,X=this.length),ne!==void 0&&typeof ne!="string")throw new TypeError("encoding must be a string");if(typeof ne=="string"&&!d.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);if(T.length===1){const ue=T.charCodeAt(0);(ne==="utf8"&&ue<128||ne==="latin1")&&(T=ue)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(O<0||this.length<O||this.length<X)throw new RangeError("Out of range index");if(X<=O)return this;O=O>>>0,X=X===void 0?this.length:X>>>0,T||(T=0);let ce;if(typeof T=="number")for(ce=O;ce<X;++ce)this[ce]=T;else{const ue=d.isBuffer(T)?T:d.from(T,ne),me=ue.length;if(me===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(ce=0;ce<X-O;++ce)this[ce+O]=ue[ce%me]}return this};const G={};function U(V,T,O){G[V]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${V}]`,this.stack,delete this.name}get code(){return V}set code(ne){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ne,writable:!0})}toString(){return`${this.name} [${V}]: ${this.message}`}}}U("ERR_BUFFER_OUT_OF_BOUNDS",function(V){return V?`${V} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(V,T){return`The "${V}" argument must be of type number. Received type ${typeof T}`},TypeError),U("ERR_OUT_OF_RANGE",function(V,T,O){let X=`The value of "${V}" is out of range.`,ne=O;return Number.isInteger(O)&&Math.abs(O)>2**32?ne=Q(String(O)):typeof O=="bigint"&&(ne=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(ne=Q(ne)),ne+="n"),X+=` It must be ${T}. Received ${ne}`,X},RangeError);function Q(V){let T="",O=V.length;const X=V[0]==="-"?1:0;for(;O>=X+4;O-=3)T=`_${V.slice(O-3,O)}${T}`;return`${V.slice(0,O)}${T}`}function fe(V,T,O){le(T,"offset"),(V[T]===void 0||V[T+O]===void 0)&&pe(T,V.length-(O+1))}function he(V,T,O,X,ne,ce){if(V>O||V<T){const ue=typeof T=="bigint"?"n":"";let me;throw T===0||T===BigInt(0)?me=`>= 0${ue} and < 2${ue} ** ${(ce+1)*8}${ue}`:me=`>= -(2${ue} ** ${(ce+1)*8-1}${ue}) and < 2 ** ${(ce+1)*8-1}${ue}`,new G.ERR_OUT_OF_RANGE("value",me,V)}fe(X,ne,ce)}function le(V,T){if(typeof V!="number")throw new G.ERR_INVALID_ARG_TYPE(T,"number",V)}function pe(V,T,O){throw Math.floor(V)!==V?(le(V,O),new G.ERR_OUT_OF_RANGE("offset","an integer",V)):T<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${T}`,V)}const be=/[^+/0-9A-Za-z-_]/g;function se(V){if(V=V.split("=")[0],V=V.trim().replace(be,""),V.length<2)return"";for(;V.length%4!==0;)V=V+"=";return V}function ge(V,T){T=T||1/0;let O;const X=V.length;let ne=null;const ce=[];for(let ue=0;ue<X;++ue){if(O=V.charCodeAt(ue),O>55295&&O<57344){if(!ne){if(O>56319){(T-=3)>-1&&ce.push(239,191,189);continue}else if(ue+1===X){(T-=3)>-1&&ce.push(239,191,189);continue}ne=O;continue}if(O<56320){(T-=3)>-1&&ce.push(239,191,189),ne=O;continue}O=(ne-55296<<10|O-56320)+65536}else ne&&(T-=3)>-1&&ce.push(239,191,189);if(ne=null,O<128){if((T-=1)<0)break;ce.push(O)}else if(O<2048){if((T-=2)<0)break;ce.push(O>>6|192,O&63|128)}else if(O<65536){if((T-=3)<0)break;ce.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((T-=4)<0)break;ce.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return ce}function ye(V){const T=[];for(let O=0;O<V.length;++O)T.push(V.charCodeAt(O)&255);return T}function $e(V,T){let O,X,ne;const ce=[];for(let ue=0;ue<V.length&&!((T-=2)<0);++ue)O=V.charCodeAt(ue),X=O>>8,ne=O%256,ce.push(ne),ce.push(X);return ce}function Ne(V){return e.toByteArray(se(V))}function ve(V,T,O,X){let ne;for(ne=0;ne<X&&!(ne+O>=T.length||ne>=V.length);++ne)T[ne+O]=V[ne];return ne}function Be(V,T){return V instanceof T||V!=null&&V.constructor!=null&&V.constructor.name!=null&&V.constructor.name===T.name}function De(V){return V!==V}const Se=function(){const V="0123456789abcdef",T=new Array(256);for(let O=0;O<16;++O){const X=O*16;for(let ne=0;ne<16;++ne)T[X+ne]=V[O]+V[ne]}return T}();function Oe(V){return typeof BigInt>"u"?je:V}function je(){throw new Error("BigInt not supported")}})(buffer$1);const Buffer=buffer$1.Buffer,Buffer$1=buffer$1.Buffer,dist$1=Object.freeze(Object.defineProperty({__proto__:null,Buffer:Buffer$1,default:Buffer},Symbol.toStringTag,{value:"Module"}));var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function getAugmentedNamespace(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function a(){return this instanceof a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var c=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,c.get?c:{enumerable:!0,get:function(){return t[a]}})}),n}var dist={},file={},chunk={},span={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_SPAN_LENGTH=t.DEFAULT_SPAN_SIZE=void 0,t.makeSpan=e,t.getSpanValue=n,t.DEFAULT_SPAN_SIZE=8,t.MAX_SPAN_LENGTH=Math.pow(2,32)-1;function e(a,c){const o=c||t.DEFAULT_SPAN_SIZE;if(a<0)throw new Error(`invalid length for span: ${a}`);if(a>t.MAX_SPAN_LENGTH)throw new Error(`invalid length (> ${t.MAX_SPAN_LENGTH}) ${a}`);const u=new Uint8Array(o),h=new DataView(u.buffer),l=!0,b=a&4294967295;return h.setUint32(0,b,l),u}function n(a){return new DataView(a.buffer).getUint32(0,!0)}})(span);var utils$p={};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var browser$c={exports:{}},process=browser$c.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch{try{return cachedSetTimeout.call(null,t,0)}catch{return cachedSetTimeout.call(this,t,0)}}}function runClearTimeout(t){if(cachedClearTimeout===clearTimeout)return clearTimeout(t);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(t);try{return cachedClearTimeout(t)}catch{try{return cachedClearTimeout.call(null,t)}catch{return cachedClearTimeout.call(this,t)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var e=queue.length;e;){for(currentQueue=queue,queue=[];++queueIndex<e;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,e=queue.length}currentQueue=null,draining=!1,runClearTimeout(t)}}process.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];queue.push(new Item(t,e)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(t,e){this.fun=t,this.array=e}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop$1(){}process.on=noop$1,process.addListener=noop$1,process.once=noop$1,process.off=noop$1,process.removeListener=noop$1,process.removeAllListeners=noop$1,process.emit=noop$1,process.prependListener=noop$1,process.prependOnceListener=noop$1,process.listeners=function(t){return[]},process.binding=function(t){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(t){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser$c.exports;const process$1=getDefaultExportFromCjs(browserExports);var sha3={exports:{}};(function(t){(function(){var e="input is invalid type",n="finalize already called",a=typeof window=="object",c=a?window:{};c.JS_SHA3_NO_WINDOW&&(a=!1);var o=!a&&typeof self=="object",u=!c.JS_SHA3_NO_NODE_JS&&typeof process$1=="object"&&process$1.versions&&process$1.versions.node;u?c=commonjsGlobal:o&&(c=self);for(var h=!c.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!c.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",b="0123456789abcdef".split(""),d=[31,7936,2031616,520093696],p=[4,1024,262144,67108864],x=[1,256,65536,16777216],m=[6,1536,393216,100663296],v=[0,8,16,24],g=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],$=[224,256,384,512],B=[128,256],C=["hex","buffer","arrayBuffer","array","digest"],F={128:168,256:136},H=c.JS_SHA3_NO_NODE_JS||!Array.isArray?function(D){return Object.prototype.toString.call(D)==="[object Array]"}:Array.isArray,W=l&&(c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)?function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer}:ArrayBuffer.isView,Z=function(D){var G=typeof D;if(G==="string")return[D,!0];if(G!=="object"||D===null)throw new Error(e);if(l&&D.constructor===ArrayBuffer)return[new Uint8Array(D),!1];if(!H(D)&&!W(D))throw new Error(e);return[D,!1]},ie=function(D){return Z(D)[0].length===0},te=function(D){for(var G=[],U=0;U<D.length;++U)G[U]=D[U];return G},ae=function(D,G,U){return function(Q){return new L(D,G,D).update(Q)[U]()}},de=function(D,G,U){return function(Q,fe){return new L(D,G,fe).update(Q)[U]()}},J=function(D,G,U){return function(Q,fe,he,le){return P["cshake"+D].update(Q,fe,he,le)[U]()}},R=function(D,G,U){return function(Q,fe,he,le){return P["kmac"+D].update(Q,fe,he,le)[U]()}},A=function(D,G,U,Q){for(var fe=0;fe<C.length;++fe){var he=C[fe];D[he]=G(U,Q,he)}return D},y=function(D,G){var U=ae(D,G,"hex");return U.create=function(){return new L(D,G,D)},U.update=function(Q){return U.create().update(Q)},A(U,ae,D,G)},w=function(D,G){var U=de(D,G,"hex");return U.create=function(Q){return new L(D,G,Q)},U.update=function(Q,fe){return U.create(fe).update(Q)},A(U,de,D,G)},I=function(D,G){var U=F[D],Q=J(D,G,"hex");return Q.create=function(fe,he,le){return ie(he)&&ie(le)?P["shake"+D].create(fe):new L(D,G,fe).bytepad([he,le],U)},Q.update=function(fe,he,le,pe){return Q.create(he,le,pe).update(fe)},A(Q,J,D,G)},M=function(D,G){var U=F[D],Q=R(D,G,"hex");return Q.create=function(fe,he,le){return new z(D,G,he).bytepad(["KMAC",le],U).bytepad([fe],U)},Q.update=function(fe,he,le,pe){return Q.create(fe,le,pe).update(he)},A(Q,R,D,G)},k=[{name:"keccak",padding:x,bits:$,createMethod:y},{name:"sha3",padding:m,bits:$,createMethod:y},{name:"shake",padding:d,bits:B,createMethod:w},{name:"cshake",padding:p,bits:B,createMethod:I},{name:"kmac",padding:p,bits:B,createMethod:M}],P={},_=[],q=0;q<k.length;++q)for(var E=k[q],j=E.bits,ee=0;ee<j.length;++ee){var oe=E.name+"_"+j[ee];if(_.push(oe),P[oe]=E.createMethod(j[ee],E.padding),E.name!=="sha3"){var Y=E.name+j[ee];_.push(Y),P[Y]=P[oe]}}function L(D,G,U){this.blocks=[],this.s=[],this.padding=G,this.outputBits=U,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(D<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=U>>5,this.extraBytes=(U&31)>>3;for(var Q=0;Q<50;++Q)this.s[Q]=0}L.prototype.update=function(D){if(this.finalized)throw new Error(n);var G=Z(D);D=G[0];for(var U=G[1],Q=this.blocks,fe=this.byteCount,he=D.length,le=this.blockCount,pe=0,be=this.s,se,ge;pe<he;){if(this.reset)for(this.reset=!1,Q[0]=this.block,se=1;se<le+1;++se)Q[se]=0;if(U)for(se=this.start;pe<he&&se<fe;++pe)ge=D.charCodeAt(pe),ge<128?Q[se>>2]|=ge<<v[se++&3]:ge<2048?(Q[se>>2]|=(192|ge>>6)<<v[se++&3],Q[se>>2]|=(128|ge&63)<<v[se++&3]):ge<55296||ge>=57344?(Q[se>>2]|=(224|ge>>12)<<v[se++&3],Q[se>>2]|=(128|ge>>6&63)<<v[se++&3],Q[se>>2]|=(128|ge&63)<<v[se++&3]):(ge=65536+((ge&1023)<<10|D.charCodeAt(++pe)&1023),Q[se>>2]|=(240|ge>>18)<<v[se++&3],Q[se>>2]|=(128|ge>>12&63)<<v[se++&3],Q[se>>2]|=(128|ge>>6&63)<<v[se++&3],Q[se>>2]|=(128|ge&63)<<v[se++&3]);else for(se=this.start;pe<he&&se<fe;++pe)Q[se>>2]|=D[pe]<<v[se++&3];if(this.lastByteIndex=se,se>=fe){for(this.start=se-fe,this.block=Q[le],se=0;se<le;++se)be[se]^=Q[se];re(be),this.reset=!0}else this.start=se}return this},L.prototype.encode=function(D,G){var U=D&255,Q=1,fe=[U];for(D=D>>8,U=D&255;U>0;)fe.unshift(U),D=D>>8,U=D&255,++Q;return G?fe.push(Q):fe.unshift(Q),this.update(fe),fe.length},L.prototype.encodeString=function(D){var G=Z(D);D=G[0];var U=G[1],Q=0,fe=D.length;if(U)for(var he=0;he<D.length;++he){var le=D.charCodeAt(he);le<128?Q+=1:le<2048?Q+=2:le<55296||le>=57344?Q+=3:(le=65536+((le&1023)<<10|D.charCodeAt(++he)&1023),Q+=4)}else Q=fe;return Q+=this.encode(Q*8),this.update(D),Q},L.prototype.bytepad=function(D,G){for(var U=this.encode(G),Q=0;Q<D.length;++Q)U+=this.encodeString(D[Q]);var fe=(G-U%G)%G,he=[];return he.length=fe,this.update(he),this},L.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,G=this.lastByteIndex,U=this.blockCount,Q=this.s;if(D[G>>2]|=this.padding[G&3],this.lastByteIndex===this.byteCount)for(D[0]=D[U],G=1;G<U+1;++G)D[G]=0;for(D[U-1]|=2147483648,G=0;G<U;++G)Q[G]^=D[G];re(Q)}},L.prototype.toString=L.prototype.hex=function(){this.finalize();for(var D=this.blockCount,G=this.s,U=this.outputBlocks,Q=this.extraBytes,fe=0,he=0,le="",pe;he<U;){for(fe=0;fe<D&&he<U;++fe,++he)pe=G[fe],le+=b[pe>>4&15]+b[pe&15]+b[pe>>12&15]+b[pe>>8&15]+b[pe>>20&15]+b[pe>>16&15]+b[pe>>28&15]+b[pe>>24&15];he%D===0&&(G=te(G),re(G),fe=0)}return Q&&(pe=G[fe],le+=b[pe>>4&15]+b[pe&15],Q>1&&(le+=b[pe>>12&15]+b[pe>>8&15]),Q>2&&(le+=b[pe>>20&15]+b[pe>>16&15])),le},L.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,G=this.s,U=this.outputBlocks,Q=this.extraBytes,fe=0,he=0,le=this.outputBits>>3,pe;Q?pe=new ArrayBuffer(U+1<<2):pe=new ArrayBuffer(le);for(var be=new Uint32Array(pe);he<U;){for(fe=0;fe<D&&he<U;++fe,++he)be[he]=G[fe];he%D===0&&(G=te(G),re(G))}return Q&&(be[he]=G[fe],pe=pe.slice(0,le)),pe},L.prototype.buffer=L.prototype.arrayBuffer,L.prototype.digest=L.prototype.array=function(){this.finalize();for(var D=this.blockCount,G=this.s,U=this.outputBlocks,Q=this.extraBytes,fe=0,he=0,le=[],pe,be;he<U;){for(fe=0;fe<D&&he<U;++fe,++he)pe=he<<2,be=G[fe],le[pe]=be&255,le[pe+1]=be>>8&255,le[pe+2]=be>>16&255,le[pe+3]=be>>24&255;he%D===0&&(G=te(G),re(G))}return Q&&(pe=he<<2,be=G[fe],le[pe]=be&255,Q>1&&(le[pe+1]=be>>8&255),Q>2&&(le[pe+2]=be>>16&255)),le};function z(D,G,U){L.call(this,D,G,U)}z.prototype=new L,z.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var re=function(D){var G,U,Q,fe,he,le,pe,be,se,ge,ye,$e,Ne,ve,Be,De,Se,Oe,je,V,T,O,X,ne,ce,ue,me,Ee,xe,Ae,_e,Me,ze,Ve,Ie,We,Je,Pe,Ze,Xe,Te,Ye,Qe,ke,et,tt,qe,rt,it,Ce,nt,Ge,Ke,ct,dt,ht,lt,pt,bt,xt,yt,mt,vt;for(Q=0;Q<48;Q+=2)fe=D[0]^D[10]^D[20]^D[30]^D[40],he=D[1]^D[11]^D[21]^D[31]^D[41],le=D[2]^D[12]^D[22]^D[32]^D[42],pe=D[3]^D[13]^D[23]^D[33]^D[43],be=D[4]^D[14]^D[24]^D[34]^D[44],se=D[5]^D[15]^D[25]^D[35]^D[45],ge=D[6]^D[16]^D[26]^D[36]^D[46],ye=D[7]^D[17]^D[27]^D[37]^D[47],$e=D[8]^D[18]^D[28]^D[38]^D[48],Ne=D[9]^D[19]^D[29]^D[39]^D[49],G=$e^(le<<1|pe>>>31),U=Ne^(pe<<1|le>>>31),D[0]^=G,D[1]^=U,D[10]^=G,D[11]^=U,D[20]^=G,D[21]^=U,D[30]^=G,D[31]^=U,D[40]^=G,D[41]^=U,G=fe^(be<<1|se>>>31),U=he^(se<<1|be>>>31),D[2]^=G,D[3]^=U,D[12]^=G,D[13]^=U,D[22]^=G,D[23]^=U,D[32]^=G,D[33]^=U,D[42]^=G,D[43]^=U,G=le^(ge<<1|ye>>>31),U=pe^(ye<<1|ge>>>31),D[4]^=G,D[5]^=U,D[14]^=G,D[15]^=U,D[24]^=G,D[25]^=U,D[34]^=G,D[35]^=U,D[44]^=G,D[45]^=U,G=be^($e<<1|Ne>>>31),U=se^(Ne<<1|$e>>>31),D[6]^=G,D[7]^=U,D[16]^=G,D[17]^=U,D[26]^=G,D[27]^=U,D[36]^=G,D[37]^=U,D[46]^=G,D[47]^=U,G=ge^(fe<<1|he>>>31),U=ye^(he<<1|fe>>>31),D[8]^=G,D[9]^=U,D[18]^=G,D[19]^=U,D[28]^=G,D[29]^=U,D[38]^=G,D[39]^=U,D[48]^=G,D[49]^=U,ve=D[0],Be=D[1],tt=D[11]<<4|D[10]>>>28,qe=D[10]<<4|D[11]>>>28,Ee=D[20]<<3|D[21]>>>29,xe=D[21]<<3|D[20]>>>29,xt=D[31]<<9|D[30]>>>23,yt=D[30]<<9|D[31]>>>23,Ye=D[40]<<18|D[41]>>>14,Qe=D[41]<<18|D[40]>>>14,Ve=D[2]<<1|D[3]>>>31,Ie=D[3]<<1|D[2]>>>31,De=D[13]<<12|D[12]>>>20,Se=D[12]<<12|D[13]>>>20,rt=D[22]<<10|D[23]>>>22,it=D[23]<<10|D[22]>>>22,Ae=D[33]<<13|D[32]>>>19,_e=D[32]<<13|D[33]>>>19,mt=D[42]<<2|D[43]>>>30,vt=D[43]<<2|D[42]>>>30,ct=D[5]<<30|D[4]>>>2,dt=D[4]<<30|D[5]>>>2,We=D[14]<<6|D[15]>>>26,Je=D[15]<<6|D[14]>>>26,Oe=D[25]<<11|D[24]>>>21,je=D[24]<<11|D[25]>>>21,Ce=D[34]<<15|D[35]>>>17,nt=D[35]<<15|D[34]>>>17,Me=D[45]<<29|D[44]>>>3,ze=D[44]<<29|D[45]>>>3,ne=D[6]<<28|D[7]>>>4,ce=D[7]<<28|D[6]>>>4,ht=D[17]<<23|D[16]>>>9,lt=D[16]<<23|D[17]>>>9,Pe=D[26]<<25|D[27]>>>7,Ze=D[27]<<25|D[26]>>>7,V=D[36]<<21|D[37]>>>11,T=D[37]<<21|D[36]>>>11,Ge=D[47]<<24|D[46]>>>8,Ke=D[46]<<24|D[47]>>>8,ke=D[8]<<27|D[9]>>>5,et=D[9]<<27|D[8]>>>5,ue=D[18]<<20|D[19]>>>12,me=D[19]<<20|D[18]>>>12,pt=D[29]<<7|D[28]>>>25,bt=D[28]<<7|D[29]>>>25,Xe=D[38]<<8|D[39]>>>24,Te=D[39]<<8|D[38]>>>24,O=D[48]<<14|D[49]>>>18,X=D[49]<<14|D[48]>>>18,D[0]=ve^~De&Oe,D[1]=Be^~Se&je,D[10]=ne^~ue&Ee,D[11]=ce^~me&xe,D[20]=Ve^~We&Pe,D[21]=Ie^~Je&Ze,D[30]=ke^~tt&rt,D[31]=et^~qe&it,D[40]=ct^~ht&pt,D[41]=dt^~lt&bt,D[2]=De^~Oe&V,D[3]=Se^~je&T,D[12]=ue^~Ee&Ae,D[13]=me^~xe&_e,D[22]=We^~Pe&Xe,D[23]=Je^~Ze&Te,D[32]=tt^~rt&Ce,D[33]=qe^~it&nt,D[42]=ht^~pt&xt,D[43]=lt^~bt&yt,D[4]=Oe^~V&O,D[5]=je^~T&X,D[14]=Ee^~Ae&Me,D[15]=xe^~_e&ze,D[24]=Pe^~Xe&Ye,D[25]=Ze^~Te&Qe,D[34]=rt^~Ce&Ge,D[35]=it^~nt&Ke,D[44]=pt^~xt&mt,D[45]=bt^~yt&vt,D[6]=V^~O&ve,D[7]=T^~X&Be,D[16]=Ae^~Me&ne,D[17]=_e^~ze&ce,D[26]=Xe^~Ye&Ve,D[27]=Te^~Qe&Ie,D[36]=Ce^~Ge&ke,D[37]=nt^~Ke&et,D[46]=xt^~mt&ct,D[47]=yt^~vt&dt,D[8]=O^~ve&De,D[9]=X^~Be&Se,D[18]=Me^~ne&ue,D[19]=ze^~ce&me,D[28]=Ye^~Ve&We,D[29]=Qe^~Ie&Je,D[38]=Ge^~ke&tt,D[39]=Ke^~et&qe,D[48]=mt^~ct&ht,D[49]=vt^~dt<,D[0]^=g[Q],D[1]^=g[Q+1]};if(h)t.exports=P;else for(q=0;q<_.length;++q)c[_[q]]=P[_[q]]})()})(sha3);var sha3Exports=sha3.exports;Object.defineProperty(utils$p,"__esModule",{value:!0}),utils$p.isFlexBytes=isFlexBytes,utils$p.assertFlexBytes=assertFlexBytes,utils$p.serializeBytes=serializeBytes$1,utils$p.keccak256Hash=keccak256Hash$1,utils$p.bytesToHex=bytesToHex$1,utils$p.equalBytes=equalBytes;const js_sha3_1=sha3Exports;function isFlexBytes(t,e,n){return t instanceof Uint8Array&&t.length>=e&&t.length<=n}function assertFlexBytes(t,e,n){if(!isFlexBytes(t,e,n))throw new TypeError(`Parameter is not valid FlexBytes of min: ${e}, max: ${n}, length: ${t.length}`)}function serializeBytes$1(...t){const e=t.reduce((c,o)=>c+o.length,0),n=new Uint8Array(e);let a=0;return t.forEach(c=>{n.set(c,a),a+=c.length}),n}function keccak256Hash$1(...t){const e=js_sha3_1.keccak256.create();return t.forEach(n=>e.update(n)),Uint8Array.from(e.digest())}function bytesToHex$1(t,e){const n=c=>c.toString(16).padStart(2,"0"),a=Array.from(t,n).join("");if(a.length!==e)throw new TypeError(`Resulting HexString does not have expected length ${e}: ${a}`);return a}function equalBytes(t,e){return t.length!==e.length?!1:t.every((n,a)=>e[a]===n)}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_MIN_PAYLOAD_SIZE=t.DEFAULT_MAX_PAYLOAD_SIZE=t.SEGMENT_SIZE=void 0,t.makeChunk=o,t.bmtRootHash=u,t.inclusionProofBottomUp=h,t.rootHashFromInclusionProof=l;const e=span,n=utils$p;t.SEGMENT_SIZE=32;const a=2*t.SEGMENT_SIZE;t.DEFAULT_MAX_PAYLOAD_SIZE=4096;const c=32;t.DEFAULT_MIN_PAYLOAD_SIZE=1;function o(p,x){const m=(x==null?void 0:x.maxPayloadSize)||t.DEFAULT_MAX_PAYLOAD_SIZE,v=(x==null?void 0:x.spanLength)||e.DEFAULT_SPAN_SIZE,g=(x==null?void 0:x.startingSpanValue)||p.length,$=x!=null&&x.hashFn?x.hashFn:n.keccak256Hash;(0,n.assertFlexBytes)(p,0,m);const B=new Uint8Array(m-p.length),C=()=>(0,e.makeSpan)(g,v),F=()=>(0,n.serializeBytes)(p,new Uint8Array(B));return{payload:p,spanLength:v,maxPayloadLength:m,data:F,span:C,address:()=>d(p,v,C(),{hashFn:$}),inclusionProof:ie=>h(F(),ie,{hashFn:$}),bmt:()=>b(F(),{hashFn:$})}}function u(p,x=t.DEFAULT_MAX_PAYLOAD_SIZE,m){if(p.length>x)throw new Error(`invalid data length ${p}`);const v=m!=null&&m.hashFn?m.hashFn:n.keccak256Hash;let g=new Uint8Array([...p,...new Uint8Array(x-p.length)]);for(;g.length!==c;){const $=new Uint8Array(g.length/2);for(let B=0;B<g.length;B+=a){const C=v(g.slice(B,B+a));$.set(C,B/2)}g=$}return g}function h(p,x,m){if(x*t.SEGMENT_SIZE>=p.length)throw new Error(`The given segment index ${x} is greater than ${Math.floor(p.length/t.SEGMENT_SIZE)}`);const v=b(p,m),g=[],$=v.length-1;for(let B=0;B<$;B++){const C=x%2===0?1:-1,F=x+C,H=v[B].slice(F*t.SEGMENT_SIZE,(F+1)*t.SEGMENT_SIZE);g.push(H),x>>>=1}return g}function l(p,x,m,v){const g=v!=null&&v.hashFn?v.hashFn:n.keccak256Hash;let $=x;for(const B of p)$=m%2===0?g($,B):g(B,$),m>>>=1;return $}function b(p,x){if(p.length>t.DEFAULT_MAX_PAYLOAD_SIZE)throw new Error(`invalid data length ${p.length}`);const m=x!=null&&x.hashFn?x.hashFn:n.keccak256Hash;let v=new Uint8Array([...p,...new Uint8Array(t.DEFAULT_MAX_PAYLOAD_SIZE-p.length)]);const g=[];for(;v.length!==c;){g.push(v);const $=new Uint8Array(v.length/2);for(let B=0;B<v.length;B+=a){const C=m(v.slice(B,B+a));$.set(C,B/2)}v=$}return g.push(v),g}function d(p,x,m,v){const g=v!=null&&v.hashFn?v.hashFn:n.keccak256Hash,$=m||(0,e.makeSpan)(p.length,x),B=u(p,t.DEFAULT_MAX_PAYLOAD_SIZE,v),C=new Uint8Array([...$,...B]);return g(C)}})(chunk);var hasRequiredFile;function requireFile(){if(hasRequiredFile)return file;hasRequiredFile=1,Object.defineProperty(file,"__esModule",{value:!0}),file.makeChunkedFile=c,file.fileInclusionProofBottomUp=o,file.fileAddressFromInclusionProof=u,file.getBmtIndexOfSegment=h;const t=requireDist(),e=chunk,n=span,a=utils$p;function c(m,v){const g=(v==null?void 0:v.maxPayloadLength)||e.DEFAULT_MAX_PAYLOAD_SIZE,$=(v==null?void 0:v.spanLength)||n.DEFAULT_SPAN_SIZE,B=()=>{const Z=[];if(m.length===0)Z.push((0,t.makeChunk)(new Uint8Array,v));else for(let ie=0;ie<m.length;ie+=g)Z.push((0,t.makeChunk)(m.slice(ie,ie+g),v));return Z};return{payload:m,span:()=>(0,t.makeSpan)(m.length,$),leafChunks:B,address:()=>b(B()).address(),rootChunk:()=>b(B()),bmt:()=>l(B())}}function o(m,v){if(v*e.SEGMENT_SIZE>=(0,t.getSpanValue)(m.span()))throw new Error(`The given segment index ${v} is greater than ${Math.floor((0,t.getSpanValue)(m.span())/e.SEGMENT_SIZE)}`);let g=m.leafChunks();const B=g[0].maxPayloadLength/e.SEGMENT_SIZE,C=Math.log2(B);let F=x(g);const H=[];for(;g.length!==1||F;){const Z=v%B;let ie=Math.floor(v/B);if(ie===g.length){if(!F)throw new Error("Impossible");v>>>=C;do{const{nextLevelChunks:R,nextLevelCarrierChunk:A}=d(g,F);g=R,F=A,v>>>=C}while(v%B===0);ie=g.length-1}const te=g[ie],ae=te.inclusionProof(Z);H.push({sisterSegments:ae,span:te.span()}),v=ie;const{nextLevelChunks:de,nextLevelCarrierChunk:J}=d(g,F);g=de,F=J}const W=g[0].inclusionProof(v);return H.push({sisterSegments:W,span:g[0].span()}),H}function u(m,v,g,$=4096){const B=Math.floor($/e.SEGMENT_SIZE),C=Math.log2(B),F=(0,t.getSpanValue)(m[m.length-1].span);let H=Math.floor((F-1)/$),W=v;for(const Z of m){const{chunkIndex:ie,level:te}=h(g,H,$);for(const ae of Z.sisterSegments)W=g%2===0?(0,a.keccak256Hash)(W,ae):(0,a.keccak256Hash)(ae,W),g=Math.floor(g/2);W=(0,a.keccak256Hash)(Z.span,W),g=ie,H>>>=C+te*C}return W}function h(m,v,g=4096){const $=Math.floor(g/e.SEGMENT_SIZE),B=Math.log2($);let C=0;if(Math.floor(m/$)===v&&v%$===0&&v!==0)for(m>>>=B;m%e.SEGMENT_SIZE===0;)C++,m>>>=B;else m>>>=B;return{chunkIndex:m,level:C}}function l(m){if(m.length===0)throw new Error("given chunk array is empty");const v=[m];let g=x(m);for(;v[v.length-1].length!==1;){const{nextLevelChunks:$,nextLevelCarrierChunk:B}=d(v[v.length-1],g);g=B,v.push($)}return v}function b(m){if(m.length===0)throw new Error("given chunk array is empty");let v=m,g=x(v);for(;v.length!==1||g;){const{nextLevelChunks:$,nextLevelCarrierChunk:B}=d(v,g);v=$,g=B}return v[0]}function d(m,v){if(m.length===0)throw new Error("The given chunk array is empty");const g=m[0].maxPayloadLength,$=m[0].spanLength,B=g/e.SEGMENT_SIZE,C=[];for(let H=0;H<m.length;H+=B){const W=m.slice(H,H+B);C.push(p(W,$,g))}let F=v;return v?C.length%B!==0&&(C.push(v),F=null):F=x(C),{nextLevelChunks:C,nextLevelCarrierChunk:F}}function p(m,v,g){const $=m.map(F=>F.address()),B=m.map(F=>(0,t.getSpanValue)(F.span())).reduce((F,H)=>F+H),C=(0,a.serializeBytes)(...$);return(0,t.makeChunk)(C,{spanLength:v,startingSpanValue:B,maxPayloadSize:g})}function x(m){if(m.length<=1)return null;const g=m[0].maxPayloadLength/e.SEGMENT_SIZE;return m.length%g===1&&m.pop()||null}return file}var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(t){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(h,l,b,d){d===void 0&&(d=b);var p=Object.getOwnPropertyDescriptor(l,b);(!p||("get"in p?!l.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return l[b]}}),Object.defineProperty(h,d,p)}:function(h,l,b,d){d===void 0&&(d=b),h[d]=l[b]}),n=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(h,l){Object.defineProperty(h,"default",{enumerable:!0,value:l})}:function(h,l){h.default=l}),a=commonjsGlobal&&commonjsGlobal.__importStar||function(h){if(h&&h.__esModule)return h;var l={};if(h!=null)for(var b in h)b!=="default"&&Object.prototype.hasOwnProperty.call(h,b)&&e(l,h,b);return n(l,h),l};Object.defineProperty(t,"__esModule",{value:!0}),t.Utils=t.getSpanValue=t.makeSpan=t.rootHashFromInclusionProof=t.makeChunk=t.getBmtIndexOfSegment=t.fileAddressFromInclusionProof=t.fileInclusionProofBottomUp=t.makeChunkedFile=void 0;var c=requireFile();Object.defineProperty(t,"makeChunkedFile",{enumerable:!0,get:function(){return c.makeChunkedFile}}),Object.defineProperty(t,"fileInclusionProofBottomUp",{enumerable:!0,get:function(){return c.fileInclusionProofBottomUp}}),Object.defineProperty(t,"fileAddressFromInclusionProof",{enumerable:!0,get:function(){return c.fileAddressFromInclusionProof}}),Object.defineProperty(t,"getBmtIndexOfSegment",{enumerable:!0,get:function(){return c.getBmtIndexOfSegment}});var o=chunk;Object.defineProperty(t,"makeChunk",{enumerable:!0,get:function(){return o.makeChunk}}),Object.defineProperty(t,"rootHashFromInclusionProof",{enumerable:!0,get:function(){return o.rootHashFromInclusionProof}});var u=span;Object.defineProperty(t,"makeSpan",{enumerable:!0,get:function(){return u.makeSpan}}),Object.defineProperty(t,"getSpanValue",{enumerable:!0,get:function(){return u.getSpanValue}}),t.Utils=a(utils$p)}(dist)),dist}var distExports=requireDist(),ws=null;typeof WebSocket<"u"?ws=WebSocket:typeof MozWebSocket<"u"?ws=MozWebSocket:typeof global$1<"u"?ws=global$1.WebSocket||global$1.MozWebSocket:typeof window<"u"?ws=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(ws=self.WebSocket||self.MozWebSocket);const WebSocket$1=ws;var elliptic={};const name="elliptic",version="6.5.7",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"},require$$0={name,version,description,main,files,scripts,repository,keywords,author,license,bugs,homepage,devDependencies,dependencies};var utils$o={},bn$1={exports:{}};const require$$1$2=getAugmentedNamespace(dist$1);bn$1.exports,function(t){(function(e,n){function a(J,R){if(!J)throw new Error(R||"Assertion failed")}function c(J,R){J.super_=R;var A=function(){};A.prototype=R.prototype,J.prototype=new A,J.prototype.constructor=J}function o(J,R,A){if(o.isBN(J))return J;this.negative=0,this.words=null,this.length=0,this.red=null,J!==null&&((R==="le"||R==="be")&&(A=R,R=10),this._init(J||0,R||10,A||"be"))}typeof e=="object"?e.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=require$$1$2.Buffer}catch{}o.isBN=function(R){return R instanceof o?!0:R!==null&&typeof R=="object"&&R.constructor.wordSize===o.wordSize&&Array.isArray(R.words)},o.max=function(R,A){return R.cmp(A)>0?R:A},o.min=function(R,A){return R.cmp(A)<0?R:A},o.prototype._init=function(R,A,y){if(typeof R=="number")return this._initNumber(R,A,y);if(typeof R=="object")return this._initArray(R,A,y);A==="hex"&&(A=16),a(A===(A|0)&&A>=2&&A<=36),R=R.toString().replace(/\s+/g,"");var w=0;R[0]==="-"&&(w++,this.negative=1),w<R.length&&(A===16?this._parseHex(R,w,y):(this._parseBase(R,A,w),y==="le"&&this._initArray(this.toArray(),A,y)))},o.prototype._initNumber=function(R,A,y){R<0&&(this.negative=1,R=-R),R<67108864?(this.words=[R&67108863],this.length=1):R<4503599627370496?(this.words=[R&67108863,R/67108864&67108863],this.length=2):(a(R<9007199254740992),this.words=[R&67108863,R/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),A,y)},o.prototype._initArray=function(R,A,y){if(a(typeof R.length=="number"),R.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(R.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var I,M,k=0;if(y==="be")for(w=R.length-1,I=0;w>=0;w-=3)M=R[w]|R[w-1]<<8|R[w-2]<<16,this.words[I]|=M<<k&67108863,this.words[I+1]=M>>>26-k&67108863,k+=24,k>=26&&(k-=26,I++);else if(y==="le")for(w=0,I=0;w<R.length;w+=3)M=R[w]|R[w+1]<<8|R[w+2]<<16,this.words[I]|=M<<k&67108863,this.words[I+1]=M>>>26-k&67108863,k+=24,k>=26&&(k-=26,I++);return this.strip()};function h(J,R){var A=J.charCodeAt(R);return A>=65&&A<=70?A-55:A>=97&&A<=102?A-87:A-48&15}function l(J,R,A){var y=h(J,A);return A-1>=R&&(y|=h(J,A-1)<<4),y}o.prototype._parseHex=function(R,A,y){this.length=Math.ceil((R.length-A)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var I=0,M=0,k;if(y==="be")for(w=R.length-1;w>=A;w-=2)k=l(R,A,w)<<I,this.words[M]|=k&67108863,I>=18?(I-=18,M+=1,this.words[M]|=k>>>26):I+=8;else{var P=R.length-A;for(w=P%2===0?A+1:A;w<R.length;w+=2)k=l(R,A,w)<<I,this.words[M]|=k&67108863,I>=18?(I-=18,M+=1,this.words[M]|=k>>>26):I+=8}this.strip()};function b(J,R,A,y){for(var w=0,I=Math.min(J.length,A),M=R;M<I;M++){var k=J.charCodeAt(M)-48;w*=y,k>=49?w+=k-49+10:k>=17?w+=k-17+10:w+=k}return w}o.prototype._parseBase=function(R,A,y){this.words=[0],this.length=1;for(var w=0,I=1;I<=67108863;I*=A)w++;w--,I=I/A|0;for(var M=R.length-y,k=M%w,P=Math.min(M,M-k)+y,_=0,q=y;q<P;q+=w)_=b(R,q,q+w,A),this.imuln(I),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_);if(k!==0){var E=1;for(_=b(R,q,R.length,A),q=0;q<k;q++)E*=A;this.imuln(E),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_)}this.strip()},o.prototype.copy=function(R){R.words=new Array(this.length);for(var A=0;A<this.length;A++)R.words[A]=this.words[A];R.length=this.length,R.negative=this.negative,R.red=this.red},o.prototype.clone=function(){var R=new o(null);return this.copy(R),R},o.prototype._expand=function(R){for(;this.length<R;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(R,A){R=R||10,A=A|0||1;var y;if(R===16||R==="hex"){y="";for(var w=0,I=0,M=0;M<this.length;M++){var k=this.words[M],P=((k<<w|I)&16777215).toString(16);I=k>>>24-w&16777215,I!==0||M!==this.length-1?y=d[6-P.length]+P+y:y=P+y,w+=2,w>=26&&(w-=26,M--)}for(I!==0&&(y=I.toString(16)+y);y.length%A!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(R===(R|0)&&R>=2&&R<=36){var _=p[R],q=x[R];y="";var E=this.clone();for(E.negative=0;!E.isZero();){var j=E.modn(q).toString(R);E=E.idivn(q),E.isZero()?y=j+y:y=d[_-j.length]+j+y}for(this.isZero()&&(y="0"+y);y.length%A!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var R=this.words[0];return this.length===2?R+=this.words[1]*67108864:this.length===3&&this.words[2]===1?R+=4503599627370496+this.words[1]*67108864:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-R:R},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(R,A){return a(typeof u<"u"),this.toArrayLike(u,R,A)},o.prototype.toArray=function(R,A){return this.toArrayLike(Array,R,A)},o.prototype.toArrayLike=function(R,A,y){var w=this.byteLength(),I=y||Math.max(1,w);a(w<=I,"byte array longer than desired length"),a(I>0,"Requested array length <= 0"),this.strip();var M=A==="le",k=new R(I),P,_,q=this.clone();if(M){for(_=0;!q.isZero();_++)P=q.andln(255),q.iushrn(8),k[_]=P;for(;_<I;_++)k[_]=0}else{for(_=0;_<I-w;_++)k[_]=0;for(_=0;!q.isZero();_++)P=q.andln(255),q.iushrn(8),k[I-_-1]=P}return k},Math.clz32?o.prototype._countBits=function(R){return 32-Math.clz32(R)}:o.prototype._countBits=function(R){var A=R,y=0;return A>=4096&&(y+=13,A>>>=13),A>=64&&(y+=7,A>>>=7),A>=8&&(y+=4,A>>>=4),A>=2&&(y+=2,A>>>=2),y+A},o.prototype._zeroBits=function(R){if(R===0)return 26;var A=R,y=0;return A&8191||(y+=13,A>>>=13),A&127||(y+=7,A>>>=7),A&15||(y+=4,A>>>=4),A&3||(y+=2,A>>>=2),A&1||y++,y},o.prototype.bitLength=function(){var R=this.words[this.length-1],A=this._countBits(R);return(this.length-1)*26+A};function m(J){for(var R=new Array(J.bitLength()),A=0;A<R.length;A++){var y=A/26|0,w=A%26;R[A]=(J.words[y]&1<<w)>>>w}return R}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var R=0,A=0;A<this.length;A++){var y=this._zeroBits(this.words[A]);if(R+=y,y!==26)break}return R},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(R){return this.negative!==0?this.abs().inotn(R).iaddn(1):this.clone()},o.prototype.fromTwos=function(R){return this.testn(R-1)?this.notn(R).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(R){for(;this.length<R.length;)this.words[this.length++]=0;for(var A=0;A<R.length;A++)this.words[A]=this.words[A]|R.words[A];return this.strip()},o.prototype.ior=function(R){return a((this.negative|R.negative)===0),this.iuor(R)},o.prototype.or=function(R){return this.length>R.length?this.clone().ior(R):R.clone().ior(this)},o.prototype.uor=function(R){return this.length>R.length?this.clone().iuor(R):R.clone().iuor(this)},o.prototype.iuand=function(R){var A;this.length>R.length?A=R:A=this;for(var y=0;y<A.length;y++)this.words[y]=this.words[y]&R.words[y];return this.length=A.length,this.strip()},o.prototype.iand=function(R){return a((this.negative|R.negative)===0),this.iuand(R)},o.prototype.and=function(R){return this.length>R.length?this.clone().iand(R):R.clone().iand(this)},o.prototype.uand=function(R){return this.length>R.length?this.clone().iuand(R):R.clone().iuand(this)},o.prototype.iuxor=function(R){var A,y;this.length>R.length?(A=this,y=R):(A=R,y=this);for(var w=0;w<y.length;w++)this.words[w]=A.words[w]^y.words[w];if(this!==A)for(;w<A.length;w++)this.words[w]=A.words[w];return this.length=A.length,this.strip()},o.prototype.ixor=function(R){return a((this.negative|R.negative)===0),this.iuxor(R)},o.prototype.xor=function(R){return this.length>R.length?this.clone().ixor(R):R.clone().ixor(this)},o.prototype.uxor=function(R){return this.length>R.length?this.clone().iuxor(R):R.clone().iuxor(this)},o.prototype.inotn=function(R){a(typeof R=="number"&&R>=0);var A=Math.ceil(R/26)|0,y=R%26;this._expand(A),y>0&&A--;for(var w=0;w<A;w++)this.words[w]=~this.words[w]&67108863;return y>0&&(this.words[w]=~this.words[w]&67108863>>26-y),this.strip()},o.prototype.notn=function(R){return this.clone().inotn(R)},o.prototype.setn=function(R,A){a(typeof R=="number"&&R>=0);var y=R/26|0,w=R%26;return this._expand(y+1),A?this.words[y]=this.words[y]|1<<w:this.words[y]=this.words[y]&~(1<<w),this.strip()},o.prototype.iadd=function(R){var A;if(this.negative!==0&&R.negative===0)return this.negative=0,A=this.isub(R),this.negative^=1,this._normSign();if(this.negative===0&&R.negative!==0)return R.negative=0,A=this.isub(R),R.negative=1,A._normSign();var y,w;this.length>R.length?(y=this,w=R):(y=R,w=this);for(var I=0,M=0;M<w.length;M++)A=(y.words[M]|0)+(w.words[M]|0)+I,this.words[M]=A&67108863,I=A>>>26;for(;I!==0&&M<y.length;M++)A=(y.words[M]|0)+I,this.words[M]=A&67108863,I=A>>>26;if(this.length=y.length,I!==0)this.words[this.length]=I,this.length++;else if(y!==this)for(;M<y.length;M++)this.words[M]=y.words[M];return this},o.prototype.add=function(R){var A;return R.negative!==0&&this.negative===0?(R.negative=0,A=this.sub(R),R.negative^=1,A):R.negative===0&&this.negative!==0?(this.negative=0,A=R.sub(this),this.negative=1,A):this.length>R.length?this.clone().iadd(R):R.clone().iadd(this)},o.prototype.isub=function(R){if(R.negative!==0){R.negative=0;var A=this.iadd(R);return R.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(R),this.negative=1,this._normSign();var y=this.cmp(R);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,I;y>0?(w=this,I=R):(w=R,I=this);for(var M=0,k=0;k<I.length;k++)A=(w.words[k]|0)-(I.words[k]|0)+M,M=A>>26,this.words[k]=A&67108863;for(;M!==0&&k<w.length;k++)A=(w.words[k]|0)+M,M=A>>26,this.words[k]=A&67108863;if(M===0&&k<w.length&&w!==this)for(;k<w.length;k++)this.words[k]=w.words[k];return this.length=Math.max(this.length,k),w!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(R){return this.clone().isub(R)};function v(J,R,A){A.negative=R.negative^J.negative;var y=J.length+R.length|0;A.length=y,y=y-1|0;var w=J.words[0]|0,I=R.words[0]|0,M=w*I,k=M&67108863,P=M/67108864|0;A.words[0]=k;for(var _=1;_<y;_++){for(var q=P>>>26,E=P&67108863,j=Math.min(_,R.length-1),ee=Math.max(0,_-J.length+1);ee<=j;ee++){var oe=_-ee|0;w=J.words[oe]|0,I=R.words[ee]|0,M=w*I+E,q+=M/67108864|0,E=M&67108863}A.words[_]=E|0,P=q|0}return P!==0?A.words[_]=P|0:A.length--,A.strip()}var g=function(R,A,y){var w=R.words,I=A.words,M=y.words,k=0,P,_,q,E=w[0]|0,j=E&8191,ee=E>>>13,oe=w[1]|0,Y=oe&8191,L=oe>>>13,z=w[2]|0,re=z&8191,D=z>>>13,G=w[3]|0,U=G&8191,Q=G>>>13,fe=w[4]|0,he=fe&8191,le=fe>>>13,pe=w[5]|0,be=pe&8191,se=pe>>>13,ge=w[6]|0,ye=ge&8191,$e=ge>>>13,Ne=w[7]|0,ve=Ne&8191,Be=Ne>>>13,De=w[8]|0,Se=De&8191,Oe=De>>>13,je=w[9]|0,V=je&8191,T=je>>>13,O=I[0]|0,X=O&8191,ne=O>>>13,ce=I[1]|0,ue=ce&8191,me=ce>>>13,Ee=I[2]|0,xe=Ee&8191,Ae=Ee>>>13,_e=I[3]|0,Me=_e&8191,ze=_e>>>13,Ve=I[4]|0,Ie=Ve&8191,We=Ve>>>13,Je=I[5]|0,Pe=Je&8191,Ze=Je>>>13,Xe=I[6]|0,Te=Xe&8191,Ye=Xe>>>13,Qe=I[7]|0,ke=Qe&8191,et=Qe>>>13,tt=I[8]|0,qe=tt&8191,rt=tt>>>13,it=I[9]|0,Ce=it&8191,nt=it>>>13;y.negative=R.negative^A.negative,y.length=19,P=Math.imul(j,X),_=Math.imul(j,ne),_=_+Math.imul(ee,X)|0,q=Math.imul(ee,ne);var Ge=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,P=Math.imul(Y,X),_=Math.imul(Y,ne),_=_+Math.imul(L,X)|0,q=Math.imul(L,ne),P=P+Math.imul(j,ue)|0,_=_+Math.imul(j,me)|0,_=_+Math.imul(ee,ue)|0,q=q+Math.imul(ee,me)|0;var Ke=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,P=Math.imul(re,X),_=Math.imul(re,ne),_=_+Math.imul(D,X)|0,q=Math.imul(D,ne),P=P+Math.imul(Y,ue)|0,_=_+Math.imul(Y,me)|0,_=_+Math.imul(L,ue)|0,q=q+Math.imul(L,me)|0,P=P+Math.imul(j,xe)|0,_=_+Math.imul(j,Ae)|0,_=_+Math.imul(ee,xe)|0,q=q+Math.imul(ee,Ae)|0;var ct=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(ct>>>26)|0,ct&=67108863,P=Math.imul(U,X),_=Math.imul(U,ne),_=_+Math.imul(Q,X)|0,q=Math.imul(Q,ne),P=P+Math.imul(re,ue)|0,_=_+Math.imul(re,me)|0,_=_+Math.imul(D,ue)|0,q=q+Math.imul(D,me)|0,P=P+Math.imul(Y,xe)|0,_=_+Math.imul(Y,Ae)|0,_=_+Math.imul(L,xe)|0,q=q+Math.imul(L,Ae)|0,P=P+Math.imul(j,Me)|0,_=_+Math.imul(j,ze)|0,_=_+Math.imul(ee,Me)|0,q=q+Math.imul(ee,ze)|0;var dt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(dt>>>26)|0,dt&=67108863,P=Math.imul(he,X),_=Math.imul(he,ne),_=_+Math.imul(le,X)|0,q=Math.imul(le,ne),P=P+Math.imul(U,ue)|0,_=_+Math.imul(U,me)|0,_=_+Math.imul(Q,ue)|0,q=q+Math.imul(Q,me)|0,P=P+Math.imul(re,xe)|0,_=_+Math.imul(re,Ae)|0,_=_+Math.imul(D,xe)|0,q=q+Math.imul(D,Ae)|0,P=P+Math.imul(Y,Me)|0,_=_+Math.imul(Y,ze)|0,_=_+Math.imul(L,Me)|0,q=q+Math.imul(L,ze)|0,P=P+Math.imul(j,Ie)|0,_=_+Math.imul(j,We)|0,_=_+Math.imul(ee,Ie)|0,q=q+Math.imul(ee,We)|0;var ht=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(ht>>>26)|0,ht&=67108863,P=Math.imul(be,X),_=Math.imul(be,ne),_=_+Math.imul(se,X)|0,q=Math.imul(se,ne),P=P+Math.imul(he,ue)|0,_=_+Math.imul(he,me)|0,_=_+Math.imul(le,ue)|0,q=q+Math.imul(le,me)|0,P=P+Math.imul(U,xe)|0,_=_+Math.imul(U,Ae)|0,_=_+Math.imul(Q,xe)|0,q=q+Math.imul(Q,Ae)|0,P=P+Math.imul(re,Me)|0,_=_+Math.imul(re,ze)|0,_=_+Math.imul(D,Me)|0,q=q+Math.imul(D,ze)|0,P=P+Math.imul(Y,Ie)|0,_=_+Math.imul(Y,We)|0,_=_+Math.imul(L,Ie)|0,q=q+Math.imul(L,We)|0,P=P+Math.imul(j,Pe)|0,_=_+Math.imul(j,Ze)|0,_=_+Math.imul(ee,Pe)|0,q=q+Math.imul(ee,Ze)|0;var lt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(lt>>>26)|0,lt&=67108863,P=Math.imul(ye,X),_=Math.imul(ye,ne),_=_+Math.imul($e,X)|0,q=Math.imul($e,ne),P=P+Math.imul(be,ue)|0,_=_+Math.imul(be,me)|0,_=_+Math.imul(se,ue)|0,q=q+Math.imul(se,me)|0,P=P+Math.imul(he,xe)|0,_=_+Math.imul(he,Ae)|0,_=_+Math.imul(le,xe)|0,q=q+Math.imul(le,Ae)|0,P=P+Math.imul(U,Me)|0,_=_+Math.imul(U,ze)|0,_=_+Math.imul(Q,Me)|0,q=q+Math.imul(Q,ze)|0,P=P+Math.imul(re,Ie)|0,_=_+Math.imul(re,We)|0,_=_+Math.imul(D,Ie)|0,q=q+Math.imul(D,We)|0,P=P+Math.imul(Y,Pe)|0,_=_+Math.imul(Y,Ze)|0,_=_+Math.imul(L,Pe)|0,q=q+Math.imul(L,Ze)|0,P=P+Math.imul(j,Te)|0,_=_+Math.imul(j,Ye)|0,_=_+Math.imul(ee,Te)|0,q=q+Math.imul(ee,Ye)|0;var pt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(pt>>>26)|0,pt&=67108863,P=Math.imul(ve,X),_=Math.imul(ve,ne),_=_+Math.imul(Be,X)|0,q=Math.imul(Be,ne),P=P+Math.imul(ye,ue)|0,_=_+Math.imul(ye,me)|0,_=_+Math.imul($e,ue)|0,q=q+Math.imul($e,me)|0,P=P+Math.imul(be,xe)|0,_=_+Math.imul(be,Ae)|0,_=_+Math.imul(se,xe)|0,q=q+Math.imul(se,Ae)|0,P=P+Math.imul(he,Me)|0,_=_+Math.imul(he,ze)|0,_=_+Math.imul(le,Me)|0,q=q+Math.imul(le,ze)|0,P=P+Math.imul(U,Ie)|0,_=_+Math.imul(U,We)|0,_=_+Math.imul(Q,Ie)|0,q=q+Math.imul(Q,We)|0,P=P+Math.imul(re,Pe)|0,_=_+Math.imul(re,Ze)|0,_=_+Math.imul(D,Pe)|0,q=q+Math.imul(D,Ze)|0,P=P+Math.imul(Y,Te)|0,_=_+Math.imul(Y,Ye)|0,_=_+Math.imul(L,Te)|0,q=q+Math.imul(L,Ye)|0,P=P+Math.imul(j,ke)|0,_=_+Math.imul(j,et)|0,_=_+Math.imul(ee,ke)|0,q=q+Math.imul(ee,et)|0;var bt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(bt>>>26)|0,bt&=67108863,P=Math.imul(Se,X),_=Math.imul(Se,ne),_=_+Math.imul(Oe,X)|0,q=Math.imul(Oe,ne),P=P+Math.imul(ve,ue)|0,_=_+Math.imul(ve,me)|0,_=_+Math.imul(Be,ue)|0,q=q+Math.imul(Be,me)|0,P=P+Math.imul(ye,xe)|0,_=_+Math.imul(ye,Ae)|0,_=_+Math.imul($e,xe)|0,q=q+Math.imul($e,Ae)|0,P=P+Math.imul(be,Me)|0,_=_+Math.imul(be,ze)|0,_=_+Math.imul(se,Me)|0,q=q+Math.imul(se,ze)|0,P=P+Math.imul(he,Ie)|0,_=_+Math.imul(he,We)|0,_=_+Math.imul(le,Ie)|0,q=q+Math.imul(le,We)|0,P=P+Math.imul(U,Pe)|0,_=_+Math.imul(U,Ze)|0,_=_+Math.imul(Q,Pe)|0,q=q+Math.imul(Q,Ze)|0,P=P+Math.imul(re,Te)|0,_=_+Math.imul(re,Ye)|0,_=_+Math.imul(D,Te)|0,q=q+Math.imul(D,Ye)|0,P=P+Math.imul(Y,ke)|0,_=_+Math.imul(Y,et)|0,_=_+Math.imul(L,ke)|0,q=q+Math.imul(L,et)|0,P=P+Math.imul(j,qe)|0,_=_+Math.imul(j,rt)|0,_=_+Math.imul(ee,qe)|0,q=q+Math.imul(ee,rt)|0;var xt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(xt>>>26)|0,xt&=67108863,P=Math.imul(V,X),_=Math.imul(V,ne),_=_+Math.imul(T,X)|0,q=Math.imul(T,ne),P=P+Math.imul(Se,ue)|0,_=_+Math.imul(Se,me)|0,_=_+Math.imul(Oe,ue)|0,q=q+Math.imul(Oe,me)|0,P=P+Math.imul(ve,xe)|0,_=_+Math.imul(ve,Ae)|0,_=_+Math.imul(Be,xe)|0,q=q+Math.imul(Be,Ae)|0,P=P+Math.imul(ye,Me)|0,_=_+Math.imul(ye,ze)|0,_=_+Math.imul($e,Me)|0,q=q+Math.imul($e,ze)|0,P=P+Math.imul(be,Ie)|0,_=_+Math.imul(be,We)|0,_=_+Math.imul(se,Ie)|0,q=q+Math.imul(se,We)|0,P=P+Math.imul(he,Pe)|0,_=_+Math.imul(he,Ze)|0,_=_+Math.imul(le,Pe)|0,q=q+Math.imul(le,Ze)|0,P=P+Math.imul(U,Te)|0,_=_+Math.imul(U,Ye)|0,_=_+Math.imul(Q,Te)|0,q=q+Math.imul(Q,Ye)|0,P=P+Math.imul(re,ke)|0,_=_+Math.imul(re,et)|0,_=_+Math.imul(D,ke)|0,q=q+Math.imul(D,et)|0,P=P+Math.imul(Y,qe)|0,_=_+Math.imul(Y,rt)|0,_=_+Math.imul(L,qe)|0,q=q+Math.imul(L,rt)|0,P=P+Math.imul(j,Ce)|0,_=_+Math.imul(j,nt)|0,_=_+Math.imul(ee,Ce)|0,q=q+Math.imul(ee,nt)|0;var yt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(yt>>>26)|0,yt&=67108863,P=Math.imul(V,ue),_=Math.imul(V,me),_=_+Math.imul(T,ue)|0,q=Math.imul(T,me),P=P+Math.imul(Se,xe)|0,_=_+Math.imul(Se,Ae)|0,_=_+Math.imul(Oe,xe)|0,q=q+Math.imul(Oe,Ae)|0,P=P+Math.imul(ve,Me)|0,_=_+Math.imul(ve,ze)|0,_=_+Math.imul(Be,Me)|0,q=q+Math.imul(Be,ze)|0,P=P+Math.imul(ye,Ie)|0,_=_+Math.imul(ye,We)|0,_=_+Math.imul($e,Ie)|0,q=q+Math.imul($e,We)|0,P=P+Math.imul(be,Pe)|0,_=_+Math.imul(be,Ze)|0,_=_+Math.imul(se,Pe)|0,q=q+Math.imul(se,Ze)|0,P=P+Math.imul(he,Te)|0,_=_+Math.imul(he,Ye)|0,_=_+Math.imul(le,Te)|0,q=q+Math.imul(le,Ye)|0,P=P+Math.imul(U,ke)|0,_=_+Math.imul(U,et)|0,_=_+Math.imul(Q,ke)|0,q=q+Math.imul(Q,et)|0,P=P+Math.imul(re,qe)|0,_=_+Math.imul(re,rt)|0,_=_+Math.imul(D,qe)|0,q=q+Math.imul(D,rt)|0,P=P+Math.imul(Y,Ce)|0,_=_+Math.imul(Y,nt)|0,_=_+Math.imul(L,Ce)|0,q=q+Math.imul(L,nt)|0;var mt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(mt>>>26)|0,mt&=67108863,P=Math.imul(V,xe),_=Math.imul(V,Ae),_=_+Math.imul(T,xe)|0,q=Math.imul(T,Ae),P=P+Math.imul(Se,Me)|0,_=_+Math.imul(Se,ze)|0,_=_+Math.imul(Oe,Me)|0,q=q+Math.imul(Oe,ze)|0,P=P+Math.imul(ve,Ie)|0,_=_+Math.imul(ve,We)|0,_=_+Math.imul(Be,Ie)|0,q=q+Math.imul(Be,We)|0,P=P+Math.imul(ye,Pe)|0,_=_+Math.imul(ye,Ze)|0,_=_+Math.imul($e,Pe)|0,q=q+Math.imul($e,Ze)|0,P=P+Math.imul(be,Te)|0,_=_+Math.imul(be,Ye)|0,_=_+Math.imul(se,Te)|0,q=q+Math.imul(se,Ye)|0,P=P+Math.imul(he,ke)|0,_=_+Math.imul(he,et)|0,_=_+Math.imul(le,ke)|0,q=q+Math.imul(le,et)|0,P=P+Math.imul(U,qe)|0,_=_+Math.imul(U,rt)|0,_=_+Math.imul(Q,qe)|0,q=q+Math.imul(Q,rt)|0,P=P+Math.imul(re,Ce)|0,_=_+Math.imul(re,nt)|0,_=_+Math.imul(D,Ce)|0,q=q+Math.imul(D,nt)|0;var vt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(vt>>>26)|0,vt&=67108863,P=Math.imul(V,Me),_=Math.imul(V,ze),_=_+Math.imul(T,Me)|0,q=Math.imul(T,ze),P=P+Math.imul(Se,Ie)|0,_=_+Math.imul(Se,We)|0,_=_+Math.imul(Oe,Ie)|0,q=q+Math.imul(Oe,We)|0,P=P+Math.imul(ve,Pe)|0,_=_+Math.imul(ve,Ze)|0,_=_+Math.imul(Be,Pe)|0,q=q+Math.imul(Be,Ze)|0,P=P+Math.imul(ye,Te)|0,_=_+Math.imul(ye,Ye)|0,_=_+Math.imul($e,Te)|0,q=q+Math.imul($e,Ye)|0,P=P+Math.imul(be,ke)|0,_=_+Math.imul(be,et)|0,_=_+Math.imul(se,ke)|0,q=q+Math.imul(se,et)|0,P=P+Math.imul(he,qe)|0,_=_+Math.imul(he,rt)|0,_=_+Math.imul(le,qe)|0,q=q+Math.imul(le,rt)|0,P=P+Math.imul(U,Ce)|0,_=_+Math.imul(U,nt)|0,_=_+Math.imul(Q,Ce)|0,q=q+Math.imul(Q,nt)|0;var qt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(qt>>>26)|0,qt&=67108863,P=Math.imul(V,Ie),_=Math.imul(V,We),_=_+Math.imul(T,Ie)|0,q=Math.imul(T,We),P=P+Math.imul(Se,Pe)|0,_=_+Math.imul(Se,Ze)|0,_=_+Math.imul(Oe,Pe)|0,q=q+Math.imul(Oe,Ze)|0,P=P+Math.imul(ve,Te)|0,_=_+Math.imul(ve,Ye)|0,_=_+Math.imul(Be,Te)|0,q=q+Math.imul(Be,Ye)|0,P=P+Math.imul(ye,ke)|0,_=_+Math.imul(ye,et)|0,_=_+Math.imul($e,ke)|0,q=q+Math.imul($e,et)|0,P=P+Math.imul(be,qe)|0,_=_+Math.imul(be,rt)|0,_=_+Math.imul(se,qe)|0,q=q+Math.imul(se,rt)|0,P=P+Math.imul(he,Ce)|0,_=_+Math.imul(he,nt)|0,_=_+Math.imul(le,Ce)|0,q=q+Math.imul(le,nt)|0;var Ct=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,P=Math.imul(V,Pe),_=Math.imul(V,Ze),_=_+Math.imul(T,Pe)|0,q=Math.imul(T,Ze),P=P+Math.imul(Se,Te)|0,_=_+Math.imul(Se,Ye)|0,_=_+Math.imul(Oe,Te)|0,q=q+Math.imul(Oe,Ye)|0,P=P+Math.imul(ve,ke)|0,_=_+Math.imul(ve,et)|0,_=_+Math.imul(Be,ke)|0,q=q+Math.imul(Be,et)|0,P=P+Math.imul(ye,qe)|0,_=_+Math.imul(ye,rt)|0,_=_+Math.imul($e,qe)|0,q=q+Math.imul($e,rt)|0,P=P+Math.imul(be,Ce)|0,_=_+Math.imul(be,nt)|0,_=_+Math.imul(se,Ce)|0,q=q+Math.imul(se,nt)|0;var Nt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,P=Math.imul(V,Te),_=Math.imul(V,Ye),_=_+Math.imul(T,Te)|0,q=Math.imul(T,Ye),P=P+Math.imul(Se,ke)|0,_=_+Math.imul(Se,et)|0,_=_+Math.imul(Oe,ke)|0,q=q+Math.imul(Oe,et)|0,P=P+Math.imul(ve,qe)|0,_=_+Math.imul(ve,rt)|0,_=_+Math.imul(Be,qe)|0,q=q+Math.imul(Be,rt)|0,P=P+Math.imul(ye,Ce)|0,_=_+Math.imul(ye,nt)|0,_=_+Math.imul($e,Ce)|0,q=q+Math.imul($e,nt)|0;var Ot=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,P=Math.imul(V,ke),_=Math.imul(V,et),_=_+Math.imul(T,ke)|0,q=Math.imul(T,et),P=P+Math.imul(Se,qe)|0,_=_+Math.imul(Se,rt)|0,_=_+Math.imul(Oe,qe)|0,q=q+Math.imul(Oe,rt)|0,P=P+Math.imul(ve,Ce)|0,_=_+Math.imul(ve,nt)|0,_=_+Math.imul(Be,Ce)|0,q=q+Math.imul(Be,nt)|0;var Dt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,P=Math.imul(V,qe),_=Math.imul(V,rt),_=_+Math.imul(T,qe)|0,q=Math.imul(T,rt),P=P+Math.imul(Se,Ce)|0,_=_+Math.imul(Se,nt)|0,_=_+Math.imul(Oe,Ce)|0,q=q+Math.imul(Oe,nt)|0;var Lt=(k+P|0)+((_&8191)<<13)|0;k=(q+(_>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,P=Math.imul(V,Ce),_=Math.imul(V,nt),_=_+Math.imul(T,Ce)|0,q=Math.imul(T,nt);var Ft=(k+P|0)+((_&8191)<<13)|0;return k=(q+(_>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,M[0]=Ge,M[1]=Ke,M[2]=ct,M[3]=dt,M[4]=ht,M[5]=lt,M[6]=pt,M[7]=bt,M[8]=xt,M[9]=yt,M[10]=mt,M[11]=vt,M[12]=qt,M[13]=Ct,M[14]=Nt,M[15]=Ot,M[16]=Dt,M[17]=Lt,M[18]=Ft,k!==0&&(M[19]=k,y.length++),y};Math.imul||(g=v);function $(J,R,A){A.negative=R.negative^J.negative,A.length=J.length+R.length;for(var y=0,w=0,I=0;I<A.length-1;I++){var M=w;w=0;for(var k=y&67108863,P=Math.min(I,R.length-1),_=Math.max(0,I-J.length+1);_<=P;_++){var q=I-_,E=J.words[q]|0,j=R.words[_]|0,ee=E*j,oe=ee&67108863;M=M+(ee/67108864|0)|0,oe=oe+k|0,k=oe&67108863,M=M+(oe>>>26)|0,w+=M>>>26,M&=67108863}A.words[I]=k,y=M,M=w}return y!==0?A.words[I]=y:A.length--,A.strip()}function B(J,R,A){var y=new C;return y.mulp(J,R,A)}o.prototype.mulTo=function(R,A){var y,w=this.length+R.length;return this.length===10&&R.length===10?y=g(this,R,A):w<63?y=v(this,R,A):w<1024?y=$(this,R,A):y=B(this,R,A),y};function C(J,R){this.x=J,this.y=R}C.prototype.makeRBT=function(R){for(var A=new Array(R),y=o.prototype._countBits(R)-1,w=0;w<R;w++)A[w]=this.revBin(w,y,R);return A},C.prototype.revBin=function(R,A,y){if(R===0||R===y-1)return R;for(var w=0,I=0;I<A;I++)w|=(R&1)<<A-I-1,R>>=1;return w},C.prototype.permute=function(R,A,y,w,I,M){for(var k=0;k<M;k++)w[k]=A[R[k]],I[k]=y[R[k]]},C.prototype.transform=function(R,A,y,w,I,M){this.permute(M,R,A,y,w,I);for(var k=1;k<I;k<<=1)for(var P=k<<1,_=Math.cos(2*Math.PI/P),q=Math.sin(2*Math.PI/P),E=0;E<I;E+=P)for(var j=_,ee=q,oe=0;oe<k;oe++){var Y=y[E+oe],L=w[E+oe],z=y[E+oe+k],re=w[E+oe+k],D=j*z-ee*re;re=j*re+ee*z,z=D,y[E+oe]=Y+z,w[E+oe]=L+re,y[E+oe+k]=Y-z,w[E+oe+k]=L-re,oe!==P&&(D=_*j-q*ee,ee=_*ee+q*j,j=D)}},C.prototype.guessLen13b=function(R,A){var y=Math.max(A,R)|1,w=y&1,I=0;for(y=y/2|0;y;y=y>>>1)I++;return 1<<I+1+w},C.prototype.conjugate=function(R,A,y){if(!(y<=1))for(var w=0;w<y/2;w++){var I=R[w];R[w]=R[y-w-1],R[y-w-1]=I,I=A[w],A[w]=-A[y-w-1],A[y-w-1]=-I}},C.prototype.normalize13b=function(R,A){for(var y=0,w=0;w<A/2;w++){var I=Math.round(R[2*w+1]/A)*8192+Math.round(R[2*w]/A)+y;R[w]=I&67108863,I<67108864?y=0:y=I/67108864|0}return R},C.prototype.convert13b=function(R,A,y,w){for(var I=0,M=0;M<A;M++)I=I+(R[M]|0),y[2*M]=I&8191,I=I>>>13,y[2*M+1]=I&8191,I=I>>>13;for(M=2*A;M<w;++M)y[M]=0;a(I===0),a((I&-8192)===0)},C.prototype.stub=function(R){for(var A=new Array(R),y=0;y<R;y++)A[y]=0;return A},C.prototype.mulp=function(R,A,y){var w=2*this.guessLen13b(R.length,A.length),I=this.makeRBT(w),M=this.stub(w),k=new Array(w),P=new Array(w),_=new Array(w),q=new Array(w),E=new Array(w),j=new Array(w),ee=y.words;ee.length=w,this.convert13b(R.words,R.length,k,w),this.convert13b(A.words,A.length,q,w),this.transform(k,M,P,_,w,I),this.transform(q,M,E,j,w,I);for(var oe=0;oe<w;oe++){var Y=P[oe]*E[oe]-_[oe]*j[oe];_[oe]=P[oe]*j[oe]+_[oe]*E[oe],P[oe]=Y}return this.conjugate(P,_,w),this.transform(P,_,ee,M,w,I),this.conjugate(ee,M,w),this.normalize13b(ee,w),y.negative=R.negative^A.negative,y.length=R.length+A.length,y.strip()},o.prototype.mul=function(R){var A=new o(null);return A.words=new Array(this.length+R.length),this.mulTo(R,A)},o.prototype.mulf=function(R){var A=new o(null);return A.words=new Array(this.length+R.length),B(this,R,A)},o.prototype.imul=function(R){return this.clone().mulTo(R,this)},o.prototype.imuln=function(R){a(typeof R=="number"),a(R<67108864);for(var A=0,y=0;y<this.length;y++){var w=(this.words[y]|0)*R,I=(w&67108863)+(A&67108863);A>>=26,A+=w/67108864|0,A+=I>>>26,this.words[y]=I&67108863}return A!==0&&(this.words[y]=A,this.length++),this},o.prototype.muln=function(R){return this.clone().imuln(R)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(R){var A=m(R);if(A.length===0)return new o(1);for(var y=this,w=0;w<A.length&&A[w]===0;w++,y=y.sqr());if(++w<A.length)for(var I=y.sqr();w<A.length;w++,I=I.sqr())A[w]!==0&&(y=y.mul(I));return y},o.prototype.iushln=function(R){a(typeof R=="number"&&R>=0);var A=R%26,y=(R-A)/26,w=67108863>>>26-A<<26-A,I;if(A!==0){var M=0;for(I=0;I<this.length;I++){var k=this.words[I]&w,P=(this.words[I]|0)-k<<A;this.words[I]=P|M,M=k>>>26-A}M&&(this.words[I]=M,this.length++)}if(y!==0){for(I=this.length-1;I>=0;I--)this.words[I+y]=this.words[I];for(I=0;I<y;I++)this.words[I]=0;this.length+=y}return this.strip()},o.prototype.ishln=function(R){return a(this.negative===0),this.iushln(R)},o.prototype.iushrn=function(R,A,y){a(typeof R=="number"&&R>=0);var w;A?w=(A-A%26)/26:w=0;var I=R%26,M=Math.min((R-I)/26,this.length),k=67108863^67108863>>>I<<I,P=y;if(w-=M,w=Math.max(0,w),P){for(var _=0;_<M;_++)P.words[_]=this.words[_];P.length=M}if(M!==0)if(this.length>M)for(this.length-=M,_=0;_<this.length;_++)this.words[_]=this.words[_+M];else this.words[0]=0,this.length=1;var q=0;for(_=this.length-1;_>=0&&(q!==0||_>=w);_--){var E=this.words[_]|0;this.words[_]=q<<26-I|E>>>I,q=E&k}return P&&q!==0&&(P.words[P.length++]=q),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(R,A,y){return a(this.negative===0),this.iushrn(R,A,y)},o.prototype.shln=function(R){return this.clone().ishln(R)},o.prototype.ushln=function(R){return this.clone().iushln(R)},o.prototype.shrn=function(R){return this.clone().ishrn(R)},o.prototype.ushrn=function(R){return this.clone().iushrn(R)},o.prototype.testn=function(R){a(typeof R=="number"&&R>=0);var A=R%26,y=(R-A)/26,w=1<<A;if(this.length<=y)return!1;var I=this.words[y];return!!(I&w)},o.prototype.imaskn=function(R){a(typeof R=="number"&&R>=0);var A=R%26,y=(R-A)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(A!==0&&y++,this.length=Math.min(y,this.length),A!==0){var w=67108863^67108863>>>A<<A;this.words[this.length-1]&=w}return this.strip()},o.prototype.maskn=function(R){return this.clone().imaskn(R)},o.prototype.iaddn=function(R){return a(typeof R=="number"),a(R<67108864),R<0?this.isubn(-R):this.negative!==0?this.length===1&&(this.words[0]|0)<R?(this.words[0]=R-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(R),this.negative=1,this):this._iaddn(R)},o.prototype._iaddn=function(R){this.words[0]+=R;for(var A=0;A<this.length&&this.words[A]>=67108864;A++)this.words[A]-=67108864,A===this.length-1?this.words[A+1]=1:this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},o.prototype.isubn=function(R){if(a(typeof R=="number"),a(R<67108864),R<0)return this.iaddn(-R);if(this.negative!==0)return this.negative=0,this.iaddn(R),this.negative=1,this;if(this.words[0]-=R,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A<this.length&&this.words[A]<0;A++)this.words[A]+=67108864,this.words[A+1]-=1;return this.strip()},o.prototype.addn=function(R){return this.clone().iaddn(R)},o.prototype.subn=function(R){return this.clone().isubn(R)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(R,A,y){var w=R.length+y,I;this._expand(w);var M,k=0;for(I=0;I<R.length;I++){M=(this.words[I+y]|0)+k;var P=(R.words[I]|0)*A;M-=P&67108863,k=(M>>26)-(P/67108864|0),this.words[I+y]=M&67108863}for(;I<this.length-y;I++)M=(this.words[I+y]|0)+k,k=M>>26,this.words[I+y]=M&67108863;if(k===0)return this.strip();for(a(k===-1),k=0,I=0;I<this.length;I++)M=-(this.words[I]|0)+k,k=M>>26,this.words[I]=M&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(R,A){var y=this.length-R.length,w=this.clone(),I=R,M=I.words[I.length-1]|0,k=this._countBits(M);y=26-k,y!==0&&(I=I.ushln(y),w.iushln(y),M=I.words[I.length-1]|0);var P=w.length-I.length,_;if(A!=="mod"){_=new o(null),_.length=P+1,_.words=new Array(_.length);for(var q=0;q<_.length;q++)_.words[q]=0}var E=w.clone()._ishlnsubmul(I,1,P);E.negative===0&&(w=E,_&&(_.words[P]=1));for(var j=P-1;j>=0;j--){var ee=(w.words[I.length+j]|0)*67108864+(w.words[I.length+j-1]|0);for(ee=Math.min(ee/M|0,67108863),w._ishlnsubmul(I,ee,j);w.negative!==0;)ee--,w.negative=0,w._ishlnsubmul(I,1,j),w.isZero()||(w.negative^=1);_&&(_.words[j]=ee)}return _&&_.strip(),w.strip(),A!=="div"&&y!==0&&w.iushrn(y),{div:_||null,mod:w}},o.prototype.divmod=function(R,A,y){if(a(!R.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var w,I,M;return this.negative!==0&&R.negative===0?(M=this.neg().divmod(R,A),A!=="mod"&&(w=M.div.neg()),A!=="div"&&(I=M.mod.neg(),y&&I.negative!==0&&I.iadd(R)),{div:w,mod:I}):this.negative===0&&R.negative!==0?(M=this.divmod(R.neg(),A),A!=="mod"&&(w=M.div.neg()),{div:w,mod:M.mod}):this.negative&R.negative?(M=this.neg().divmod(R.neg(),A),A!=="div"&&(I=M.mod.neg(),y&&I.negative!==0&&I.isub(R)),{div:M.div,mod:I}):R.length>this.length||this.cmp(R)<0?{div:new o(0),mod:this}:R.length===1?A==="div"?{div:this.divn(R.words[0]),mod:null}:A==="mod"?{div:null,mod:new o(this.modn(R.words[0]))}:{div:this.divn(R.words[0]),mod:new o(this.modn(R.words[0]))}:this._wordDiv(R,A)},o.prototype.div=function(R){return this.divmod(R,"div",!1).div},o.prototype.mod=function(R){return this.divmod(R,"mod",!1).mod},o.prototype.umod=function(R){return this.divmod(R,"mod",!0).mod},o.prototype.divRound=function(R){var A=this.divmod(R);if(A.mod.isZero())return A.div;var y=A.div.negative!==0?A.mod.isub(R):A.mod,w=R.ushrn(1),I=R.andln(1),M=y.cmp(w);return M<0||I===1&&M===0?A.div:A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},o.prototype.modn=function(R){a(R<=67108863);for(var A=(1<<26)%R,y=0,w=this.length-1;w>=0;w--)y=(A*y+(this.words[w]|0))%R;return y},o.prototype.idivn=function(R){a(R<=67108863);for(var A=0,y=this.length-1;y>=0;y--){var w=(this.words[y]|0)+A*67108864;this.words[y]=w/R|0,A=w%R}return this.strip()},o.prototype.divn=function(R){return this.clone().idivn(R)},o.prototype.egcd=function(R){a(R.negative===0),a(!R.isZero());var A=this,y=R.clone();A.negative!==0?A=A.umod(R):A=A.clone();for(var w=new o(1),I=new o(0),M=new o(0),k=new o(1),P=0;A.isEven()&&y.isEven();)A.iushrn(1),y.iushrn(1),++P;for(var _=y.clone(),q=A.clone();!A.isZero();){for(var E=0,j=1;!(A.words[0]&j)&&E<26;++E,j<<=1);if(E>0)for(A.iushrn(E);E-- >0;)(w.isOdd()||I.isOdd())&&(w.iadd(_),I.isub(q)),w.iushrn(1),I.iushrn(1);for(var ee=0,oe=1;!(y.words[0]&oe)&&ee<26;++ee,oe<<=1);if(ee>0)for(y.iushrn(ee);ee-- >0;)(M.isOdd()||k.isOdd())&&(M.iadd(_),k.isub(q)),M.iushrn(1),k.iushrn(1);A.cmp(y)>=0?(A.isub(y),w.isub(M),I.isub(k)):(y.isub(A),M.isub(w),k.isub(I))}return{a:M,b:k,gcd:y.iushln(P)}},o.prototype._invmp=function(R){a(R.negative===0),a(!R.isZero());var A=this,y=R.clone();A.negative!==0?A=A.umod(R):A=A.clone();for(var w=new o(1),I=new o(0),M=y.clone();A.cmpn(1)>0&&y.cmpn(1)>0;){for(var k=0,P=1;!(A.words[0]&P)&&k<26;++k,P<<=1);if(k>0)for(A.iushrn(k);k-- >0;)w.isOdd()&&w.iadd(M),w.iushrn(1);for(var _=0,q=1;!(y.words[0]&q)&&_<26;++_,q<<=1);if(_>0)for(y.iushrn(_);_-- >0;)I.isOdd()&&I.iadd(M),I.iushrn(1);A.cmp(y)>=0?(A.isub(y),w.isub(I)):(y.isub(A),I.isub(w))}var E;return A.cmpn(1)===0?E=w:E=I,E.cmpn(0)<0&&E.iadd(R),E},o.prototype.gcd=function(R){if(this.isZero())return R.abs();if(R.isZero())return this.abs();var A=this.clone(),y=R.clone();A.negative=0,y.negative=0;for(var w=0;A.isEven()&&y.isEven();w++)A.iushrn(1),y.iushrn(1);do{for(;A.isEven();)A.iushrn(1);for(;y.isEven();)y.iushrn(1);var I=A.cmp(y);if(I<0){var M=A;A=y,y=M}else if(I===0||y.cmpn(1)===0)break;A.isub(y)}while(!0);return y.iushln(w)},o.prototype.invm=function(R){return this.egcd(R).a.umod(R)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(R){return this.words[0]&R},o.prototype.bincn=function(R){a(typeof R=="number");var A=R%26,y=(R-A)/26,w=1<<A;if(this.length<=y)return this._expand(y+1),this.words[y]|=w,this;for(var I=w,M=y;I!==0&&M<this.length;M++){var k=this.words[M]|0;k+=I,I=k>>>26,k&=67108863,this.words[M]=k}return I!==0&&(this.words[M]=I,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(R){var A=R<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this.strip();var y;if(this.length>1)y=1;else{A&&(R=-R),a(R<=67108863,"Number is too big");var w=this.words[0]|0;y=w===R?0:w<R?-1:1}return this.negative!==0?-y|0:y},o.prototype.cmp=function(R){if(this.negative!==0&&R.negative===0)return-1;if(this.negative===0&&R.negative!==0)return 1;var A=this.ucmp(R);return this.negative!==0?-A|0:A},o.prototype.ucmp=function(R){if(this.length>R.length)return 1;if(this.length<R.length)return-1;for(var A=0,y=this.length-1;y>=0;y--){var w=this.words[y]|0,I=R.words[y]|0;if(w!==I){w<I?A=-1:w>I&&(A=1);break}}return A},o.prototype.gtn=function(R){return this.cmpn(R)===1},o.prototype.gt=function(R){return this.cmp(R)===1},o.prototype.gten=function(R){return this.cmpn(R)>=0},o.prototype.gte=function(R){return this.cmp(R)>=0},o.prototype.ltn=function(R){return this.cmpn(R)===-1},o.prototype.lt=function(R){return this.cmp(R)===-1},o.prototype.lten=function(R){return this.cmpn(R)<=0},o.prototype.lte=function(R){return this.cmp(R)<=0},o.prototype.eqn=function(R){return this.cmpn(R)===0},o.prototype.eq=function(R){return this.cmp(R)===0},o.red=function(R){return new ae(R)},o.prototype.toRed=function(R){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),R.convertTo(this)._forceRed(R)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(R){return this.red=R,this},o.prototype.forceRed=function(R){return a(!this.red,"Already a number in reduction context"),this._forceRed(R)},o.prototype.redAdd=function(R){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,R)},o.prototype.redIAdd=function(R){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,R)},o.prototype.redSub=function(R){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,R)},o.prototype.redISub=function(R){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,R)},o.prototype.redShl=function(R){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,R)},o.prototype.redMul=function(R){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.mul(this,R)},o.prototype.redIMul=function(R){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.imul(this,R)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(R){return a(this.red&&!R.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,R)};var F={k256:null,p224:null,p192:null,p25519:null};function H(J,R){this.name=J,this.p=new o(R,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var R=new o(null);return R.words=new Array(Math.ceil(this.n/13)),R},H.prototype.ireduce=function(R){var A=R,y;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),y=A.bitLength();while(y>this.n);var w=y<this.n?-1:A.ucmp(this.p);return w===0?(A.words[0]=0,A.length=1):w>0?A.isub(this.p):A.strip!==void 0?A.strip():A._strip(),A},H.prototype.split=function(R,A){R.iushrn(this.n,0,A)},H.prototype.imulK=function(R){return R.imul(this.k)};function W(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}c(W,H),W.prototype.split=function(R,A){for(var y=4194303,w=Math.min(R.length,9),I=0;I<w;I++)A.words[I]=R.words[I];if(A.length=w,R.length<=9){R.words[0]=0,R.length=1;return}var M=R.words[9];for(A.words[A.length++]=M&y,I=10;I<R.length;I++){var k=R.words[I]|0;R.words[I-10]=(k&y)<<4|M>>>22,M=k}M>>>=22,R.words[I-10]=M,M===0&&R.length>10?R.length-=10:R.length-=9},W.prototype.imulK=function(R){R.words[R.length]=0,R.words[R.length+1]=0,R.length+=2;for(var A=0,y=0;y<R.length;y++){var w=R.words[y]|0;A+=w*977,R.words[y]=A&67108863,A=w*64+(A/67108864|0)}return R.words[R.length-1]===0&&(R.length--,R.words[R.length-1]===0&&R.length--),R};function Z(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}c(Z,H);function ie(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}c(ie,H);function te(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}c(te,H),te.prototype.imulK=function(R){for(var A=0,y=0;y<R.length;y++){var w=(R.words[y]|0)*19+A,I=w&67108863;w>>>=26,R.words[y]=I,A=w}return A!==0&&(R.words[R.length++]=A),R},o._prime=function(R){if(F[R])return F[R];var A;if(R==="k256")A=new W;else if(R==="p224")A=new Z;else if(R==="p192")A=new ie;else if(R==="p25519")A=new te;else throw new Error("Unknown prime "+R);return F[R]=A,A};function ae(J){if(typeof J=="string"){var R=o._prime(J);this.m=R.p,this.prime=R}else a(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}ae.prototype._verify1=function(R){a(R.negative===0,"red works only with positives"),a(R.red,"red works only with red numbers")},ae.prototype._verify2=function(R,A){a((R.negative|A.negative)===0,"red works only with positives"),a(R.red&&R.red===A.red,"red works only with red numbers")},ae.prototype.imod=function(R){return this.prime?this.prime.ireduce(R)._forceRed(this):R.umod(this.m)._forceRed(this)},ae.prototype.neg=function(R){return R.isZero()?R.clone():this.m.sub(R)._forceRed(this)},ae.prototype.add=function(R,A){this._verify2(R,A);var y=R.add(A);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},ae.prototype.iadd=function(R,A){this._verify2(R,A);var y=R.iadd(A);return y.cmp(this.m)>=0&&y.isub(this.m),y},ae.prototype.sub=function(R,A){this._verify2(R,A);var y=R.sub(A);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},ae.prototype.isub=function(R,A){this._verify2(R,A);var y=R.isub(A);return y.cmpn(0)<0&&y.iadd(this.m),y},ae.prototype.shl=function(R,A){return this._verify1(R),this.imod(R.ushln(A))},ae.prototype.imul=function(R,A){return this._verify2(R,A),this.imod(R.imul(A))},ae.prototype.mul=function(R,A){return this._verify2(R,A),this.imod(R.mul(A))},ae.prototype.isqr=function(R){return this.imul(R,R.clone())},ae.prototype.sqr=function(R){return this.mul(R,R)},ae.prototype.sqrt=function(R){if(R.isZero())return R.clone();var A=this.m.andln(3);if(a(A%2===1),A===3){var y=this.m.add(new o(1)).iushrn(2);return this.pow(R,y)}for(var w=this.m.subn(1),I=0;!w.isZero()&&w.andln(1)===0;)I++,w.iushrn(1);a(!w.isZero());var M=new o(1).toRed(this),k=M.redNeg(),P=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new o(2*_*_).toRed(this);this.pow(_,P).cmp(k)!==0;)_.redIAdd(k);for(var q=this.pow(_,w),E=this.pow(R,w.addn(1).iushrn(1)),j=this.pow(R,w),ee=I;j.cmp(M)!==0;){for(var oe=j,Y=0;oe.cmp(M)!==0;Y++)oe=oe.redSqr();a(Y<ee);var L=this.pow(q,new o(1).iushln(ee-Y-1));E=E.redMul(L),q=L.redSqr(),j=j.redMul(q),ee=Y}return E},ae.prototype.invm=function(R){var A=R._invmp(this.m);return A.negative!==0?(A.negative=0,this.imod(A).redNeg()):this.imod(A)},ae.prototype.pow=function(R,A){if(A.isZero())return new o(1).toRed(this);if(A.cmpn(1)===0)return R.clone();var y=4,w=new Array(1<<y);w[0]=new o(1).toRed(this),w[1]=R;for(var I=2;I<w.length;I++)w[I]=this.mul(w[I-1],R);var M=w[0],k=0,P=0,_=A.bitLength()%26;for(_===0&&(_=26),I=A.length-1;I>=0;I--){for(var q=A.words[I],E=_-1;E>=0;E--){var j=q>>E&1;if(M!==w[0]&&(M=this.sqr(M)),j===0&&k===0){P=0;continue}k<<=1,k|=j,P++,!(P!==y&&(I!==0||E!==0))&&(M=this.mul(M,w[k]),P=0,k=0)}_=26}return M},ae.prototype.convertTo=function(R){var A=R.umod(this.m);return A===R?A.clone():A},ae.prototype.convertFrom=function(R){var A=R.clone();return A.red=null,A},o.mont=function(R){return new de(R)};function de(J){ae.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}c(de,ae),de.prototype.convertTo=function(R){return this.imod(R.ushln(this.shift))},de.prototype.convertFrom=function(R){var A=this.imod(R.mul(this.rinv));return A.red=null,A},de.prototype.imul=function(R,A){if(R.isZero()||A.isZero())return R.words[0]=0,R.length=1,R;var y=R.imul(A),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),I=y.isub(w).iushrn(this.shift),M=I;return I.cmp(this.m)>=0?M=I.isub(this.m):I.cmpn(0)<0&&(M=I.iadd(this.m)),M._forceRed(this)},de.prototype.mul=function(R,A){if(R.isZero()||A.isZero())return new o(0)._forceRed(this);var y=R.mul(A),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),I=y.isub(w).iushrn(this.shift),M=I;return I.cmp(this.m)>=0?M=I.isub(this.m):I.cmpn(0)<0&&(M=I.iadd(this.m)),M._forceRed(this)},de.prototype.invm=function(R){var A=this.imod(R._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(t,commonjsGlobal)}(bn$1);var bnExports=bn$1.exports,minimalisticAssert=assert$e;function assert$e(t,e){if(!t)throw new Error(e||"Assertion failed")}assert$e.equal=function(e,n,a){if(e!=n)throw new Error(a||"Assertion failed: "+e+" != "+n)};var utils$n={};(function(t){var e=t;function n(o,u){if(Array.isArray(o))return o.slice();if(!o)return[];var h=[];if(typeof o!="string"){for(var l=0;l<o.length;l++)h[l]=o[l]|0;return h}if(u==="hex"){o=o.replace(/[^a-z0-9]+/ig,""),o.length%2!==0&&(o="0"+o);for(var l=0;l<o.length;l+=2)h.push(parseInt(o[l]+o[l+1],16))}else for(var l=0;l<o.length;l++){var b=o.charCodeAt(l),d=b>>8,p=b&255;d?h.push(d,p):h.push(p)}return h}e.toArray=n;function a(o){return o.length===1?"0"+o:o}e.zero2=a;function c(o){for(var u="",h=0;h<o.length;h++)u+=a(o[h].toString(16));return u}e.toHex=c,e.encode=function(u,h){return h==="hex"?c(u):u}})(utils$n),function(t){var e=t,n=bnExports,a=minimalisticAssert,c=utils$n;e.assert=a,e.toArray=c.toArray,e.zero2=c.zero2,e.toHex=c.toHex,e.encode=c.encode;function o(d,p,x){var m=new Array(Math.max(d.bitLength(),x)+1),v;for(v=0;v<m.length;v+=1)m[v]=0;var g=1<<p+1,$=d.clone();for(v=0;v<m.length;v++){var B,C=$.andln(g-1);$.isOdd()?(C>(g>>1)-1?B=(g>>1)-C:B=C,$.isubn(B)):B=0,m[v]=B,$.iushrn(1)}return m}e.getNAF=o;function u(d,p){var x=[[],[]];d=d.clone(),p=p.clone();for(var m=0,v=0,g;d.cmpn(-m)>0||p.cmpn(-v)>0;){var $=d.andln(3)+m&3,B=p.andln(3)+v&3;$===3&&($=-1),B===3&&(B=-1);var C;$&1?(g=d.andln(7)+m&7,(g===3||g===5)&&B===2?C=-$:C=$):C=0,x[0].push(C);var F;B&1?(g=p.andln(7)+v&7,(g===3||g===5)&&$===2?F=-B:F=B):F=0,x[1].push(F),2*m===C+1&&(m=1-m),2*v===F+1&&(v=1-v),d.iushrn(1),p.iushrn(1)}return x}e.getJSF=u;function h(d,p,x){var m="_"+p;d.prototype[p]=function(){return this[m]!==void 0?this[m]:this[m]=x.call(this)}}e.cachedProperty=h;function l(d){return typeof d=="string"?e.toArray(d,"hex"):d}e.parseBytes=l;function b(d){return new n(d,"hex","le")}e.intFromLE=b}(utils$o);var brorand={exports:{}},cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredSafeBuffer$1;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,function(t,e){var n=require$$1$2,a=n.Buffer;function c(u,h){for(var l in u)h[l]=u[l]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=n:(c(n,e),e.Buffer=o);function o(u,h,l){return a(u,h,l)}o.prototype=Object.create(a.prototype),c(a,o),o.from=function(u,h,l){if(typeof u=="number")throw new TypeError("Argument must not be a number");return a(u,h,l)},o.alloc=function(u,h,l){if(typeof u!="number")throw new TypeError("Argument must be a number");var b=a(u);return h!==void 0?typeof l=="string"?b.fill(h,l):b.fill(h):b.fill(0),b},o.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return a(u)},o.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(u)}}(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}var hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var t=65536,e=4294967295;function n(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
10
|
-
Use Chrome, Firefox or Internet Explorer 11`)}var a=requireSafeBuffer$1().Buffer,c=commonjsGlobal.crypto||commonjsGlobal.msCrypto;c&&c.getRandomValues?browser$b.exports=o:browser$b.exports=n;function o(u,h){if(u>e)throw new RangeError("requested too many random bytes");var l=a.allocUnsafe(u);if(u>0)if(u>t)for(var b=0;b<u;b+=t)c.getRandomValues(l.slice(b,b+t));else c.getRandomValues(l);return typeof h=="function"?process$1.nextTick(function(){h(null,l)}):l}return browser$b.exports}var inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(e,n){if(n){e.super_=n;var a=function(){};a.prototype=n.prototype,e.prototype=new a,e.prototype.constructor=e}};var inherits_browserExports=inherits_browser.exports,readableBrowser$1={exports:{}},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(W,Z,ie){return Function.prototype.apply.call(W,Z,ie)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(W){return Object.getOwnPropertyNames(W).concat(Object.getOwnPropertySymbols(W))}:n=function(W){return Object.getOwnPropertyNames(W)};function a(H){console&&console.warn&&console.warn(H)}var c=Number.isNaN||function(W){return W!==W};function o(){o.init.call(this)}events.exports=o,events.exports.once=B,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var u=10;function h(H){if(typeof H!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof H)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(H){if(typeof H!="number"||H<0||c(H))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+H+".");u=H}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(W){if(typeof W!="number"||W<0||c(W))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+W+".");return this._maxListeners=W,this};function l(H){return H._maxListeners===void 0?o.defaultMaxListeners:H._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(W){for(var Z=[],ie=1;ie<arguments.length;ie++)Z.push(arguments[ie]);var te=W==="error",ae=this._events;if(ae!==void 0)te=te&&ae.error===void 0;else if(!te)return!1;if(te){var de;if(Z.length>0&&(de=Z[0]),de instanceof Error)throw de;var J=new Error("Unhandled error."+(de?" ("+de.message+")":""));throw J.context=de,J}var R=ae[W];if(R===void 0)return!1;if(typeof R=="function")e(R,this,Z);else for(var A=R.length,y=v(R,A),ie=0;ie<A;++ie)e(y[ie],this,Z);return!0};function b(H,W,Z,ie){var te,ae,de;if(h(Z),ae=H._events,ae===void 0?(ae=H._events=Object.create(null),H._eventsCount=0):(ae.newListener!==void 0&&(H.emit("newListener",W,Z.listener?Z.listener:Z),ae=H._events),de=ae[W]),de===void 0)de=ae[W]=Z,++H._eventsCount;else if(typeof de=="function"?de=ae[W]=ie?[Z,de]:[de,Z]:ie?de.unshift(Z):de.push(Z),te=l(H),te>0&&de.length>te&&!de.warned){de.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+de.length+" "+String(W)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=H,J.type=W,J.count=de.length,a(J)}return H}o.prototype.addListener=function(W,Z){return b(this,W,Z,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(W,Z){return b(this,W,Z,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(H,W,Z){var ie={fired:!1,wrapFn:void 0,target:H,type:W,listener:Z},te=d.bind(ie);return te.listener=Z,ie.wrapFn=te,te}o.prototype.once=function(W,Z){return h(Z),this.on(W,p(this,W,Z)),this},o.prototype.prependOnceListener=function(W,Z){return h(Z),this.prependListener(W,p(this,W,Z)),this},o.prototype.removeListener=function(W,Z){var ie,te,ae,de,J;if(h(Z),te=this._events,te===void 0)return this;if(ie=te[W],ie===void 0)return this;if(ie===Z||ie.listener===Z)--this._eventsCount===0?this._events=Object.create(null):(delete te[W],te.removeListener&&this.emit("removeListener",W,ie.listener||Z));else if(typeof ie!="function"){for(ae=-1,de=ie.length-1;de>=0;de--)if(ie[de]===Z||ie[de].listener===Z){J=ie[de].listener,ae=de;break}if(ae<0)return this;ae===0?ie.shift():g(ie,ae),ie.length===1&&(te[W]=ie[0]),te.removeListener!==void 0&&this.emit("removeListener",W,J||Z)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(W){var Z,ie,te;if(ie=this._events,ie===void 0)return this;if(ie.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ie[W]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ie[W]),this;if(arguments.length===0){var ae=Object.keys(ie),de;for(te=0;te<ae.length;++te)de=ae[te],de!=="removeListener"&&this.removeAllListeners(de);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(Z=ie[W],typeof Z=="function")this.removeListener(W,Z);else if(Z!==void 0)for(te=Z.length-1;te>=0;te--)this.removeListener(W,Z[te]);return this};function x(H,W,Z){var ie=H._events;if(ie===void 0)return[];var te=ie[W];return te===void 0?[]:typeof te=="function"?Z?[te.listener||te]:[te]:Z?$(te):v(te,te.length)}o.prototype.listeners=function(W){return x(this,W,!0)},o.prototype.rawListeners=function(W){return x(this,W,!1)},o.listenerCount=function(H,W){return typeof H.listenerCount=="function"?H.listenerCount(W):m.call(H,W)},o.prototype.listenerCount=m;function m(H){var W=this._events;if(W!==void 0){var Z=W[H];if(typeof Z=="function")return 1;if(Z!==void 0)return Z.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function v(H,W){for(var Z=new Array(W),ie=0;ie<W;++ie)Z[ie]=H[ie];return Z}function g(H,W){for(;W+1<H.length;W++)H[W]=H[W+1];H.pop()}function $(H){for(var W=new Array(H.length),Z=0;Z<W.length;++Z)W[Z]=H[Z].listener||H[Z];return W}function B(H,W){return new Promise(function(Z,ie){function te(de){H.removeListener(W,ae),ie(de)}function ae(){typeof H.removeListener=="function"&&H.removeListener("error",te),Z([].slice.call(arguments))}F(H,W,ae,{once:!0}),W!=="error"&&C(H,te,{once:!0})})}function C(H,W,Z){typeof H.on=="function"&&F(H,"error",W,Z)}function F(H,W,Z,ie){if(typeof H.on=="function")ie.once?H.once(W,Z):H.on(W,Z);else if(typeof H.addEventListener=="function")H.addEventListener(W,function te(ae){ie.once&&H.removeEventListener(W,te),Z(ae)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof H)}return events.exports}var streamBrowser$1,hasRequiredStreamBrowser$1;function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1||(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter),streamBrowser$1}var util$1={},types={},shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),a=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var c=42;e[n]=c;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(e,n);if(u.value!==c||u.enumerable!==!0)return!1}return!0}),shams$1}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var t=requireShams$1();return shams=function(){return t()&&!!Symbol.toStringTag},shams}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type=TypeError),type}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var t=typeof Symbol<"u"&&Symbol,e=requireShams$1();return hasSymbols=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},hasSymbols}var hasProto,hasRequiredHasProto;function requireHasProto(){if(hasRequiredHasProto)return hasProto;hasRequiredHasProto=1;var t={__proto__:null,foo:{}},e=Object;return hasProto=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},hasProto}var implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,a="[object Function]",c=function(l,b){for(var d=[],p=0;p<l.length;p+=1)d[p]=l[p];for(var x=0;x<b.length;x+=1)d[x+l.length]=b[x];return d},o=function(l,b){for(var d=[],p=b,x=0;p<l.length;p+=1,x+=1)d[x]=l[p];return d},u=function(h,l){for(var b="",d=0;d<h.length;d+=1)b+=h[d],d+1<h.length&&(b+=l);return b};return implementation=function(l){var b=this;if(typeof b!="function"||e.apply(b)!==a)throw new TypeError(t+b);for(var d=o(arguments,1),p,x=function(){if(this instanceof p){var B=b.apply(this,c(d,arguments));return Object(B)===B?B:this}return b.apply(l,c(d,arguments))},m=n(0,b.length-d.length),v=[],g=0;g<m;g++)v[g]="$"+g;if(p=Function("binder","return function ("+u(v,",")+"){ return binder.apply(this,arguments); }")(x),b.prototype){var $=function(){};$.prototype=b.prototype,p.prototype=new $,$.prototype=null}return p},implementation}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var t=requireImplementation();return functionBind=Function.prototype.bind||t,functionBind}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=requireFunctionBind();return hasown=n.call(t,e),hasown}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var t,e=requireEsErrors(),n=require_eval(),a=requireRange(),c=requireRef(),o=requireSyntax(),u=requireType(),h=requireUri(),l=Function,b=function(M){try{return l('"use strict"; return ('+M+").constructor;")()}catch{}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch{d=null}var p=function(){throw new u},x=d?function(){try{return arguments.callee,p}catch{try{return d(arguments,"callee").get}catch{return p}}}():p,m=requireHasSymbols()(),v=requireHasProto()(),g=Object.getPrototypeOf||(v?function(M){return M.__proto__}:null),$={},B=typeof Uint8Array>"u"||!g?t:g(Uint8Array),C={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":m&&g?g([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":$,"%AsyncGenerator%":$,"%AsyncGeneratorFunction%":$,"%AsyncIteratorPrototype%":$,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":$,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&g?g(g([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!g?t:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":a,"%ReferenceError%":c,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!m||!g?t:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&g?g(""[Symbol.iterator]()):t,"%Symbol%":m?Symbol:t,"%SyntaxError%":o,"%ThrowTypeError%":x,"%TypedArray%":B,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":h,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(g)try{null.error}catch(M){var F=g(g(M));C["%Error.prototype%"]=F}var H=function M(k){var P;if(k==="%AsyncFunction%")P=b("async function () {}");else if(k==="%GeneratorFunction%")P=b("function* () {}");else if(k==="%AsyncGeneratorFunction%")P=b("async function* () {}");else if(k==="%AsyncGenerator%"){var _=M("%AsyncGeneratorFunction%");_&&(P=_.prototype)}else if(k==="%AsyncIteratorPrototype%"){var q=M("%AsyncGenerator%");q&&g&&(P=g(q.prototype))}return C[k]=P,P},W={__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"]},Z=requireFunctionBind(),ie=requireHasown(),te=Z.call(Function.call,Array.prototype.concat),ae=Z.call(Function.apply,Array.prototype.splice),de=Z.call(Function.call,String.prototype.replace),J=Z.call(Function.call,String.prototype.slice),R=Z.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,y=/\\(\\)?/g,w=function(k){var P=J(k,0,1),_=J(k,-1);if(P==="%"&&_!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(_==="%"&&P!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var q=[];return de(k,A,function(E,j,ee,oe){q[q.length]=ee?de(oe,y,"$1"):j||E}),q},I=function(k,P){var _=k,q;if(ie(W,_)&&(q=W[_],_="%"+q[0]+"%"),ie(C,_)){var E=C[_];if(E===$&&(E=H(_)),typeof E>"u"&&!P)throw new u("intrinsic "+k+" exists, but is not available. Please file an issue!");return{alias:q,name:_,value:E}}throw new o("intrinsic "+k+" does not exist!")};return getIntrinsic=function(k,P){if(typeof k!="string"||k.length===0)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof P!="boolean")throw new u('"allowMissing" argument must be a boolean');if(R(/^%?[^%]*%?$/,k)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var _=w(k),q=_.length>0?_[0]:"",E=I("%"+q+"%",P),j=E.name,ee=E.value,oe=!1,Y=E.alias;Y&&(q=Y[0],ae(_,te([0,1],Y)));for(var L=1,z=!0;L<_.length;L+=1){var re=_[L],D=J(re,0,1),G=J(re,-1);if((D==='"'||D==="'"||D==="`"||G==='"'||G==="'"||G==="`")&&D!==G)throw new o("property names with quotes must have matching quotes");if((re==="constructor"||!z)&&(oe=!0),q+="."+re,j="%"+q+"%",ie(C,j))ee=C[j];else if(ee!=null){if(!(re in ee)){if(!P)throw new u("base intrinsic for "+k+" exists, but the property is not available.");return}if(d&&L+1>=_.length){var U=d(ee,re);z=!!U,z&&"get"in U&&!("originalValue"in U.get)?ee=U.get:ee=ee[re]}else z=ie(ee,re),ee=ee[re];z&&!oe&&(C[j]=ee)}}return ee},getIntrinsic}var callBind={exports:{}},esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var t=requireGetIntrinsic(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return esDefineProperty=e,esDefineProperty}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var t=requireGetIntrinsic(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return gopd=e,gopd}var defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var t=requireEsDefineProperty(),e=requireSyntax(),n=requireType(),a=requireGopd();return defineDataProperty=function(o,u,h){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,b=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,x=!!a&&a(o,u);if(t)t(o,u,{configurable:d===null&&x?x.configurable:!d,enumerable:l===null&&x?x.enumerable:!l,value:h,writable:b===null&&x?x.writable:!b});else if(p||!l&&!b&&!d)o[u]=h;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var t=requireEsDefineProperty(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=e,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var t=requireGetIntrinsic(),e=requireDefineDataProperty(),n=requireHasPropertyDescriptors()(),a=requireGopd(),c=requireType(),o=t("%Math.floor%");return setFunctionLength=function(h,l){if(typeof h!="function")throw new c("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new c("`length` must be a positive 32-bit integer");var b=arguments.length>2&&!!arguments[2],d=!0,p=!0;if("length"in h&&a){var x=a(h,"length");x&&!x.configurable&&(d=!1),x&&!x.writable&&(p=!1)}return(d||p||!b)&&(n?e(h,"length",l,!0,!0):e(h,"length",l)),h},setFunctionLength}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,function(t){var e=requireFunctionBind(),n=requireGetIntrinsic(),a=requireSetFunctionLength(),c=requireType(),o=n("%Function.prototype.apply%"),u=n("%Function.prototype.call%"),h=n("%Reflect.apply%",!0)||e.call(u,o),l=requireEsDefineProperty(),b=n("%Math.max%");t.exports=function(x){if(typeof x!="function")throw new c("a function is required");var m=h(e,u,arguments);return a(m,1+b(0,x.length-(arguments.length-1)),!0)};var d=function(){return h(e,o,arguments)};l?l(t.exports,"apply",{value:d}):t.exports.apply=d}(callBind)),callBind.exports}var callBound,hasRequiredCallBound;function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var t=requireGetIntrinsic(),e=requireCallBind(),n=e(t("String.prototype.indexOf"));return callBound=function(c,o){var u=t(c,!!o);return typeof u=="function"&&n(c,".prototype.")>-1?e(u):u},callBound}var isArguments,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var t=requireShams()(),e=requireCallBound(),n=e("Object.prototype.toString"),a=function(h){return t&&h&&typeof h=="object"&&Symbol.toStringTag in h?!1:n(h)==="[object Arguments]"},c=function(h){return a(h)?!0:h!==null&&typeof h=="object"&&typeof h.length=="number"&&h.length>=0&&n(h)!=="[object Array]"&&n(h.callee)==="[object Function]"},o=function(){return a(arguments)}();return a.isLegacyArguments=c,isArguments=o?a:c,isArguments}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var t=Object.prototype.toString,e=Function.prototype.toString,n=/^\s*(?:function)?\*/,a=requireShams()(),c=Object.getPrototypeOf,o=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch{}},u;return isGeneratorFunction=function(l){if(typeof l!="function")return!1;if(n.test(e.call(l)))return!0;if(!a){var b=t.call(l);return b==="[object GeneratorFunction]"}if(!c)return!1;if(typeof u>"u"){var d=o();u=d?c(d):!1}return c(l)===u},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,a;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw a}}),a={},e(function(){throw 42},null,n)}catch(C){C!==a&&(e=null)}else e=null;var c=/^\s*class\b/,o=function(F){try{var H=t.call(F);return c.test(H)}catch{return!1}},u=function(F){try{return o(F)?!1:(t.call(F),!0)}catch{return!1}},h=Object.prototype.toString,l="[object Object]",b="[object Function]",d="[object GeneratorFunction]",p="[object HTMLAllCollection]",x="[object HTML document.all class]",m="[object HTMLCollection]",v=typeof Symbol=="function"&&!!Symbol.toStringTag,g=!(0 in[,]),$=function(){return!1};if(typeof document=="object"){var B=document.all;h.call(B)===h.call(document.all)&&($=function(F){if((g||!F)&&(typeof F>"u"||typeof F=="object"))try{var H=h.call(F);return(H===p||H===x||H===m||H===l)&&F("")==null}catch{}return!1})}return isCallable=e?function(F){if($(F))return!0;if(!F||typeof F!="function"&&typeof F!="object")return!1;try{e(F,null,n)}catch(H){if(H!==a)return!1}return!o(F)&&u(F)}:function(F){if($(F))return!0;if(!F||typeof F!="function"&&typeof F!="object")return!1;if(v)return u(F);if(o(F))return!1;var H=h.call(F);return H!==b&&H!==d&&!/^\[object HTML/.test(H)?!1:u(F)},isCallable}var forEach_1,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach_1;hasRequiredForEach=1;var t=requireIsCallable(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,a=function(l,b,d){for(var p=0,x=l.length;p<x;p++)n.call(l,p)&&(d==null?b(l[p],p,l):b.call(d,l[p],p,l))},c=function(l,b,d){for(var p=0,x=l.length;p<x;p++)d==null?b(l.charAt(p),p,l):b.call(d,l.charAt(p),p,l)},o=function(l,b,d){for(var p in l)n.call(l,p)&&(d==null?b(l[p],p,l):b.call(d,l[p],p,l))},u=function(l,b,d){if(!t(b))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=d),e.call(l)==="[object Array]"?a(l,b,p):typeof l=="string"?c(l,b,p):o(l,b,p)};return forEach_1=u,forEach_1}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var t=requirePossibleTypedArrayNames(),e=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var a=[],c=0;c<t.length;c++)typeof e[t[c]]=="function"&&(a[a.length]=t[c]);return a},availableTypedArrays}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var t=requireForEach(),e=requireAvailableTypedArrays(),n=requireCallBind(),a=requireCallBound(),c=requireGopd(),o=a("Object.prototype.toString"),u=requireShams()(),h=typeof globalThis>"u"?commonjsGlobal:globalThis,l=e(),b=a("String.prototype.slice"),d=Object.getPrototypeOf,p=a("Array.prototype.indexOf",!0)||function($,B){for(var C=0;C<$.length;C+=1)if($[C]===B)return C;return-1},x={__proto__:null};u&&c&&d?t(l,function(g){var $=new h[g];if(Symbol.toStringTag in $){var B=d($),C=c(B,Symbol.toStringTag);if(!C){var F=d(B);C=c(F,Symbol.toStringTag)}x["$"+g]=n(C.get)}}):t(l,function(g){var $=new h[g],B=$.slice||$.set;B&&(x["$"+g]=n(B))});var m=function($){var B=!1;return t(x,function(C,F){if(!B)try{"$"+C($)===F&&(B=b(F,1))}catch{}}),B},v=function($){var B=!1;return t(x,function(C,F){if(!B)try{C($),B=b(F,1)}catch{}}),B};return whichTypedArray=function($){if(!$||typeof $!="object")return!1;if(!u){var B=b(o($),8,-1);return p(l,B)>-1?B:B!=="Object"?!1:v($)}return c?m($):null},whichTypedArray}var isTypedArray$1,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray$1;hasRequiredIsTypedArray=1;var t=requireWhichTypedArray();return isTypedArray$1=function(n){return!!t(n)},isTypedArray$1}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(t){var e=requireIsArguments(),n=requireIsGeneratorFunction(),a=requireWhichTypedArray(),c=requireIsTypedArray();function o(se){return se.call.bind(se)}var u=typeof BigInt<"u",h=typeof Symbol<"u",l=o(Object.prototype.toString),b=o(Number.prototype.valueOf),d=o(String.prototype.valueOf),p=o(Boolean.prototype.valueOf);if(u)var x=o(BigInt.prototype.valueOf);if(h)var m=o(Symbol.prototype.valueOf);function v(se,ge){if(typeof se!="object")return!1;try{return ge(se),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=n,t.isTypedArray=c;function g(se){return typeof Promise<"u"&&se instanceof Promise||se!==null&&typeof se=="object"&&typeof se.then=="function"&&typeof se.catch=="function"}t.isPromise=g;function $(se){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(se):c(se)||j(se)}t.isArrayBufferView=$;function B(se){return a(se)==="Uint8Array"}t.isUint8Array=B;function C(se){return a(se)==="Uint8ClampedArray"}t.isUint8ClampedArray=C;function F(se){return a(se)==="Uint16Array"}t.isUint16Array=F;function H(se){return a(se)==="Uint32Array"}t.isUint32Array=H;function W(se){return a(se)==="Int8Array"}t.isInt8Array=W;function Z(se){return a(se)==="Int16Array"}t.isInt16Array=Z;function ie(se){return a(se)==="Int32Array"}t.isInt32Array=ie;function te(se){return a(se)==="Float32Array"}t.isFloat32Array=te;function ae(se){return a(se)==="Float64Array"}t.isFloat64Array=ae;function de(se){return a(se)==="BigInt64Array"}t.isBigInt64Array=de;function J(se){return a(se)==="BigUint64Array"}t.isBigUint64Array=J;function R(se){return l(se)==="[object Map]"}R.working=typeof Map<"u"&&R(new Map);function A(se){return typeof Map>"u"?!1:R.working?R(se):se instanceof Map}t.isMap=A;function y(se){return l(se)==="[object Set]"}y.working=typeof Set<"u"&&y(new Set);function w(se){return typeof Set>"u"?!1:y.working?y(se):se instanceof Set}t.isSet=w;function I(se){return l(se)==="[object WeakMap]"}I.working=typeof WeakMap<"u"&&I(new WeakMap);function M(se){return typeof WeakMap>"u"?!1:I.working?I(se):se instanceof WeakMap}t.isWeakMap=M;function k(se){return l(se)==="[object WeakSet]"}k.working=typeof WeakSet<"u"&&k(new WeakSet);function P(se){return k(se)}t.isWeakSet=P;function _(se){return l(se)==="[object ArrayBuffer]"}_.working=typeof ArrayBuffer<"u"&&_(new ArrayBuffer);function q(se){return typeof ArrayBuffer>"u"?!1:_.working?_(se):se instanceof ArrayBuffer}t.isArrayBuffer=q;function E(se){return l(se)==="[object DataView]"}E.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&E(new DataView(new ArrayBuffer(1),0,1));function j(se){return typeof DataView>"u"?!1:E.working?E(se):se instanceof DataView}t.isDataView=j;var ee=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function oe(se){return l(se)==="[object SharedArrayBuffer]"}function Y(se){return typeof ee>"u"?!1:(typeof oe.working>"u"&&(oe.working=oe(new ee)),oe.working?oe(se):se instanceof ee)}t.isSharedArrayBuffer=Y;function L(se){return l(se)==="[object AsyncFunction]"}t.isAsyncFunction=L;function z(se){return l(se)==="[object Map Iterator]"}t.isMapIterator=z;function re(se){return l(se)==="[object Set Iterator]"}t.isSetIterator=re;function D(se){return l(se)==="[object Generator]"}t.isGeneratorObject=D;function G(se){return l(se)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=G;function U(se){return v(se,b)}t.isNumberObject=U;function Q(se){return v(se,d)}t.isStringObject=Q;function fe(se){return v(se,p)}t.isBooleanObject=fe;function he(se){return u&&v(se,x)}t.isBigIntObject=he;function le(se){return h&&v(se,m)}t.isSymbolObject=le;function pe(se){return U(se)||Q(se)||fe(se)||he(se)||le(se)}t.isBoxedPrimitive=pe;function be(se){return typeof Uint8Array<"u"&&(q(se)||Y(se))}t.isAnyArrayBuffer=be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(se){Object.defineProperty(t,se,{enumerable:!1,value:function(){throw new Error(se+" is not supported in userland")}})})}(types)),types}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),isBufferBrowser}var hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,function(t){var e=Object.getOwnPropertyDescriptors||function(j){for(var ee=Object.keys(j),oe={},Y=0;Y<ee.length;Y++)oe[ee[Y]]=Object.getOwnPropertyDescriptor(j,ee[Y]);return oe},n=/%[sdj%]/g;t.format=function(E){if(!W(E)){for(var j=[],ee=0;ee<arguments.length;ee++)j.push(u(arguments[ee]));return j.join(" ")}for(var ee=1,oe=arguments,Y=oe.length,L=String(E).replace(n,function(re){if(re==="%%")return"%";if(ee>=Y)return re;switch(re){case"%s":return String(oe[ee++]);case"%d":return Number(oe[ee++]);case"%j":try{return JSON.stringify(oe[ee++])}catch{return"[Circular]"}default:return re}}),z=oe[ee];ee<Y;z=oe[++ee])C(z)||!ae(z)?L+=" "+z:L+=" "+u(z);return L},t.deprecate=function(E,j){if(typeof process$1<"u"&&process$1.noDeprecation===!0)return E;if(typeof process$1>"u")return function(){return t.deprecate(E,j).apply(this,arguments)};var ee=!1;function oe(){if(!ee){if(process$1.throwDeprecation)throw new Error(j);process$1.traceDeprecation?console.trace(j):console.error(j),ee=!0}return E.apply(this,arguments)}return oe};var a={},c=/^$/;if(process$1.env.NODE_DEBUG){var o=process$1.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+o+"$","i")}t.debuglog=function(E){if(E=E.toUpperCase(),!a[E])if(c.test(E)){var j=process$1.pid;a[E]=function(){var ee=t.format.apply(t,arguments);console.error("%s %d: %s",E,j,ee)}}else a[E]=function(){};return a[E]};function u(E,j){var ee={seen:[],stylize:l};return arguments.length>=3&&(ee.depth=arguments[2]),arguments.length>=4&&(ee.colors=arguments[3]),B(j)?ee.showHidden=j:j&&t._extend(ee,j),ie(ee.showHidden)&&(ee.showHidden=!1),ie(ee.depth)&&(ee.depth=2),ie(ee.colors)&&(ee.colors=!1),ie(ee.customInspect)&&(ee.customInspect=!0),ee.colors&&(ee.stylize=h),d(ee,E,ee.depth)}t.inspect=u,u.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]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function h(E,j){var ee=u.styles[j];return ee?"\x1B["+u.colors[ee][0]+"m"+E+"\x1B["+u.colors[ee][1]+"m":E}function l(E,j){return E}function b(E){var j={};return E.forEach(function(ee,oe){j[ee]=!0}),j}function d(E,j,ee){if(E.customInspect&&j&&R(j.inspect)&&j.inspect!==t.inspect&&!(j.constructor&&j.constructor.prototype===j)){var oe=j.inspect(ee,E);return W(oe)||(oe=d(E,oe,ee)),oe}var Y=p(E,j);if(Y)return Y;var L=Object.keys(j),z=b(L);if(E.showHidden&&(L=Object.getOwnPropertyNames(j)),J(j)&&(L.indexOf("message")>=0||L.indexOf("description")>=0))return x(j);if(L.length===0){if(R(j)){var re=j.name?": "+j.name:"";return E.stylize("[Function"+re+"]","special")}if(te(j))return E.stylize(RegExp.prototype.toString.call(j),"regexp");if(de(j))return E.stylize(Date.prototype.toString.call(j),"date");if(J(j))return x(j)}var D="",G=!1,U=["{","}"];if($(j)&&(G=!0,U=["[","]"]),R(j)){var Q=j.name?": "+j.name:"";D=" [Function"+Q+"]"}if(te(j)&&(D=" "+RegExp.prototype.toString.call(j)),de(j)&&(D=" "+Date.prototype.toUTCString.call(j)),J(j)&&(D=" "+x(j)),L.length===0&&(!G||j.length==0))return U[0]+D+U[1];if(ee<0)return te(j)?E.stylize(RegExp.prototype.toString.call(j),"regexp"):E.stylize("[Object]","special");E.seen.push(j);var fe;return G?fe=m(E,j,ee,z,L):fe=L.map(function(he){return v(E,j,ee,z,he,G)}),E.seen.pop(),g(fe,D,U)}function p(E,j){if(ie(j))return E.stylize("undefined","undefined");if(W(j)){var ee="'"+JSON.stringify(j).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return E.stylize(ee,"string")}if(H(j))return E.stylize(""+j,"number");if(B(j))return E.stylize(""+j,"boolean");if(C(j))return E.stylize("null","null")}function x(E){return"["+Error.prototype.toString.call(E)+"]"}function m(E,j,ee,oe,Y){for(var L=[],z=0,re=j.length;z<re;++z)k(j,String(z))?L.push(v(E,j,ee,oe,String(z),!0)):L.push("");return Y.forEach(function(D){D.match(/^\d+$/)||L.push(v(E,j,ee,oe,D,!0))}),L}function v(E,j,ee,oe,Y,L){var z,re,D;if(D=Object.getOwnPropertyDescriptor(j,Y)||{value:j[Y]},D.get?D.set?re=E.stylize("[Getter/Setter]","special"):re=E.stylize("[Getter]","special"):D.set&&(re=E.stylize("[Setter]","special")),k(oe,Y)||(z="["+Y+"]"),re||(E.seen.indexOf(D.value)<0?(C(ee)?re=d(E,D.value,null):re=d(E,D.value,ee-1),re.indexOf(`
|
|
11
|
-
`)>-1&&(L?re=re.split(`
|
|
12
|
-
`).map(function(G){return" "+G}).join(`
|
|
13
|
-
`).slice(2):re=`
|
|
14
|
-
`+re.split(`
|
|
15
|
-
`).map(function(G){return" "+G}).join(`
|
|
16
|
-
`))):re=E.stylize("[Circular]","special")),ie(z)){if(L&&Y.match(/^\d+$/))return re;z=JSON.stringify(""+Y),z.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(z=z.slice(1,-1),z=E.stylize(z,"name")):(z=z.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),z=E.stylize(z,"string"))}return z+": "+re}function g(E,j,ee){var oe=E.reduce(function(Y,L){return L.indexOf(`
|
|
17
|
-
`)>=0,Y+L.replace(/\u001b\[\d\d?m/g,"").length+1},0);return oe>60?ee[0]+(j===""?"":j+`
|
|
18
|
-
`)+" "+E.join(`,
|
|
19
|
-
`)+" "+ee[1]:ee[0]+j+" "+E.join(", ")+" "+ee[1]}t.types=requireTypes();function $(E){return Array.isArray(E)}t.isArray=$;function B(E){return typeof E=="boolean"}t.isBoolean=B;function C(E){return E===null}t.isNull=C;function F(E){return E==null}t.isNullOrUndefined=F;function H(E){return typeof E=="number"}t.isNumber=H;function W(E){return typeof E=="string"}t.isString=W;function Z(E){return typeof E=="symbol"}t.isSymbol=Z;function ie(E){return E===void 0}t.isUndefined=ie;function te(E){return ae(E)&&y(E)==="[object RegExp]"}t.isRegExp=te,t.types.isRegExp=te;function ae(E){return typeof E=="object"&&E!==null}t.isObject=ae;function de(E){return ae(E)&&y(E)==="[object Date]"}t.isDate=de,t.types.isDate=de;function J(E){return ae(E)&&(y(E)==="[object Error]"||E instanceof Error)}t.isError=J,t.types.isNativeError=J;function R(E){return typeof E=="function"}t.isFunction=R;function A(E){return E===null||typeof E=="boolean"||typeof E=="number"||typeof E=="string"||typeof E=="symbol"||typeof E>"u"}t.isPrimitive=A,t.isBuffer=requireIsBufferBrowser();function y(E){return Object.prototype.toString.call(E)}function w(E){return E<10?"0"+E.toString(10):E.toString(10)}var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(){var E=new Date,j=[w(E.getHours()),w(E.getMinutes()),w(E.getSeconds())].join(":");return[E.getDate(),I[E.getMonth()],j].join(" ")}t.log=function(){console.log("%s - %s",M(),t.format.apply(t,arguments))},t.inherits=inherits_browserExports,t._extend=function(E,j){if(!j||!ae(j))return E;for(var ee=Object.keys(j),oe=ee.length;oe--;)E[ee[oe]]=j[ee[oe]];return E};function k(E,j){return Object.prototype.hasOwnProperty.call(E,j)}var P=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;t.promisify=function(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');if(P&&j[P]){var ee=j[P];if(typeof ee!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ee,P,{value:ee,enumerable:!1,writable:!1,configurable:!0}),ee}function ee(){for(var oe,Y,L=new Promise(function(D,G){oe=D,Y=G}),z=[],re=0;re<arguments.length;re++)z.push(arguments[re]);z.push(function(D,G){D?Y(D):oe(G)});try{j.apply(this,z)}catch(D){Y(D)}return L}return Object.setPrototypeOf(ee,Object.getPrototypeOf(j)),P&&Object.defineProperty(ee,P,{value:ee,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ee,e(j))},t.promisify.custom=P;function _(E,j){if(!E){var ee=new Error("Promise was rejected with a falsy value");ee.reason=E,E=ee}return j(E)}function q(E){if(typeof E!="function")throw new TypeError('The "original" argument must be of type Function');function j(){for(var ee=[],oe=0;oe<arguments.length;oe++)ee.push(arguments[oe]);var Y=ee.pop();if(typeof Y!="function")throw new TypeError("The last argument must be of type Function");var L=this,z=function(){return Y.apply(L,arguments)};E.apply(this,ee).then(function(re){process$1.nextTick(z.bind(null,null,re))},function(re){process$1.nextTick(_.bind(null,re,z))})}return Object.setPrototypeOf(j,Object.getPrototypeOf(E)),Object.defineProperties(j,e(E)),j}t.callbackify=q}(util$1)),util$1}var buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function t(v,g){var $=Object.keys(v);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(v);g&&(B=B.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),$.push.apply($,B)}return $}function e(v){for(var g=1;g<arguments.length;g++){var $=arguments[g]!=null?arguments[g]:{};g%2?t(Object($),!0).forEach(function(B){n(v,B,$[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors($)):t(Object($)).forEach(function(B){Object.defineProperty(v,B,Object.getOwnPropertyDescriptor($,B))})}return v}function n(v,g,$){return g=u(g),g in v?Object.defineProperty(v,g,{value:$,enumerable:!0,configurable:!0,writable:!0}):v[g]=$,v}function a(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function c(v,g){for(var $=0;$<g.length;$++){var B=g[$];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(v,u(B.key),B)}}function o(v,g,$){return g&&c(v.prototype,g),Object.defineProperty(v,"prototype",{writable:!1}),v}function u(v){var g=h(v,"string");return typeof g=="symbol"?g:String(g)}function h(v,g){if(typeof v!="object"||v===null)return v;var $=v[Symbol.toPrimitive];if($!==void 0){var B=$.call(v,g||"default");if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(v)}var l=require$$1$2,b=l.Buffer,d=requireUtil$1(),p=d.inspect,x=p&&p.custom||"inspect";function m(v,g,$){b.prototype.copy.call(v,g,$)}return buffer_list=function(){function v(){a(this,v),this.head=null,this.tail=null,this.length=0}return o(v,[{key:"push",value:function($){var B={data:$,next:null};this.length>0?this.tail.next=B:this.head=B,this.tail=B,++this.length}},{key:"unshift",value:function($){var B={data:$,next:this.head};this.length===0&&(this.tail=B),this.head=B,++this.length}},{key:"shift",value:function(){if(this.length!==0){var $=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,$}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function($){if(this.length===0)return"";for(var B=this.head,C=""+B.data;B=B.next;)C+=$+B.data;return C}},{key:"concat",value:function($){if(this.length===0)return b.alloc(0);for(var B=b.allocUnsafe($>>>0),C=this.head,F=0;C;)m(C.data,B,F),F+=C.data.length,C=C.next;return B}},{key:"consume",value:function($,B){var C;return $<this.head.data.length?(C=this.head.data.slice(0,$),this.head.data=this.head.data.slice($)):$===this.head.data.length?C=this.shift():C=B?this._getString($):this._getBuffer($),C}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function($){var B=this.head,C=1,F=B.data;for($-=F.length;B=B.next;){var H=B.data,W=$>H.length?H.length:$;if(W===H.length?F+=H:F+=H.slice(0,$),$-=W,$===0){W===H.length?(++C,B.next?this.head=B.next:this.head=this.tail=null):(this.head=B,B.data=H.slice(W));break}++C}return this.length-=C,F}},{key:"_getBuffer",value:function($){var B=b.allocUnsafe($),C=this.head,F=1;for(C.data.copy(B),$-=C.data.length;C=C.next;){var H=C.data,W=$>H.length?H.length:$;if(H.copy(B,B.length-$,0,W),$-=W,$===0){W===H.length?(++F,C.next?this.head=C.next:this.head=this.tail=null):(this.head=C,C.data=H.slice(W));break}++F}return this.length-=F,B}},{key:x,value:function($,B){return p(this,e(e({},B),{},{depth:0,customInspect:!1}))}}]),v}(),buffer_list}var destroy_1$1,hasRequiredDestroy$1;function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;hasRequiredDestroy$1=1;function t(u,h){var l=this,b=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return b||d?(h?h(u):u&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(c,this,u)):process$1.nextTick(c,this,u)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(p){!h&&p?l._writableState?l._writableState.errorEmitted?process$1.nextTick(n,l):(l._writableState.errorEmitted=!0,process$1.nextTick(e,l,p)):process$1.nextTick(e,l,p):h?(process$1.nextTick(n,l),h(p)):process$1.nextTick(n,l)}),this)}function e(u,h){c(u,h),n(u)}function n(u){u._writableState&&!u._writableState.emitClose||u._readableState&&!u._readableState.emitClose||u.emit("close")}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function c(u,h){u.emit("error",h)}function o(u,h){var l=u._readableState,b=u._writableState;l&&l.autoDestroy||b&&b.autoDestroy?u.destroy(h):u.emit("error",h)}return destroy_1$1={destroy:t,undestroy:a,errorOrDestroy:o},destroy_1$1}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function t(h,l){h.prototype=Object.create(l.prototype),h.prototype.constructor=h,h.__proto__=l}var e={};function n(h,l,b){b||(b=Error);function d(x,m,v){return typeof l=="string"?l:l(x,m,v)}var p=function(x){t(m,x);function m(v,g,$){return x.call(this,d(v,g,$))||this}return m}(b);p.prototype.name=b.name,p.prototype.code=h,e[h]=p}function a(h,l){if(Array.isArray(h)){var b=h.length;return h=h.map(function(d){return String(d)}),b>2?"one of ".concat(l," ").concat(h.slice(0,b-1).join(", "),", or ")+h[b-1]:b===2?"one of ".concat(l," ").concat(h[0]," or ").concat(h[1]):"of ".concat(l," ").concat(h[0])}else return"of ".concat(l," ").concat(String(h))}function c(h,l,b){return h.substr(0,l.length)===l}function o(h,l,b){return(b===void 0||b>h.length)&&(b=h.length),h.substring(b-l.length,b)===l}function u(h,l,b){return typeof b!="number"&&(b=0),b+l.length>h.length?!1:h.indexOf(l,b)!==-1}return n("ERR_INVALID_OPT_VALUE",function(h,l){return'The value "'+l+'" is invalid for option "'+h+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(h,l,b){var d;typeof l=="string"&&c(l,"not ")?(d="must not be",l=l.replace(/^not /,"")):d="must be";var p;if(o(h," argument"))p="The ".concat(h," ").concat(d," ").concat(a(l,"type"));else{var x=u(h,".")?"property":"argument";p='The "'.concat(h,'" ').concat(x," ").concat(d," ").concat(a(l,"type"))}return p+=". Received type ".concat(typeof b),p},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(h){return"The "+h+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(h){return"Cannot call "+h+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(h){return"Unknown encoding: "+h},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=e,errorsBrowser}var state,hasRequiredState;function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var t=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function e(a,c,o){return a.highWaterMark!=null?a.highWaterMark:c?a[o]:null}function n(a,c,o,u){var h=e(c,u,o);if(h!=null){if(!(isFinite(h)&&Math.floor(h)===h)||h<0){var l=u?o:"highWaterMark";throw new t(l,h)}return Math.floor(h)}return a.objectMode?16:16*1024}return state={getHighWaterMark:n},state}var browser$a,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$a;hasRequiredBrowser$a=1,browser$a=t;function t(n,a){if(e("noDeprecation"))return n;var c=!1;function o(){if(!c){if(e("throwDeprecation"))throw new Error(a);e("traceDeprecation")?console.trace(a):console.warn(a),c=!0}return n.apply(this,arguments)}return o}function e(n){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var a=commonjsGlobal.localStorage[n];return a==null?!1:String(a).toLowerCase()==="true"}return browser$a}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=te;function t(Y){var L=this;this.next=null,this.entry=null,this.finish=function(){oe(L,Y)}}var e;te.WritableState=Z;var n={deprecate:requireBrowser$a()},a=requireStreamBrowser$1(),c=require$$1$2.Buffer,o=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(Y){return c.from(Y)}function h(Y){return c.isBuffer(Y)||Y instanceof o}var l=requireDestroy$1(),b=requireState(),d=b.getHighWaterMark,p=requireErrorsBrowser().codes,x=p.ERR_INVALID_ARG_TYPE,m=p.ERR_METHOD_NOT_IMPLEMENTED,v=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,$=p.ERR_STREAM_DESTROYED,B=p.ERR_STREAM_NULL_VALUES,C=p.ERR_STREAM_WRITE_AFTER_END,F=p.ERR_UNKNOWN_ENCODING,H=l.errorOrDestroy;inherits_browserExports(te,a);function W(){}function Z(Y,L,z){e=e||require_stream_duplex$1(),Y=Y||{},typeof z!="boolean"&&(z=L instanceof e),this.objectMode=!!Y.objectMode,z&&(this.objectMode=this.objectMode||!!Y.writableObjectMode),this.highWaterMark=d(this,Y,"writableHighWaterMark",z),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var re=Y.decodeStrings===!1;this.decodeStrings=!re,this.defaultEncoding=Y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(D){I(L,D)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Y.emitClose!==!1,this.autoDestroy=!!Y.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}Z.prototype.getBuffer=function(){for(var L=this.bufferedRequest,z=[];L;)z.push(L),L=L.next;return z},function(){try{Object.defineProperty(Z.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ie;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ie=Function.prototype[Symbol.hasInstance],Object.defineProperty(te,Symbol.hasInstance,{value:function(L){return ie.call(this,L)?!0:this!==te?!1:L&&L._writableState instanceof Z}})):ie=function(L){return L instanceof this};function te(Y){e=e||require_stream_duplex$1();var L=this instanceof e;if(!L&&!ie.call(te,this))return new te(Y);this._writableState=new Z(Y,this,L),this.writable=!0,Y&&(typeof Y.write=="function"&&(this._write=Y.write),typeof Y.writev=="function"&&(this._writev=Y.writev),typeof Y.destroy=="function"&&(this._destroy=Y.destroy),typeof Y.final=="function"&&(this._final=Y.final)),a.call(this)}te.prototype.pipe=function(){H(this,new g)};function ae(Y,L){var z=new C;H(Y,z),process$1.nextTick(L,z)}function de(Y,L,z,re){var D;return z===null?D=new B:typeof z!="string"&&!L.objectMode&&(D=new x("chunk",["string","Buffer"],z)),D?(H(Y,D),process$1.nextTick(re,D),!1):!0}te.prototype.write=function(Y,L,z){var re=this._writableState,D=!1,G=!re.objectMode&&h(Y);return G&&!c.isBuffer(Y)&&(Y=u(Y)),typeof L=="function"&&(z=L,L=null),G?L="buffer":L||(L=re.defaultEncoding),typeof z!="function"&&(z=W),re.ending?ae(this,z):(G||de(this,re,Y,z))&&(re.pendingcb++,D=R(this,re,G,Y,L,z)),D},te.prototype.cork=function(){this._writableState.corked++},te.prototype.uncork=function(){var Y=this._writableState;Y.corked&&(Y.corked--,!Y.writing&&!Y.corked&&!Y.bufferProcessing&&Y.bufferedRequest&&P(this,Y))},te.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=L.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((L+"").toLowerCase())>-1))throw new F(L);return this._writableState.defaultEncoding=L,this},Object.defineProperty(te.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function J(Y,L,z){return!Y.objectMode&&Y.decodeStrings!==!1&&typeof L=="string"&&(L=c.from(L,z)),L}Object.defineProperty(te.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function R(Y,L,z,re,D,G){if(!z){var U=J(L,re,D);re!==U&&(z=!0,D="buffer",re=U)}var Q=L.objectMode?1:re.length;L.length+=Q;var fe=L.length<L.highWaterMark;if(fe||(L.needDrain=!0),L.writing||L.corked){var he=L.lastBufferedRequest;L.lastBufferedRequest={chunk:re,encoding:D,isBuf:z,callback:G,next:null},he?he.next=L.lastBufferedRequest:L.bufferedRequest=L.lastBufferedRequest,L.bufferedRequestCount+=1}else A(Y,L,!1,Q,re,D,G);return fe}function A(Y,L,z,re,D,G,U){L.writelen=re,L.writecb=U,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new $("write")):z?Y._writev(D,L.onwrite):Y._write(D,G,L.onwrite),L.sync=!1}function y(Y,L,z,re,D){--L.pendingcb,z?(process$1.nextTick(D,re),process$1.nextTick(j,Y,L),Y._writableState.errorEmitted=!0,H(Y,re)):(D(re),Y._writableState.errorEmitted=!0,H(Y,re),j(Y,L))}function w(Y){Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0}function I(Y,L){var z=Y._writableState,re=z.sync,D=z.writecb;if(typeof D!="function")throw new v;if(w(z),L)y(Y,z,re,L,D);else{var G=_(z)||Y.destroyed;!G&&!z.corked&&!z.bufferProcessing&&z.bufferedRequest&&P(Y,z),re?process$1.nextTick(M,Y,z,G,D):M(Y,z,G,D)}}function M(Y,L,z,re){z||k(Y,L),L.pendingcb--,re(),j(Y,L)}function k(Y,L){L.length===0&&L.needDrain&&(L.needDrain=!1,Y.emit("drain"))}function P(Y,L){L.bufferProcessing=!0;var z=L.bufferedRequest;if(Y._writev&&z&&z.next){var re=L.bufferedRequestCount,D=new Array(re),G=L.corkedRequestsFree;G.entry=z;for(var U=0,Q=!0;z;)D[U]=z,z.isBuf||(Q=!1),z=z.next,U+=1;D.allBuffers=Q,A(Y,L,!0,L.length,D,"",G.finish),L.pendingcb++,L.lastBufferedRequest=null,G.next?(L.corkedRequestsFree=G.next,G.next=null):L.corkedRequestsFree=new t(L),L.bufferedRequestCount=0}else{for(;z;){var fe=z.chunk,he=z.encoding,le=z.callback,pe=L.objectMode?1:fe.length;if(A(Y,L,!1,pe,fe,he,le),z=z.next,L.bufferedRequestCount--,L.writing)break}z===null&&(L.lastBufferedRequest=null)}L.bufferedRequest=z,L.bufferProcessing=!1}te.prototype._write=function(Y,L,z){z(new m("_write()"))},te.prototype._writev=null,te.prototype.end=function(Y,L,z){var re=this._writableState;return typeof Y=="function"?(z=Y,Y=null,L=null):typeof L=="function"&&(z=L,L=null),Y!=null&&this.write(Y,L),re.corked&&(re.corked=1,this.uncork()),re.ending||ee(this,re,z),this},Object.defineProperty(te.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function _(Y){return Y.ending&&Y.length===0&&Y.bufferedRequest===null&&!Y.finished&&!Y.writing}function q(Y,L){Y._final(function(z){L.pendingcb--,z&&H(Y,z),L.prefinished=!0,Y.emit("prefinish"),j(Y,L)})}function E(Y,L){!L.prefinished&&!L.finalCalled&&(typeof Y._final=="function"&&!L.destroyed?(L.pendingcb++,L.finalCalled=!0,process$1.nextTick(q,Y,L)):(L.prefinished=!0,Y.emit("prefinish")))}function j(Y,L){var z=_(L);if(z&&(E(Y,L),L.pendingcb===0&&(L.finished=!0,Y.emit("finish"),L.autoDestroy))){var re=Y._readableState;(!re||re.autoDestroy&&re.endEmitted)&&Y.destroy()}return z}function ee(Y,L,z){L.ending=!0,j(Y,L),z&&(L.finished?process$1.nextTick(z):Y.once("finish",z)),L.ended=!0,Y.writable=!1}function oe(Y,L,z){var re=Y.entry;for(Y.entry=null;re;){var D=re.callback;L.pendingcb--,D(z),re=re.next}L.corkedRequestsFree.next=Y}return Object.defineProperty(te.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(L){this._writableState&&(this._writableState.destroyed=L)}}),te.prototype.destroy=l.destroy,te.prototype._undestroy=l.undestroy,te.prototype._destroy=function(Y,L){L(Y)},_stream_writable$1}var _stream_duplex$1,hasRequired_stream_duplex$1;function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var t=Object.keys||function(b){var d=[];for(var p in b)d.push(p);return d};_stream_duplex$1=u;var e=require_stream_readable$1(),n=require_stream_writable$1();inherits_browserExports(u,e);for(var a=t(n.prototype),c=0;c<a.length;c++){var o=a[c];u.prototype[o]||(u.prototype[o]=n.prototype[o])}function u(b){if(!(this instanceof u))return new u(b);e.call(this,b),n.call(this,b),this.allowHalfOpen=!0,b&&(b.readable===!1&&(this.readable=!1),b.writable===!1&&(this.writable=!1),b.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",h)))}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function h(){this._writableState.ended||process$1.nextTick(l,this)}function l(b){b.end()}return Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),_stream_duplex$1}var string_decoder={},hasRequiredString_decoder;function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var t=requireSafeBuffer$1().Buffer,e=t.isEncoding||function(B){switch(B=""+B,B&&B.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 n(B){if(!B)return"utf8";for(var C;;)switch(B){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 B;default:if(C)return;B=(""+B).toLowerCase(),C=!0}}function a(B){var C=n(B);if(typeof C!="string"&&(t.isEncoding===e||!e(B)))throw new Error("Unknown encoding: "+B);return C||B}string_decoder.StringDecoder=c;function c(B){this.encoding=a(B);var C;switch(this.encoding){case"utf16le":this.text=p,this.end=x,C=4;break;case"utf8":this.fillLast=l,C=4;break;case"base64":this.text=m,this.end=v,C=3;break;default:this.write=g,this.end=$;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(C)}c.prototype.write=function(B){if(B.length===0)return"";var C,F;if(this.lastNeed){if(C=this.fillLast(B),C===void 0)return"";F=this.lastNeed,this.lastNeed=0}else F=0;return F<B.length?C?C+this.text(B,F):this.text(B,F):C||""},c.prototype.end=d,c.prototype.text=b,c.prototype.fillLast=function(B){if(this.lastNeed<=B.length)return B.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);B.copy(this.lastChar,this.lastTotal-this.lastNeed,0,B.length),this.lastNeed-=B.length};function o(B){return B<=127?0:B>>5===6?2:B>>4===14?3:B>>3===30?4:B>>6===2?-1:-2}function u(B,C,F){var H=C.length-1;if(H<F)return 0;var W=o(C[H]);return W>=0?(W>0&&(B.lastNeed=W-1),W):--H<F||W===-2?0:(W=o(C[H]),W>=0?(W>0&&(B.lastNeed=W-2),W):--H<F||W===-2?0:(W=o(C[H]),W>=0?(W>0&&(W===2?W=0:B.lastNeed=W-3),W):0))}function h(B,C,F){if((C[0]&192)!==128)return B.lastNeed=0,"�";if(B.lastNeed>1&&C.length>1){if((C[1]&192)!==128)return B.lastNeed=1,"�";if(B.lastNeed>2&&C.length>2&&(C[2]&192)!==128)return B.lastNeed=2,"�"}}function l(B){var C=this.lastTotal-this.lastNeed,F=h(this,B);if(F!==void 0)return F;if(this.lastNeed<=B.length)return B.copy(this.lastChar,C,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);B.copy(this.lastChar,C,0,B.length),this.lastNeed-=B.length}function b(B,C){var F=u(this,B,C);if(!this.lastNeed)return B.toString("utf8",C);this.lastTotal=F;var H=B.length-(F-this.lastNeed);return B.copy(this.lastChar,0,H),B.toString("utf8",C,H)}function d(B){var C=B&&B.length?this.write(B):"";return this.lastNeed?C+"�":C}function p(B,C){if((B.length-C)%2===0){var F=B.toString("utf16le",C);if(F){var H=F.charCodeAt(F.length-1);if(H>=55296&&H<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=B[B.length-2],this.lastChar[1]=B[B.length-1],F.slice(0,-1)}return F}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=B[B.length-1],B.toString("utf16le",C,B.length-1)}function x(B){var C=B&&B.length?this.write(B):"";if(this.lastNeed){var F=this.lastTotal-this.lastNeed;return C+this.lastChar.toString("utf16le",0,F)}return C}function m(B,C){var F=(B.length-C)%3;return F===0?B.toString("base64",C):(this.lastNeed=3-F,this.lastTotal=3,F===1?this.lastChar[0]=B[B.length-1]:(this.lastChar[0]=B[B.length-2],this.lastChar[1]=B[B.length-1]),B.toString("base64",C,B.length-F))}function v(B){var C=B&&B.length?this.write(B):"";return this.lastNeed?C+this.lastChar.toString("base64",0,3-this.lastNeed):C}function g(B){return B.toString(this.encoding)}function $(B){return B&&B.length?this.write(B):""}return string_decoder}var endOfStream,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var t=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function e(o){var u=!1;return function(){if(!u){u=!0;for(var h=arguments.length,l=new Array(h),b=0;b<h;b++)l[b]=arguments[b];o.apply(this,l)}}}function n(){}function a(o){return o.setHeader&&typeof o.abort=="function"}function c(o,u,h){if(typeof u=="function")return c(o,null,u);u||(u={}),h=e(h||n);var l=u.readable||u.readable!==!1&&o.readable,b=u.writable||u.writable!==!1&&o.writable,d=function(){o.writable||x()},p=o._writableState&&o._writableState.finished,x=function(){b=!1,p=!0,l||h.call(o)},m=o._readableState&&o._readableState.endEmitted,v=function(){l=!1,m=!0,b||h.call(o)},g=function(F){h.call(o,F)},$=function(){var F;if(l&&!m)return(!o._readableState||!o._readableState.ended)&&(F=new t),h.call(o,F);if(b&&!p)return(!o._writableState||!o._writableState.ended)&&(F=new t),h.call(o,F)},B=function(){o.req.on("finish",x)};return a(o)?(o.on("complete",x),o.on("abort",$),o.req?B():o.on("request",B)):b&&!o._writableState&&(o.on("end",d),o.on("close",d)),o.on("end",v),o.on("finish",x),u.error!==!1&&o.on("error",g),o.on("close",$),function(){o.removeListener("complete",x),o.removeListener("abort",$),o.removeListener("request",B),o.req&&o.req.removeListener("finish",x),o.removeListener("end",d),o.removeListener("close",d),o.removeListener("finish",x),o.removeListener("end",v),o.removeListener("error",g),o.removeListener("close",$)}}return endOfStream=c,endOfStream}var async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var t;function e(F,H,W){return H=n(H),H in F?Object.defineProperty(F,H,{value:W,enumerable:!0,configurable:!0,writable:!0}):F[H]=W,F}function n(F){var H=a(F,"string");return typeof H=="symbol"?H:String(H)}function a(F,H){if(typeof F!="object"||F===null)return F;var W=F[Symbol.toPrimitive];if(W!==void 0){var Z=W.call(F,H||"default");if(typeof Z!="object")return Z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(H==="string"?String:Number)(F)}var c=requireEndOfStream(),o=Symbol("lastResolve"),u=Symbol("lastReject"),h=Symbol("error"),l=Symbol("ended"),b=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function x(F,H){return{value:F,done:H}}function m(F){var H=F[o];if(H!==null){var W=F[p].read();W!==null&&(F[b]=null,F[o]=null,F[u]=null,H(x(W,!1)))}}function v(F){process$1.nextTick(m,F)}function g(F,H){return function(W,Z){F.then(function(){if(H[l]){W(x(void 0,!0));return}H[d](W,Z)},Z)}}var $=Object.getPrototypeOf(function(){}),B=Object.setPrototypeOf((t={get stream(){return this[p]},next:function(){var H=this,W=this[h];if(W!==null)return Promise.reject(W);if(this[l])return Promise.resolve(x(void 0,!0));if(this[p].destroyed)return new Promise(function(ae,de){process$1.nextTick(function(){H[h]?de(H[h]):ae(x(void 0,!0))})});var Z=this[b],ie;if(Z)ie=new Promise(g(Z,this));else{var te=this[p].read();if(te!==null)return Promise.resolve(x(te,!1));ie=new Promise(this[d])}return this[b]=ie,ie}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var H=this;return new Promise(function(W,Z){H[p].destroy(null,function(ie){if(ie){Z(ie);return}W(x(void 0,!0))})})}),t),$),C=function(H){var W,Z=Object.create(B,(W={},e(W,p,{value:H,writable:!0}),e(W,o,{value:null,writable:!0}),e(W,u,{value:null,writable:!0}),e(W,h,{value:null,writable:!0}),e(W,l,{value:H._readableState.endEmitted,writable:!0}),e(W,d,{value:function(te,ae){var de=Z[p].read();de?(Z[b]=null,Z[o]=null,Z[u]=null,te(x(de,!1))):(Z[o]=te,Z[u]=ae)},writable:!0}),W));return Z[b]=null,c(H,function(ie){if(ie&&ie.code!=="ERR_STREAM_PREMATURE_CLOSE"){var te=Z[u];te!==null&&(Z[b]=null,Z[o]=null,Z[u]=null,te(ie)),Z[h]=ie;return}var ae=Z[o];ae!==null&&(Z[b]=null,Z[o]=null,Z[u]=null,ae(x(void 0,!0))),Z[l]=!0}),H.on("readable",v.bind(null,Z)),Z};return async_iterator=C,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1,_stream_readable$1=ae;var t;ae.ReadableState=te,requireEvents().EventEmitter;var e=function(U,Q){return U.listeners(Q).length},n=requireStreamBrowser$1(),a=require$$1$2.Buffer,c=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(G){return a.from(G)}function u(G){return a.isBuffer(G)||G instanceof c}var h=requireUtil$1(),l;h&&h.debuglog?l=h.debuglog("stream"):l=function(){};var b=requireBuffer_list(),d=requireDestroy$1(),p=requireState(),x=p.getHighWaterMark,m=requireErrorsBrowser().codes,v=m.ERR_INVALID_ARG_TYPE,g=m.ERR_STREAM_PUSH_AFTER_EOF,$=m.ERR_METHOD_NOT_IMPLEMENTED,B=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,C,F,H;inherits_browserExports(ae,n);var W=d.errorOrDestroy,Z=["error","close","destroy","pause","resume"];function ie(G,U,Q){if(typeof G.prependListener=="function")return G.prependListener(U,Q);!G._events||!G._events[U]?G.on(U,Q):Array.isArray(G._events[U])?G._events[U].unshift(Q):G._events[U]=[Q,G._events[U]]}function te(G,U,Q){t=t||require_stream_duplex$1(),G=G||{},typeof Q!="boolean"&&(Q=U instanceof t),this.objectMode=!!G.objectMode,Q&&(this.objectMode=this.objectMode||!!G.readableObjectMode),this.highWaterMark=x(this,G,"readableHighWaterMark",Q),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=G.emitClose!==!1,this.autoDestroy=!!G.autoDestroy,this.destroyed=!1,this.defaultEncoding=G.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,G.encoding&&(C||(C=requireString_decoder().StringDecoder),this.decoder=new C(G.encoding),this.encoding=G.encoding)}function ae(G){if(t=t||require_stream_duplex$1(),!(this instanceof ae))return new ae(G);var U=this instanceof t;this._readableState=new te(G,this,U),this.readable=!0,G&&(typeof G.read=="function"&&(this._read=G.read),typeof G.destroy=="function"&&(this._destroy=G.destroy)),n.call(this)}Object.defineProperty(ae.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(U){this._readableState&&(this._readableState.destroyed=U)}}),ae.prototype.destroy=d.destroy,ae.prototype._undestroy=d.undestroy,ae.prototype._destroy=function(G,U){U(G)},ae.prototype.push=function(G,U){var Q=this._readableState,fe;return Q.objectMode?fe=!0:typeof G=="string"&&(U=U||Q.defaultEncoding,U!==Q.encoding&&(G=a.from(G,U),U=""),fe=!0),de(this,G,U,!1,fe)},ae.prototype.unshift=function(G){return de(this,G,null,!0,!1)};function de(G,U,Q,fe,he){l("readableAddChunk",U);var le=G._readableState;if(U===null)le.reading=!1,I(G,le);else{var pe;if(he||(pe=R(le,U)),pe)W(G,pe);else if(le.objectMode||U&&U.length>0)if(typeof U!="string"&&!le.objectMode&&Object.getPrototypeOf(U)!==a.prototype&&(U=o(U)),fe)le.endEmitted?W(G,new B):J(G,le,U,!0);else if(le.ended)W(G,new g);else{if(le.destroyed)return!1;le.reading=!1,le.decoder&&!Q?(U=le.decoder.write(U),le.objectMode||U.length!==0?J(G,le,U,!1):P(G,le)):J(G,le,U,!1)}else fe||(le.reading=!1,P(G,le))}return!le.ended&&(le.length<le.highWaterMark||le.length===0)}function J(G,U,Q,fe){U.flowing&&U.length===0&&!U.sync?(U.awaitDrain=0,G.emit("data",Q)):(U.length+=U.objectMode?1:Q.length,fe?U.buffer.unshift(Q):U.buffer.push(Q),U.needReadable&&M(G)),P(G,U)}function R(G,U){var Q;return!u(U)&&typeof U!="string"&&U!==void 0&&!G.objectMode&&(Q=new v("chunk",["string","Buffer","Uint8Array"],U)),Q}ae.prototype.isPaused=function(){return this._readableState.flowing===!1},ae.prototype.setEncoding=function(G){C||(C=requireString_decoder().StringDecoder);var U=new C(G);this._readableState.decoder=U,this._readableState.encoding=this._readableState.decoder.encoding;for(var Q=this._readableState.buffer.head,fe="";Q!==null;)fe+=U.write(Q.data),Q=Q.next;return this._readableState.buffer.clear(),fe!==""&&this._readableState.buffer.push(fe),this._readableState.length=fe.length,this};var A=1073741824;function y(G){return G>=A?G=A:(G--,G|=G>>>1,G|=G>>>2,G|=G>>>4,G|=G>>>8,G|=G>>>16,G++),G}function w(G,U){return G<=0||U.length===0&&U.ended?0:U.objectMode?1:G!==G?U.flowing&&U.length?U.buffer.head.data.length:U.length:(G>U.highWaterMark&&(U.highWaterMark=y(G)),G<=U.length?G:U.ended?U.length:(U.needReadable=!0,0))}ae.prototype.read=function(G){l("read",G),G=parseInt(G,10);var U=this._readableState,Q=G;if(G!==0&&(U.emittedReadable=!1),G===0&&U.needReadable&&((U.highWaterMark!==0?U.length>=U.highWaterMark:U.length>0)||U.ended))return l("read: emitReadable",U.length,U.ended),U.length===0&&U.ended?z(this):M(this),null;if(G=w(G,U),G===0&&U.ended)return U.length===0&&z(this),null;var fe=U.needReadable;l("need readable",fe),(U.length===0||U.length-G<U.highWaterMark)&&(fe=!0,l("length less than watermark",fe)),U.ended||U.reading?(fe=!1,l("reading or ended",fe)):fe&&(l("do read"),U.reading=!0,U.sync=!0,U.length===0&&(U.needReadable=!0),this._read(U.highWaterMark),U.sync=!1,U.reading||(G=w(Q,U)));var he;return G>0?he=L(G,U):he=null,he===null?(U.needReadable=U.length<=U.highWaterMark,G=0):(U.length-=G,U.awaitDrain=0),U.length===0&&(U.ended||(U.needReadable=!0),Q!==G&&U.ended&&z(this)),he!==null&&this.emit("data",he),he};function I(G,U){if(l("onEofChunk"),!U.ended){if(U.decoder){var Q=U.decoder.end();Q&&Q.length&&(U.buffer.push(Q),U.length+=U.objectMode?1:Q.length)}U.ended=!0,U.sync?M(G):(U.needReadable=!1,U.emittedReadable||(U.emittedReadable=!0,k(G)))}}function M(G){var U=G._readableState;l("emitReadable",U.needReadable,U.emittedReadable),U.needReadable=!1,U.emittedReadable||(l("emitReadable",U.flowing),U.emittedReadable=!0,process$1.nextTick(k,G))}function k(G){var U=G._readableState;l("emitReadable_",U.destroyed,U.length,U.ended),!U.destroyed&&(U.length||U.ended)&&(G.emit("readable"),U.emittedReadable=!1),U.needReadable=!U.flowing&&!U.ended&&U.length<=U.highWaterMark,Y(G)}function P(G,U){U.readingMore||(U.readingMore=!0,process$1.nextTick(_,G,U))}function _(G,U){for(;!U.reading&&!U.ended&&(U.length<U.highWaterMark||U.flowing&&U.length===0);){var Q=U.length;if(l("maybeReadMore read 0"),G.read(0),Q===U.length)break}U.readingMore=!1}ae.prototype._read=function(G){W(this,new $("_read()"))},ae.prototype.pipe=function(G,U){var Q=this,fe=this._readableState;switch(fe.pipesCount){case 0:fe.pipes=G;break;case 1:fe.pipes=[fe.pipes,G];break;default:fe.pipes.push(G);break}fe.pipesCount+=1,l("pipe count=%d opts=%j",fe.pipesCount,U);var he=(!U||U.end!==!1)&&G!==process$1.stdout&&G!==process$1.stderr,le=he?be:De;fe.endEmitted?process$1.nextTick(le):Q.once("end",le),G.on("unpipe",pe);function pe(Se,Oe){l("onunpipe"),Se===Q&&Oe&&Oe.hasUnpiped===!1&&(Oe.hasUnpiped=!0,ye())}function be(){l("onend"),G.end()}var se=q(Q);G.on("drain",se);var ge=!1;function ye(){l("cleanup"),G.removeListener("close",ve),G.removeListener("finish",Be),G.removeListener("drain",se),G.removeListener("error",Ne),G.removeListener("unpipe",pe),Q.removeListener("end",be),Q.removeListener("end",De),Q.removeListener("data",$e),ge=!0,fe.awaitDrain&&(!G._writableState||G._writableState.needDrain)&&se()}Q.on("data",$e);function $e(Se){l("ondata");var Oe=G.write(Se);l("dest.write",Oe),Oe===!1&&((fe.pipesCount===1&&fe.pipes===G||fe.pipesCount>1&&D(fe.pipes,G)!==-1)&&!ge&&(l("false write response, pause",fe.awaitDrain),fe.awaitDrain++),Q.pause())}function Ne(Se){l("onerror",Se),De(),G.removeListener("error",Ne),e(G,"error")===0&&W(G,Se)}ie(G,"error",Ne);function ve(){G.removeListener("finish",Be),De()}G.once("close",ve);function Be(){l("onfinish"),G.removeListener("close",ve),De()}G.once("finish",Be);function De(){l("unpipe"),Q.unpipe(G)}return G.emit("pipe",Q),fe.flowing||(l("pipe resume"),Q.resume()),G};function q(G){return function(){var Q=G._readableState;l("pipeOnDrain",Q.awaitDrain),Q.awaitDrain&&Q.awaitDrain--,Q.awaitDrain===0&&e(G,"data")&&(Q.flowing=!0,Y(G))}}ae.prototype.unpipe=function(G){var U=this._readableState,Q={hasUnpiped:!1};if(U.pipesCount===0)return this;if(U.pipesCount===1)return G&&G!==U.pipes?this:(G||(G=U.pipes),U.pipes=null,U.pipesCount=0,U.flowing=!1,G&&G.emit("unpipe",this,Q),this);if(!G){var fe=U.pipes,he=U.pipesCount;U.pipes=null,U.pipesCount=0,U.flowing=!1;for(var le=0;le<he;le++)fe[le].emit("unpipe",this,{hasUnpiped:!1});return this}var pe=D(U.pipes,G);return pe===-1?this:(U.pipes.splice(pe,1),U.pipesCount-=1,U.pipesCount===1&&(U.pipes=U.pipes[0]),G.emit("unpipe",this,Q),this)},ae.prototype.on=function(G,U){var Q=n.prototype.on.call(this,G,U),fe=this._readableState;return G==="data"?(fe.readableListening=this.listenerCount("readable")>0,fe.flowing!==!1&&this.resume()):G==="readable"&&!fe.endEmitted&&!fe.readableListening&&(fe.readableListening=fe.needReadable=!0,fe.flowing=!1,fe.emittedReadable=!1,l("on readable",fe.length,fe.reading),fe.length?M(this):fe.reading||process$1.nextTick(j,this)),Q},ae.prototype.addListener=ae.prototype.on,ae.prototype.removeListener=function(G,U){var Q=n.prototype.removeListener.call(this,G,U);return G==="readable"&&process$1.nextTick(E,this),Q},ae.prototype.removeAllListeners=function(G){var U=n.prototype.removeAllListeners.apply(this,arguments);return(G==="readable"||G===void 0)&&process$1.nextTick(E,this),U};function E(G){var U=G._readableState;U.readableListening=G.listenerCount("readable")>0,U.resumeScheduled&&!U.paused?U.flowing=!0:G.listenerCount("data")>0&&G.resume()}function j(G){l("readable nexttick read 0"),G.read(0)}ae.prototype.resume=function(){var G=this._readableState;return G.flowing||(l("resume"),G.flowing=!G.readableListening,ee(this,G)),G.paused=!1,this};function ee(G,U){U.resumeScheduled||(U.resumeScheduled=!0,process$1.nextTick(oe,G,U))}function oe(G,U){l("resume",U.reading),U.reading||G.read(0),U.resumeScheduled=!1,G.emit("resume"),Y(G),U.flowing&&!U.reading&&G.read(0)}ae.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Y(G){var U=G._readableState;for(l("flow",U.flowing);U.flowing&&G.read()!==null;);}ae.prototype.wrap=function(G){var U=this,Q=this._readableState,fe=!1;G.on("end",function(){if(l("wrapped end"),Q.decoder&&!Q.ended){var pe=Q.decoder.end();pe&&pe.length&&U.push(pe)}U.push(null)}),G.on("data",function(pe){if(l("wrapped data"),Q.decoder&&(pe=Q.decoder.write(pe)),!(Q.objectMode&&pe==null)&&!(!Q.objectMode&&(!pe||!pe.length))){var be=U.push(pe);be||(fe=!0,G.pause())}});for(var he in G)this[he]===void 0&&typeof G[he]=="function"&&(this[he]=function(be){return function(){return G[be].apply(G,arguments)}}(he));for(var le=0;le<Z.length;le++)G.on(Z[le],this.emit.bind(this,Z[le]));return this._read=function(pe){l("wrapped _read",pe),fe&&(fe=!1,G.resume())},this},typeof Symbol=="function"&&(ae.prototype[Symbol.asyncIterator]=function(){return F===void 0&&(F=requireAsync_iterator()),F(this)}),Object.defineProperty(ae.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(ae.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(ae.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(U){this._readableState&&(this._readableState.flowing=U)}}),ae._fromList=L,Object.defineProperty(ae.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function L(G,U){if(U.length===0)return null;var Q;return U.objectMode?Q=U.buffer.shift():!G||G>=U.length?(U.decoder?Q=U.buffer.join(""):U.buffer.length===1?Q=U.buffer.first():Q=U.buffer.concat(U.length),U.buffer.clear()):Q=U.buffer.consume(G,U.decoder),Q}function z(G){var U=G._readableState;l("endReadable",U.endEmitted),U.endEmitted||(U.ended=!0,process$1.nextTick(re,U,G))}function re(G,U){if(l("endReadableNT",G.endEmitted,G.length),!G.endEmitted&&G.length===0&&(G.endEmitted=!0,U.readable=!1,U.emit("end"),G.autoDestroy)){var Q=U._writableState;(!Q||Q.autoDestroy&&Q.finished)&&U.destroy()}}typeof Symbol=="function"&&(ae.from=function(G,U){return H===void 0&&(H=requireFromBrowser()),H(ae,G,U)});function D(G,U){for(var Q=0,fe=G.length;Q<fe;Q++)if(G[Q]===U)return Q;return-1}return _stream_readable$1}var _stream_transform$1,hasRequired_stream_transform$1;function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=h;var t=requireErrorsBrowser().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,a=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,c=t.ERR_TRANSFORM_WITH_LENGTH_0,o=require_stream_duplex$1();inherits_browserExports(h,o);function u(d,p){var x=this._transformState;x.transforming=!1;var m=x.writecb;if(m===null)return this.emit("error",new n);x.writechunk=null,x.writecb=null,p!=null&&this.push(p),m(d);var v=this._readableState;v.reading=!1,(v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}function h(d){if(!(this instanceof h))return new h(d);o.call(this,d),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",l)}function l(){var d=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(p,x){b(d,p,x)}):b(this,null,null)}h.prototype.push=function(d,p){return this._transformState.needTransform=!1,o.prototype.push.call(this,d,p)},h.prototype._transform=function(d,p,x){x(new e("_transform()"))},h.prototype._write=function(d,p,x){var m=this._transformState;if(m.writecb=x,m.writechunk=d,m.writeencoding=p,!m.transforming){var v=this._readableState;(m.needTransform||v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}},h.prototype._read=function(d){var p=this._transformState;p.writechunk!==null&&!p.transforming?(p.transforming=!0,this._transform(p.writechunk,p.writeencoding,p.afterTransform)):p.needTransform=!0},h.prototype._destroy=function(d,p){o.prototype._destroy.call(this,d,function(x){p(x)})};function b(d,p,x){if(p)return d.emit("error",p);if(x!=null&&d.push(x),d._writableState.length)throw new c;if(d._transformState.transforming)throw new a;return d.push(null)}return _stream_transform$1}var _stream_passthrough$1,hasRequired_stream_passthrough$1;function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=e;var t=require_stream_transform$1();inherits_browserExports(e,t);function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}return e.prototype._transform=function(n,a,c){c(null,n)},_stream_passthrough$1}var pipeline_1,hasRequiredPipeline;function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;hasRequiredPipeline=1;var t;function e(x){var m=!1;return function(){m||(m=!0,x.apply(void 0,arguments))}}var n=requireErrorsBrowser().codes,a=n.ERR_MISSING_ARGS,c=n.ERR_STREAM_DESTROYED;function o(x){if(x)throw x}function u(x){return x.setHeader&&typeof x.abort=="function"}function h(x,m,v,g){g=e(g);var $=!1;x.on("close",function(){$=!0}),t===void 0&&(t=requireEndOfStream()),t(x,{readable:m,writable:v},function(C){if(C)return g(C);$=!0,g()});var B=!1;return function(C){if(!$&&!B){if(B=!0,u(x))return x.abort();if(typeof x.destroy=="function")return x.destroy();g(C||new c("pipe"))}}}function l(x){x()}function b(x,m){return x.pipe(m)}function d(x){return!x.length||typeof x[x.length-1]!="function"?o:x.pop()}function p(){for(var x=arguments.length,m=new Array(x),v=0;v<x;v++)m[v]=arguments[v];var g=d(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new a("streams");var $,B=m.map(function(C,F){var H=F<m.length-1,W=F>0;return h(C,H,W,function(Z){$||($=Z),Z&&B.forEach(l),!H&&(B.forEach(l),g($))})});return m.reduce(b)}return pipeline_1=p,pipeline_1}var hasRequiredReadableBrowser$1;function requireReadableBrowser$1(){return hasRequiredReadableBrowser$1||(hasRequiredReadableBrowser$1=1,function(t,e){e=t.exports=require_stream_readable$1(),e.Stream=e,e.Readable=e,e.Writable=require_stream_writable$1(),e.Duplex=require_stream_duplex$1(),e.Transform=require_stream_transform$1(),e.PassThrough=require_stream_passthrough$1(),e.finished=requireEndOfStream(),e.pipeline=requirePipeline()}(readableBrowser$1,readableBrowser$1.exports)),readableBrowser$1.exports}var hashBase,hasRequiredHashBase;function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var t=requireSafeBuffer$1().Buffer,e=requireReadableBrowser$1().Transform,n=inherits_browserExports;function a(o,u){if(!t.isBuffer(o)&&typeof o!="string")throw new TypeError(u+" must be a string or a buffer")}function c(o){e.call(this),this._block=t.allocUnsafe(o),this._blockSize=o,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return n(c,e),c.prototype._transform=function(o,u,h){var l=null;try{this.update(o,u)}catch(b){l=b}h(l)},c.prototype._flush=function(o){var u=null;try{this.push(this.digest())}catch(h){u=h}o(u)},c.prototype.update=function(o,u){if(a(o,"Data"),this._finalized)throw new Error("Digest already called");t.isBuffer(o)||(o=t.from(o,u));for(var h=this._block,l=0;this._blockOffset+o.length-l>=this._blockSize;){for(var b=this._blockOffset;b<this._blockSize;)h[b++]=o[l++];this._update(),this._blockOffset=0}for(;l<o.length;)h[this._blockOffset++]=o[l++];for(var d=0,p=o.length*8;p>0;++d)this._length[d]+=p,p=this._length[d]/4294967296|0,p>0&&(this._length[d]-=4294967296*p);return this},c.prototype._update=function(){throw new Error("_update is not implemented")},c.prototype.digest=function(o){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var u=this._digest();o!==void 0&&(u=u.toString(o)),this._block.fill(0),this._blockOffset=0;for(var h=0;h<4;++h)this._length[h]=0;return u},c.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=c,hashBase}var md5_js,hasRequiredMd5_js;function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var t=inherits_browserExports,e=requireHashBase(),n=requireSafeBuffer$1().Buffer,a=new Array(16);function c(){e.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}t(c,e),c.prototype._update=function(){for(var d=a,p=0;p<16;++p)d[p]=this._block.readInt32LE(p*4);var x=this._a,m=this._b,v=this._c,g=this._d;x=u(x,m,v,g,d[0],3614090360,7),g=u(g,x,m,v,d[1],3905402710,12),v=u(v,g,x,m,d[2],606105819,17),m=u(m,v,g,x,d[3],3250441966,22),x=u(x,m,v,g,d[4],4118548399,7),g=u(g,x,m,v,d[5],1200080426,12),v=u(v,g,x,m,d[6],2821735955,17),m=u(m,v,g,x,d[7],4249261313,22),x=u(x,m,v,g,d[8],1770035416,7),g=u(g,x,m,v,d[9],2336552879,12),v=u(v,g,x,m,d[10],4294925233,17),m=u(m,v,g,x,d[11],2304563134,22),x=u(x,m,v,g,d[12],1804603682,7),g=u(g,x,m,v,d[13],4254626195,12),v=u(v,g,x,m,d[14],2792965006,17),m=u(m,v,g,x,d[15],1236535329,22),x=h(x,m,v,g,d[1],4129170786,5),g=h(g,x,m,v,d[6],3225465664,9),v=h(v,g,x,m,d[11],643717713,14),m=h(m,v,g,x,d[0],3921069994,20),x=h(x,m,v,g,d[5],3593408605,5),g=h(g,x,m,v,d[10],38016083,9),v=h(v,g,x,m,d[15],3634488961,14),m=h(m,v,g,x,d[4],3889429448,20),x=h(x,m,v,g,d[9],568446438,5),g=h(g,x,m,v,d[14],3275163606,9),v=h(v,g,x,m,d[3],4107603335,14),m=h(m,v,g,x,d[8],1163531501,20),x=h(x,m,v,g,d[13],2850285829,5),g=h(g,x,m,v,d[2],4243563512,9),v=h(v,g,x,m,d[7],1735328473,14),m=h(m,v,g,x,d[12],2368359562,20),x=l(x,m,v,g,d[5],4294588738,4),g=l(g,x,m,v,d[8],2272392833,11),v=l(v,g,x,m,d[11],1839030562,16),m=l(m,v,g,x,d[14],4259657740,23),x=l(x,m,v,g,d[1],2763975236,4),g=l(g,x,m,v,d[4],1272893353,11),v=l(v,g,x,m,d[7],4139469664,16),m=l(m,v,g,x,d[10],3200236656,23),x=l(x,m,v,g,d[13],681279174,4),g=l(g,x,m,v,d[0],3936430074,11),v=l(v,g,x,m,d[3],3572445317,16),m=l(m,v,g,x,d[6],76029189,23),x=l(x,m,v,g,d[9],3654602809,4),g=l(g,x,m,v,d[12],3873151461,11),v=l(v,g,x,m,d[15],530742520,16),m=l(m,v,g,x,d[2],3299628645,23),x=b(x,m,v,g,d[0],4096336452,6),g=b(g,x,m,v,d[7],1126891415,10),v=b(v,g,x,m,d[14],2878612391,15),m=b(m,v,g,x,d[5],4237533241,21),x=b(x,m,v,g,d[12],1700485571,6),g=b(g,x,m,v,d[3],2399980690,10),v=b(v,g,x,m,d[10],4293915773,15),m=b(m,v,g,x,d[1],2240044497,21),x=b(x,m,v,g,d[8],1873313359,6),g=b(g,x,m,v,d[15],4264355552,10),v=b(v,g,x,m,d[6],2734768916,15),m=b(m,v,g,x,d[13],1309151649,21),x=b(x,m,v,g,d[4],4149444226,6),g=b(g,x,m,v,d[11],3174756917,10),v=b(v,g,x,m,d[2],718787259,15),m=b(m,v,g,x,d[9],3951481745,21),this._a=this._a+x|0,this._b=this._b+m|0,this._c=this._c+v|0,this._d=this._d+g|0},c.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var d=n.allocUnsafe(16);return d.writeInt32LE(this._a,0),d.writeInt32LE(this._b,4),d.writeInt32LE(this._c,8),d.writeInt32LE(this._d,12),d};function o(d,p){return d<<p|d>>>32-p}function u(d,p,x,m,v,g,$){return o(d+(p&x|~p&m)+v+g|0,$)+p|0}function h(d,p,x,m,v,g,$){return o(d+(p&m|x&~m)+v+g|0,$)+p|0}function l(d,p,x,m,v,g,$){return o(d+(p^x^m)+v+g|0,$)+p|0}function b(d,p,x,m,v,g,$){return o(d+(x^(p|~m))+v+g|0,$)+p|0}return md5_js=c,md5_js}var ripemd160,hasRequiredRipemd160;function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var t=require$$1$2.Buffer,e=inherits_browserExports,n=requireHashBase(),a=new Array(16),c=[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],o=[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],u=[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],h=[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],l=[0,1518500249,1859775393,2400959708,2840853838],b=[1352829926,1548603684,1836072691,2053994217,0];function d(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}e(d,n),d.prototype._update=function(){for(var B=a,C=0;C<16;++C)B[C]=this._block.readInt32LE(C*4);for(var F=this._a|0,H=this._b|0,W=this._c|0,Z=this._d|0,ie=this._e|0,te=this._a|0,ae=this._b|0,de=this._c|0,J=this._d|0,R=this._e|0,A=0;A<80;A+=1){var y,w;A<16?(y=x(F,H,W,Z,ie,B[c[A]],l[0],u[A]),w=$(te,ae,de,J,R,B[o[A]],b[0],h[A])):A<32?(y=m(F,H,W,Z,ie,B[c[A]],l[1],u[A]),w=g(te,ae,de,J,R,B[o[A]],b[1],h[A])):A<48?(y=v(F,H,W,Z,ie,B[c[A]],l[2],u[A]),w=v(te,ae,de,J,R,B[o[A]],b[2],h[A])):A<64?(y=g(F,H,W,Z,ie,B[c[A]],l[3],u[A]),w=m(te,ae,de,J,R,B[o[A]],b[3],h[A])):(y=$(F,H,W,Z,ie,B[c[A]],l[4],u[A]),w=x(te,ae,de,J,R,B[o[A]],b[4],h[A])),F=ie,ie=Z,Z=p(W,10),W=H,H=y,te=R,R=J,J=p(de,10),de=ae,ae=w}var I=this._b+W+J|0;this._b=this._c+Z+R|0,this._c=this._d+ie+te|0,this._d=this._e+F+ae|0,this._e=this._a+H+de|0,this._a=I},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var B=t.alloc?t.alloc(20):new t(20);return B.writeInt32LE(this._a,0),B.writeInt32LE(this._b,4),B.writeInt32LE(this._c,8),B.writeInt32LE(this._d,12),B.writeInt32LE(this._e,16),B};function p(B,C){return B<<C|B>>>32-C}function x(B,C,F,H,W,Z,ie,te){return p(B+(C^F^H)+Z+ie|0,te)+W|0}function m(B,C,F,H,W,Z,ie,te){return p(B+(C&F|~C&H)+Z+ie|0,te)+W|0}function v(B,C,F,H,W,Z,ie,te){return p(B+((C|~F)^H)+Z+ie|0,te)+W|0}function g(B,C,F,H,W,Z,ie,te){return p(B+(C&H|F&~H)+Z+ie|0,te)+W|0}function $(B,C,F,H,W,Z,ie,te){return p(B+(C^(F|~H))+Z+ie|0,te)+W|0}return ripemd160=d,ripemd160}var sha_js={exports:{}},hash$3,hasRequiredHash;function requireHash(){if(hasRequiredHash)return hash$3;hasRequiredHash=1;var t=requireSafeBuffer$1().Buffer;function e(n,a){this._block=t.alloc(n),this._finalSize=a,this._blockSize=n,this._len=0}return e.prototype.update=function(n,a){typeof n=="string"&&(a=a||"utf8",n=t.from(n,a));for(var c=this._block,o=this._blockSize,u=n.length,h=this._len,l=0;l<u;){for(var b=h%o,d=Math.min(u-l,o-b),p=0;p<d;p++)c[b+p]=n[l+p];h+=d,l+=d,h%o===0&&this._update(c)}return this._len+=u,this},e.prototype.digest=function(n){var a=this._len%this._blockSize;this._block[a]=128,this._block.fill(0,a+1),a>=this._finalSize&&(this._update(this._block),this._block.fill(0));var c=this._len*8;if(c<=4294967295)this._block.writeUInt32BE(c,this._blockSize-4);else{var o=(c&4294967295)>>>0,u=(c-o)/4294967296;this._block.writeUInt32BE(u,this._blockSize-8),this._block.writeUInt32BE(o,this._blockSize-4)}this._update(this._block);var h=this._hash();return n?h.toString(n):h},e.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$3=e,hash$3}var sha$1,hasRequiredSha;function requireSha(){if(hasRequiredSha)return sha$1;hasRequiredSha=1;var t=inherits_browserExports,e=requireHash(),n=requireSafeBuffer$1().Buffer,a=[1518500249,1859775393,-1894007588,-899497514],c=new Array(80);function o(){this.init(),this._w=c,e.call(this,64,56)}t(o,e),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function u(b){return b<<5|b>>>27}function h(b){return b<<30|b>>>2}function l(b,d,p,x){return b===0?d&p|~d&x:b===2?d&p|d&x|p&x:d^p^x}return o.prototype._update=function(b){for(var d=this._w,p=this._a|0,x=this._b|0,m=this._c|0,v=this._d|0,g=this._e|0,$=0;$<16;++$)d[$]=b.readInt32BE($*4);for(;$<80;++$)d[$]=d[$-3]^d[$-8]^d[$-14]^d[$-16];for(var B=0;B<80;++B){var C=~~(B/20),F=u(p)+l(C,x,m,v)+g+d[B]+a[C]|0;g=v,v=m,m=h(x),x=p,p=F}this._a=p+this._a|0,this._b=x+this._b|0,this._c=m+this._c|0,this._d=v+this._d|0,this._e=g+this._e|0},o.prototype._hash=function(){var b=n.allocUnsafe(20);return b.writeInt32BE(this._a|0,0),b.writeInt32BE(this._b|0,4),b.writeInt32BE(this._c|0,8),b.writeInt32BE(this._d|0,12),b.writeInt32BE(this._e|0,16),b},sha$1=o,sha$1}var sha1,hasRequiredSha1;function requireSha1(){if(hasRequiredSha1)return sha1;hasRequiredSha1=1;var t=inherits_browserExports,e=requireHash(),n=requireSafeBuffer$1().Buffer,a=[1518500249,1859775393,-1894007588,-899497514],c=new Array(80);function o(){this.init(),this._w=c,e.call(this,64,56)}t(o,e),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function u(d){return d<<1|d>>>31}function h(d){return d<<5|d>>>27}function l(d){return d<<30|d>>>2}function b(d,p,x,m){return d===0?p&x|~p&m:d===2?p&x|p&m|x&m:p^x^m}return o.prototype._update=function(d){for(var p=this._w,x=this._a|0,m=this._b|0,v=this._c|0,g=this._d|0,$=this._e|0,B=0;B<16;++B)p[B]=d.readInt32BE(B*4);for(;B<80;++B)p[B]=u(p[B-3]^p[B-8]^p[B-14]^p[B-16]);for(var C=0;C<80;++C){var F=~~(C/20),H=h(x)+b(F,m,v,g)+$+p[C]+a[F]|0;$=g,g=v,v=l(m),m=x,x=H}this._a=x+this._a|0,this._b=m+this._b|0,this._c=v+this._c|0,this._d=g+this._d|0,this._e=$+this._e|0},o.prototype._hash=function(){var d=n.allocUnsafe(20);return d.writeInt32BE(this._a|0,0),d.writeInt32BE(this._b|0,4),d.writeInt32BE(this._c|0,8),d.writeInt32BE(this._d|0,12),d.writeInt32BE(this._e|0,16),d},sha1=o,sha1}var sha256$1,hasRequiredSha256;function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1;var t=inherits_browserExports,e=requireHash(),n=requireSafeBuffer$1().Buffer,a=[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],c=new Array(64);function o(){this.init(),this._w=c,e.call(this,64,56)}t(o,e),o.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function u(x,m,v){return v^x&(m^v)}function h(x,m,v){return x&m|v&(x|m)}function l(x){return(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function b(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function d(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function p(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}return o.prototype._update=function(x){for(var m=this._w,v=this._a|0,g=this._b|0,$=this._c|0,B=this._d|0,C=this._e|0,F=this._f|0,H=this._g|0,W=this._h|0,Z=0;Z<16;++Z)m[Z]=x.readInt32BE(Z*4);for(;Z<64;++Z)m[Z]=p(m[Z-2])+m[Z-7]+d(m[Z-15])+m[Z-16]|0;for(var ie=0;ie<64;++ie){var te=W+b(C)+u(C,F,H)+a[ie]+m[ie]|0,ae=l(v)+h(v,g,$)|0;W=H,H=F,F=C,C=B+te|0,B=$,$=g,g=v,v=te+ae|0}this._a=v+this._a|0,this._b=g+this._b|0,this._c=$+this._c|0,this._d=B+this._d|0,this._e=C+this._e|0,this._f=F+this._f|0,this._g=H+this._g|0,this._h=W+this._h|0},o.prototype._hash=function(){var x=n.allocUnsafe(32);return x.writeInt32BE(this._a,0),x.writeInt32BE(this._b,4),x.writeInt32BE(this._c,8),x.writeInt32BE(this._d,12),x.writeInt32BE(this._e,16),x.writeInt32BE(this._f,20),x.writeInt32BE(this._g,24),x.writeInt32BE(this._h,28),x},sha256$1=o,sha256$1}var sha224$1,hasRequiredSha224;function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var t=inherits_browserExports,e=requireSha256(),n=requireHash(),a=requireSafeBuffer$1().Buffer,c=new Array(64);function o(){this.init(),this._w=c,n.call(this,64,56)}return t(o,e),o.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},o.prototype._hash=function(){var u=a.allocUnsafe(28);return u.writeInt32BE(this._a,0),u.writeInt32BE(this._b,4),u.writeInt32BE(this._c,8),u.writeInt32BE(this._d,12),u.writeInt32BE(this._e,16),u.writeInt32BE(this._f,20),u.writeInt32BE(this._g,24),u},sha224$1=o,sha224$1}var sha512$1,hasRequiredSha512;function requireSha512(){if(hasRequiredSha512)return sha512$1;hasRequiredSha512=1;var t=inherits_browserExports,e=requireHash(),n=requireSafeBuffer$1().Buffer,a=[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],c=new Array(160);function o(){this.init(),this._w=c,e.call(this,128,112)}t(o,e),o.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function u(g,$,B){return B^g&($^B)}function h(g,$,B){return g&$|B&(g|$)}function l(g,$){return(g>>>28|$<<4)^($>>>2|g<<30)^($>>>7|g<<25)}function b(g,$){return(g>>>14|$<<18)^(g>>>18|$<<14)^($>>>9|g<<23)}function d(g,$){return(g>>>1|$<<31)^(g>>>8|$<<24)^g>>>7}function p(g,$){return(g>>>1|$<<31)^(g>>>8|$<<24)^(g>>>7|$<<25)}function x(g,$){return(g>>>19|$<<13)^($>>>29|g<<3)^g>>>6}function m(g,$){return(g>>>19|$<<13)^($>>>29|g<<3)^(g>>>6|$<<26)}function v(g,$){return g>>>0<$>>>0?1:0}return o.prototype._update=function(g){for(var $=this._w,B=this._ah|0,C=this._bh|0,F=this._ch|0,H=this._dh|0,W=this._eh|0,Z=this._fh|0,ie=this._gh|0,te=this._hh|0,ae=this._al|0,de=this._bl|0,J=this._cl|0,R=this._dl|0,A=this._el|0,y=this._fl|0,w=this._gl|0,I=this._hl|0,M=0;M<32;M+=2)$[M]=g.readInt32BE(M*4),$[M+1]=g.readInt32BE(M*4+4);for(;M<160;M+=2){var k=$[M-30],P=$[M-15*2+1],_=d(k,P),q=p(P,k);k=$[M-2*2],P=$[M-2*2+1];var E=x(k,P),j=m(P,k),ee=$[M-7*2],oe=$[M-7*2+1],Y=$[M-16*2],L=$[M-16*2+1],z=q+oe|0,re=_+ee+v(z,q)|0;z=z+j|0,re=re+E+v(z,j)|0,z=z+L|0,re=re+Y+v(z,L)|0,$[M]=re,$[M+1]=z}for(var D=0;D<160;D+=2){re=$[D],z=$[D+1];var G=h(B,C,F),U=h(ae,de,J),Q=l(B,ae),fe=l(ae,B),he=b(W,A),le=b(A,W),pe=a[D],be=a[D+1],se=u(W,Z,ie),ge=u(A,y,w),ye=I+le|0,$e=te+he+v(ye,I)|0;ye=ye+ge|0,$e=$e+se+v(ye,ge)|0,ye=ye+be|0,$e=$e+pe+v(ye,be)|0,ye=ye+z|0,$e=$e+re+v(ye,z)|0;var Ne=fe+U|0,ve=Q+G+v(Ne,fe)|0;te=ie,I=w,ie=Z,w=y,Z=W,y=A,A=R+ye|0,W=H+$e+v(A,R)|0,H=F,R=J,F=C,J=de,C=B,de=ae,ae=ye+Ne|0,B=$e+ve+v(ae,ye)|0}this._al=this._al+ae|0,this._bl=this._bl+de|0,this._cl=this._cl+J|0,this._dl=this._dl+R|0,this._el=this._el+A|0,this._fl=this._fl+y|0,this._gl=this._gl+w|0,this._hl=this._hl+I|0,this._ah=this._ah+B+v(this._al,ae)|0,this._bh=this._bh+C+v(this._bl,de)|0,this._ch=this._ch+F+v(this._cl,J)|0,this._dh=this._dh+H+v(this._dl,R)|0,this._eh=this._eh+W+v(this._el,A)|0,this._fh=this._fh+Z+v(this._fl,y)|0,this._gh=this._gh+ie+v(this._gl,w)|0,this._hh=this._hh+te+v(this._hl,I)|0},o.prototype._hash=function(){var g=n.allocUnsafe(64);function $(B,C,F){g.writeInt32BE(B,F),g.writeInt32BE(C,F+4)}return $(this._ah,this._al,0),$(this._bh,this._bl,8),$(this._ch,this._cl,16),$(this._dh,this._dl,24),$(this._eh,this._el,32),$(this._fh,this._fl,40),$(this._gh,this._gl,48),$(this._hh,this._hl,56),g},sha512$1=o,sha512$1}var sha384$1,hasRequiredSha384;function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var t=inherits_browserExports,e=requireSha512(),n=requireHash(),a=requireSafeBuffer$1().Buffer,c=new Array(160);function o(){this.init(),this._w=c,n.call(this,128,112)}return t(o,e),o.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},o.prototype._hash=function(){var u=a.allocUnsafe(48);function h(l,b,d){u.writeInt32BE(l,d),u.writeInt32BE(b,d+4)}return h(this._ah,this._al,0),h(this._bh,this._bl,8),h(this._ch,this._cl,16),h(this._dh,this._dl,24),h(this._eh,this._el,32),h(this._fh,this._fl,40),u},sha384$1=o,sha384$1}var hasRequiredSha_js;function requireSha_js(){if(hasRequiredSha_js)return sha_js.exports;hasRequiredSha_js=1;var t=sha_js.exports=function(n){n=n.toLowerCase();var a=t[n];if(!a)throw new Error(n+" is not supported (we accept pull requests)");return new a};return t.sha=requireSha(),t.sha1=requireSha1(),t.sha224=requireSha224(),t.sha256=requireSha256(),t.sha384=requireSha384(),t.sha512=requireSha512(),sha_js.exports}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=n;var t=requireEvents().EventEmitter,e=inherits_browserExports;e(n,t),n.Readable=require_stream_readable$1(),n.Writable=require_stream_writable$1(),n.Duplex=require_stream_duplex$1(),n.Transform=require_stream_transform$1(),n.PassThrough=require_stream_passthrough$1(),n.finished=requireEndOfStream(),n.pipeline=requirePipeline(),n.Stream=n;function n(){t.call(this)}return n.prototype.pipe=function(a,c){var o=this;function u(m){a.writable&&a.write(m)===!1&&o.pause&&o.pause()}o.on("data",u);function h(){o.readable&&o.resume&&o.resume()}a.on("drain",h),!a._isStdio&&(!c||c.end!==!1)&&(o.on("end",b),o.on("close",d));var l=!1;function b(){l||(l=!0,a.end())}function d(){l||(l=!0,typeof a.destroy=="function"&&a.destroy())}function p(m){if(x(),t.listenerCount(this,"error")===0)throw m}o.on("error",p),a.on("error",p);function x(){o.removeListener("data",u),a.removeListener("drain",h),o.removeListener("end",b),o.removeListener("close",d),o.removeListener("error",p),a.removeListener("error",p),o.removeListener("end",x),o.removeListener("close",x),a.removeListener("close",x)}return o.on("end",x),o.on("close",x),a.on("close",x),a.emit("pipe",o),a},streamBrowserify}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var t=requireSafeBuffer$1().Buffer,e=requireStreamBrowserify().Transform,n=requireString_decoder().StringDecoder,a=inherits_browserExports;function c(o){e.call(this),this.hashMode=typeof o=="string",this.hashMode?this[o]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return a(c,e),c.prototype.update=function(o,u,h){typeof o=="string"&&(o=t.from(o,u));var l=this._update(o);return this.hashMode?this:(h&&(l=this._toString(l,h)),l)},c.prototype.setAutoPadding=function(){},c.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},c.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},c.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},c.prototype._transform=function(o,u,h){var l;try{this.hashMode?this._update(o):this.push(this._update(o))}catch(b){l=b}finally{h(l)}},c.prototype._flush=function(o){var u;try{this.push(this.__final())}catch(h){u=h}o(u)},c.prototype._finalOrDigest=function(o){var u=this.__final()||t.alloc(0);return o&&(u=this._toString(u,o,!0)),u},c.prototype._toString=function(o,u,h){if(this._decoder||(this._decoder=new n(u),this._encoding=u),this._encoding!==u)throw new Error("can't switch encodings");var l=this._decoder.write(o);return h&&(l+=this._decoder.end()),l},cipherBase=c,cipherBase}var browser$9,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$9;hasRequiredBrowser$9=1;var t=inherits_browserExports,e=requireMd5_js(),n=requireRipemd160(),a=requireSha_js(),c=requireCipherBase();function o(u){c.call(this,"digest"),this._hash=u}return t(o,c),o.prototype._update=function(u){this._hash.update(u)},o.prototype._final=function(){return this._hash.digest()},browser$9=function(h){return h=h.toLowerCase(),h==="md5"?new e:h==="rmd160"||h==="ripemd160"?new n:new o(a(h))},browser$9}var legacy,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var t=inherits_browserExports,e=requireSafeBuffer$1().Buffer,n=requireCipherBase(),a=e.alloc(128),c=64;function o(u,h){n.call(this,"digest"),typeof h=="string"&&(h=e.from(h)),this._alg=u,this._key=h,h.length>c?h=u(h):h.length<c&&(h=e.concat([h,a],c));for(var l=this._ipad=e.allocUnsafe(c),b=this._opad=e.allocUnsafe(c),d=0;d<c;d++)l[d]=h[d]^54,b[d]=h[d]^92;this._hash=[l]}return t(o,n),o.prototype._update=function(u){this._hash.push(u)},o.prototype._final=function(){var u=this._alg(e.concat(this._hash));return this._alg(e.concat([this._opad,u]))},legacy=o,legacy}var md5,hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1;var t=requireMd5_js();return md5=function(e){return new t().update(e).digest()},md5}var browser$8,hasRequiredBrowser$8;function requireBrowser$8(){if(hasRequiredBrowser$8)return browser$8;hasRequiredBrowser$8=1;var t=inherits_browserExports,e=requireLegacy(),n=requireCipherBase(),a=requireSafeBuffer$1().Buffer,c=requireMd5(),o=requireRipemd160(),u=requireSha_js(),h=a.alloc(128);function l(b,d){n.call(this,"digest"),typeof d=="string"&&(d=a.from(d));var p=b==="sha512"||b==="sha384"?128:64;if(this._alg=b,this._key=d,d.length>p){var x=b==="rmd160"?new o:u(b);d=x.update(d).digest()}else d.length<p&&(d=a.concat([d,h],p));for(var m=this._ipad=a.allocUnsafe(p),v=this._opad=a.allocUnsafe(p),g=0;g<p;g++)m[g]=d[g]^54,v[g]=d[g]^92;this._hash=b==="rmd160"?new o:u(b),this._hash.update(m)}return t(l,n),l.prototype._update=function(b){this._hash.update(b)},l.prototype._final=function(){var b=this._hash.digest(),d=this._alg==="rmd160"?new o:u(this._alg);return d.update(this._opad).update(b).digest()},browser$8=function(d,p){return d=d.toLowerCase(),d==="rmd160"||d==="ripemd160"?new l("rmd160",p):d==="md5"?new e(c,p):new l(d,p)},browser$8}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},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={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"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,sha224,sha384,sha512,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"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,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos||(hasRequiredAlgos=1,algos=require$$6),algos}var browser$7={},precondition,hasRequiredPrecondition;function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var t=Math.pow(2,30)-1;return precondition=function(e,n){if(typeof e!="number")throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if(typeof n!="number")throw new TypeError("Key length not a number");if(n<0||n>t||n!==n)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var t;if(commonjsGlobal.process&&commonjsGlobal.process.browser)t="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var e=parseInt(process$1.version.split(".")[0].slice(1),10);t=e>=6?"utf-8":"binary"}else t="utf-8";return defaultEncoding_1=t,defaultEncoding_1}var toBuffer,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer;hasRequiredToBuffer=1;var t=requireSafeBuffer$1().Buffer;return toBuffer=function(e,n,a){if(t.isBuffer(e))return e;if(typeof e=="string")return t.from(e,n);if(ArrayBuffer.isView(e))return t.from(e.buffer);throw new TypeError(a+" must be a string, a Buffer, a typed array or a DataView")},toBuffer}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var t=requireMd5(),e=requireRipemd160(),n=requireSha_js(),a=requireSafeBuffer$1().Buffer,c=requirePrecondition(),o=requireDefaultEncoding(),u=requireToBuffer(),h=a.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function b(x,m,v){var g=d(x),$=x==="sha512"||x==="sha384"?128:64;m.length>$?m=g(m):m.length<$&&(m=a.concat([m,h],$));for(var B=a.allocUnsafe($+l[x]),C=a.allocUnsafe($+l[x]),F=0;F<$;F++)B[F]=m[F]^54,C[F]=m[F]^92;var H=a.allocUnsafe($+v+4);B.copy(H,0,0,$),this.ipad1=H,this.ipad2=B,this.opad=C,this.alg=x,this.blocksize=$,this.hash=g,this.size=l[x]}b.prototype.run=function(x,m){x.copy(m,this.blocksize);var v=this.hash(m);return v.copy(this.opad,this.blocksize),this.hash(this.opad)};function d(x){function m(g){return n(x).update(g).digest()}function v(g){return new e().update(g).digest()}return x==="rmd160"||x==="ripemd160"?v:x==="md5"?t:m}function p(x,m,v,g,$){c(v,g),x=u(x,o,"Password"),m=u(m,o,"Salt"),$=$||"sha1";var B=new b($,x,m.length),C=a.allocUnsafe(g),F=a.allocUnsafe(m.length+4);m.copy(F,0,0,m.length);for(var H=0,W=l[$],Z=Math.ceil(g/W),ie=1;ie<=Z;ie++){F.writeUInt32BE(ie,m.length);for(var te=B.run(F,B.ipad1),ae=te,de=1;de<v;de++){ae=B.run(ae,B.ipad2);for(var J=0;J<W;J++)te[J]^=ae[J]}te.copy(C,H),H+=W}return C}return syncBrowser=p,syncBrowser}var async,hasRequiredAsync;function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var t=requireSafeBuffer$1().Buffer,e=requirePrecondition(),n=requireDefaultEncoding(),a=requireSyncBrowser(),c=requireToBuffer(),o,u=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,h={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"},l=[];function b(v){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(l[v]!==void 0)return l[v];o=o||t.alloc(8);var g=x(o,o,10,128,v).then(function(){return!0}).catch(function(){return!1});return l[v]=g,g}var d;function p(){return d||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?d=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?d=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?d=commonjsGlobal.setImmediate:d=commonjsGlobal.setTimeout,d)}function x(v,g,$,B,C){return u.importKey("raw",v,{name:"PBKDF2"},!1,["deriveBits"]).then(function(F){return u.deriveBits({name:"PBKDF2",salt:g,iterations:$,hash:{name:C}},F,B<<3)}).then(function(F){return t.from(F)})}function m(v,g){v.then(function($){p()(function(){g(null,$)})},function($){p()(function(){g($)})})}return async=function(v,g,$,B,C,F){typeof C=="function"&&(F=C,C=void 0),C=C||"sha1";var H=h[C.toLowerCase()];if(!H||typeof commonjsGlobal.Promise!="function"){p()(function(){var W;try{W=a(v,g,$,B,C)}catch(Z){return F(Z)}F(null,W)});return}if(e($,B),v=c(v,n,"Password"),g=c(g,n,"Salt"),typeof F!="function")throw new Error("No callback provided to pbkdf2");m(b(H).then(function(W){return W?x(v,g,$,B,H):a(v,g,$,B,C)}),F)},async}var hasRequiredBrowser$7;function requireBrowser$7(){return hasRequiredBrowser$7||(hasRequiredBrowser$7=1,browser$7.pbkdf2=requireAsync(),browser$7.pbkdf2Sync=requireSyncBrowser()),browser$7}var browser$6={},des$1={},utils$m={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils$m;hasRequiredUtils=1,utils$m.readUInt32BE=function(c,o){var u=c[0+o]<<24|c[1+o]<<16|c[2+o]<<8|c[3+o];return u>>>0},utils$m.writeUInt32BE=function(c,o,u){c[0+u]=o>>>24,c[1+u]=o>>>16&255,c[2+u]=o>>>8&255,c[3+u]=o&255},utils$m.ip=function(c,o,u,h){for(var l=0,b=0,d=6;d>=0;d-=2){for(var p=0;p<=24;p+=8)l<<=1,l|=o>>>p+d&1;for(var p=0;p<=24;p+=8)l<<=1,l|=c>>>p+d&1}for(var d=6;d>=0;d-=2){for(var p=1;p<=25;p+=8)b<<=1,b|=o>>>p+d&1;for(var p=1;p<=25;p+=8)b<<=1,b|=c>>>p+d&1}u[h+0]=l>>>0,u[h+1]=b>>>0},utils$m.rip=function(c,o,u,h){for(var l=0,b=0,d=0;d<4;d++)for(var p=24;p>=0;p-=8)l<<=1,l|=o>>>p+d&1,l<<=1,l|=c>>>p+d&1;for(var d=4;d<8;d++)for(var p=24;p>=0;p-=8)b<<=1,b|=o>>>p+d&1,b<<=1,b|=c>>>p+d&1;u[h+0]=l>>>0,u[h+1]=b>>>0},utils$m.pc1=function(c,o,u,h){for(var l=0,b=0,d=7;d>=5;d--){for(var p=0;p<=24;p+=8)l<<=1,l|=o>>p+d&1;for(var p=0;p<=24;p+=8)l<<=1,l|=c>>p+d&1}for(var p=0;p<=24;p+=8)l<<=1,l|=o>>p+d&1;for(var d=1;d<=3;d++){for(var p=0;p<=24;p+=8)b<<=1,b|=o>>p+d&1;for(var p=0;p<=24;p+=8)b<<=1,b|=c>>p+d&1}for(var p=0;p<=24;p+=8)b<<=1,b|=c>>p+d&1;u[h+0]=l>>>0,u[h+1]=b>>>0},utils$m.r28shl=function(c,o){return c<<o&268435455|c>>>28-o};var t=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$m.pc2=function(c,o,u,h){for(var l=0,b=0,d=t.length>>>1,p=0;p<d;p++)l<<=1,l|=c>>>t[p]&1;for(var p=d;p<t.length;p++)b<<=1,b|=o>>>t[p]&1;u[h+0]=l>>>0,u[h+1]=b>>>0},utils$m.expand=function(c,o,u){var h=0,l=0;h=(c&1)<<5|c>>>27;for(var b=23;b>=15;b-=4)h<<=6,h|=c>>>b&63;for(var b=11;b>=3;b-=4)l|=c>>>b&63,l<<=6;l|=(c&31)<<1|c>>>31,o[u+0]=h>>>0,o[u+1]=l>>>0};var e=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$m.substitute=function(c,o){for(var u=0,h=0;h<4;h++){var l=c>>>18-h*6&63,b=e[h*64+l];u<<=4,u|=b}for(var h=0;h<4;h++){var l=o>>>18-h*6&63,b=e[4*64+h*64+l];u<<=4,u|=b}return u>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return utils$m.permute=function(c){for(var o=0,u=0;u<n.length;u++)o<<=1,o|=c>>>n[u]&1;return o>>>0},utils$m.padSplit=function(c,o,u){for(var h=c.toString(2);h.length<o;)h="0"+h;for(var l=[],b=0;b<o;b+=u)l.push(h.slice(b,b+u));return l.join(" ")},utils$m}var cipher,hasRequiredCipher;function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var t=minimalisticAssert;function e(n){this.options=n,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=n.padding!==!1}return cipher=e,e.prototype._init=function(){},e.prototype.update=function(a){return a.length===0?[]:this.type==="decrypt"?this._updateDecrypt(a):this._updateEncrypt(a)},e.prototype._buffer=function(a,c){for(var o=Math.min(this.buffer.length-this.bufferOff,a.length-c),u=0;u<o;u++)this.buffer[this.bufferOff+u]=a[c+u];return this.bufferOff+=o,o},e.prototype._flushBuffer=function(a,c){return this._update(this.buffer,0,a,c),this.bufferOff=0,this.blockSize},e.prototype._updateEncrypt=function(a){var c=0,o=0,u=(this.bufferOff+a.length)/this.blockSize|0,h=new Array(u*this.blockSize);this.bufferOff!==0&&(c+=this._buffer(a,c),this.bufferOff===this.buffer.length&&(o+=this._flushBuffer(h,o)));for(var l=a.length-(a.length-c)%this.blockSize;c<l;c+=this.blockSize)this._update(a,c,h,o),o+=this.blockSize;for(;c<a.length;c++,this.bufferOff++)this.buffer[this.bufferOff]=a[c];return h},e.prototype._updateDecrypt=function(a){for(var c=0,o=0,u=Math.ceil((this.bufferOff+a.length)/this.blockSize)-1,h=new Array(u*this.blockSize);u>0;u--)c+=this._buffer(a,c),o+=this._flushBuffer(h,o);return c+=this._buffer(a,c),h},e.prototype.final=function(a){var c;a&&(c=this.update(a));var o;return this.type==="encrypt"?o=this._finalEncrypt():o=this._finalDecrypt(),c?c.concat(o):o},e.prototype._pad=function(a,c){if(c===0)return!1;for(;c<a.length;)a[c++]=0;return!0},e.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var a=new Array(this.blockSize);return this._update(this.buffer,0,a,0),a},e.prototype._unpad=function(a){return a},e.prototype._finalDecrypt=function(){t.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var a=new Array(this.blockSize);return this._flushBuffer(a,0),this._unpad(a)},cipher}var des,hasRequiredDes$1;function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var t=minimalisticAssert,e=inherits_browserExports,n=requireUtils(),a=requireCipher();function c(){this.tmp=new Array(2),this.keys=null}function o(h){a.call(this,h);var l=new c;this._desState=l,this.deriveKeys(l,h.key)}e(o,a),des=o,o.create=function(l){return new o(l)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return o.prototype.deriveKeys=function(l,b){l.keys=new Array(16*2),t.equal(b.length,this.blockSize,"Invalid key length");var d=n.readUInt32BE(b,0),p=n.readUInt32BE(b,4);n.pc1(d,p,l.tmp,0),d=l.tmp[0],p=l.tmp[1];for(var x=0;x<l.keys.length;x+=2){var m=u[x>>>1];d=n.r28shl(d,m),p=n.r28shl(p,m),n.pc2(d,p,l.keys,x)}},o.prototype._update=function(l,b,d,p){var x=this._desState,m=n.readUInt32BE(l,b),v=n.readUInt32BE(l,b+4);n.ip(m,v,x.tmp,0),m=x.tmp[0],v=x.tmp[1],this.type==="encrypt"?this._encrypt(x,m,v,x.tmp,0):this._decrypt(x,m,v,x.tmp,0),m=x.tmp[0],v=x.tmp[1],n.writeUInt32BE(d,m,p),n.writeUInt32BE(d,v,p+4)},o.prototype._pad=function(l,b){if(this.padding===!1)return!1;for(var d=l.length-b,p=b;p<l.length;p++)l[p]=d;return!0},o.prototype._unpad=function(l){if(this.padding===!1)return l;for(var b=l[l.length-1],d=l.length-b;d<l.length;d++)t.equal(l[d],b);return l.slice(0,l.length-b)},o.prototype._encrypt=function(l,b,d,p,x){for(var m=b,v=d,g=0;g<l.keys.length;g+=2){var $=l.keys[g],B=l.keys[g+1];n.expand(v,l.tmp,0),$^=l.tmp[0],B^=l.tmp[1];var C=n.substitute($,B),F=n.permute(C),H=v;v=(m^F)>>>0,m=H}n.rip(v,m,p,x)},o.prototype._decrypt=function(l,b,d,p,x){for(var m=d,v=b,g=l.keys.length-2;g>=0;g-=2){var $=l.keys[g],B=l.keys[g+1];n.expand(m,l.tmp,0),$^=l.tmp[0],B^=l.tmp[1];var C=n.substitute($,B),F=n.permute(C),H=m;m=(v^F)>>>0,v=H}n.rip(m,v,p,x)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var t=minimalisticAssert,e=inherits_browserExports,n={};function a(o){t.equal(o.length,8,"Invalid IV length"),this.iv=new Array(8);for(var u=0;u<this.iv.length;u++)this.iv[u]=o[u]}function c(o){function u(d){o.call(this,d),this._cbcInit()}e(u,o);for(var h=Object.keys(n),l=0;l<h.length;l++){var b=h[l];u.prototype[b]=n[b]}return u.create=function(p){return new u(p)},u}return cbc$1.instantiate=c,n._cbcInit=function(){var u=new a(this.options.iv);this._cbcState=u},n._update=function(u,h,l,b){var d=this._cbcState,p=this.constructor.super_.prototype,x=d.iv;if(this.type==="encrypt"){for(var m=0;m<this.blockSize;m++)x[m]^=u[h+m];p._update.call(this,x,0,l,b);for(var m=0;m<this.blockSize;m++)x[m]=l[b+m]}else{p._update.call(this,u,h,l,b);for(var m=0;m<this.blockSize;m++)l[b+m]^=x[m];for(var m=0;m<this.blockSize;m++)x[m]=u[h+m]}},cbc$1}var ede,hasRequiredEde;function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var t=minimalisticAssert,e=inherits_browserExports,n=requireCipher(),a=requireDes$1();function c(u,h){t.equal(h.length,24,"Invalid key length");var l=h.slice(0,8),b=h.slice(8,16),d=h.slice(16,24);u==="encrypt"?this.ciphers=[a.create({type:"encrypt",key:l}),a.create({type:"decrypt",key:b}),a.create({type:"encrypt",key:d})]:this.ciphers=[a.create({type:"decrypt",key:d}),a.create({type:"encrypt",key:b}),a.create({type:"decrypt",key:l})]}function o(u){n.call(this,u);var h=new c(this.type,this.options.key);this._edeState=h}return e(o,n),ede=o,o.create=function(h){return new o(h)},o.prototype._update=function(h,l,b,d){var p=this._edeState;p.ciphers[0]._update(h,l,b,d),p.ciphers[1]._update(b,d,b,d),p.ciphers[2]._update(b,d,b,d)},o.prototype._pad=a.prototype._pad,o.prototype._unpad=a.prototype._unpad,ede}var hasRequiredDes;function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}var browserifyDes,hasRequiredBrowserifyDes;function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var t=requireCipherBase(),e=requireDes(),n=inherits_browserExports,a=requireSafeBuffer$1().Buffer,c={"des-ede3-cbc":e.CBC.instantiate(e.EDE),"des-ede3":e.EDE,"des-ede-cbc":e.CBC.instantiate(e.EDE),"des-ede":e.EDE,"des-cbc":e.CBC.instantiate(e.DES),"des-ecb":e.DES};c.des=c["des-cbc"],c.des3=c["des-ede3-cbc"],browserifyDes=o,n(o,t);function o(u){t.call(this);var h=u.mode.toLowerCase(),l=c[h],b;u.decrypt?b="decrypt":b="encrypt";var d=u.key;a.isBuffer(d)||(d=a.from(d)),(h==="des-ede"||h==="des-ede-cbc")&&(d=a.concat([d,d.slice(0,8)]));var p=u.iv;a.isBuffer(p)||(p=a.from(p)),this._des=l.create({key:d,iv:p,type:b})}return o.prototype._update=function(u){return a.from(this._des.update(u))},o.prototype._final=function(){return a.from(this._des.final())},browserifyDes}var browser$5={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(t,e){return t._cipher.encryptBlock(e)},ecb.decrypt=function(t,e){return t._cipher.decryptBlock(e)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor;function requireBufferXor(){return hasRequiredBufferXor||(hasRequiredBufferXor=1,bufferXor=function(e,n){for(var a=Math.min(e.length,n.length),c=new Buffer(a),o=0;o<a;++o)c[o]=e[o]^n[o];return c}),bufferXor}var hasRequiredCbc;function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var t=requireBufferXor();return cbc.encrypt=function(e,n){var a=t(n,e._prev);return e._prev=e._cipher.encryptBlock(a),e._prev},cbc.decrypt=function(e,n){var a=e._prev;e._prev=n;var c=e._cipher.decryptBlock(n);return t(c,a)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var t=requireSafeBuffer$1().Buffer,e=requireBufferXor();function n(a,c,o){var u=c.length,h=e(c,a._cache);return a._cache=a._cache.slice(u),a._prev=t.concat([a._prev,o?c:h]),h}return cfb.encrypt=function(a,c,o){for(var u=t.allocUnsafe(0),h;c.length;)if(a._cache.length===0&&(a._cache=a._cipher.encryptBlock(a._prev),a._prev=t.allocUnsafe(0)),a._cache.length<=c.length)h=a._cache.length,u=t.concat([u,n(a,c.slice(0,h),o)]),c=c.slice(h);else{u=t.concat([u,n(a,c,o)]);break}return u},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var t=requireSafeBuffer$1().Buffer;function e(n,a,c){var o=n._cipher.encryptBlock(n._prev),u=o[0]^a;return n._prev=t.concat([n._prev.slice(1),t.from([c?a:u])]),u}return cfb8.encrypt=function(n,a,c){for(var o=a.length,u=t.allocUnsafe(o),h=-1;++h<o;)u[h]=e(n,a[h],c);return u},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var t=requireSafeBuffer$1().Buffer;function e(a,c,o){for(var u,h=-1,l=8,b=0,d,p;++h<l;)u=a._cipher.encryptBlock(a._prev),d=c&1<<7-h?128:0,p=u[0]^d,b+=(p&128)>>h%8,a._prev=n(a._prev,o?d:p);return b}function n(a,c){var o=a.length,u=-1,h=t.allocUnsafe(a.length);for(a=t.concat([a,t.from([c])]);++u<o;)h[u]=a[u]<<1|a[u+1]>>7;return h}return cfb1.encrypt=function(a,c,o){for(var u=c.length,h=t.allocUnsafe(u),l=-1;++l<u;)h[l]=e(a,c[l],o);return h},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var t=requireBufferXor();function e(n){return n._prev=n._cipher.encryptBlock(n._prev),n._prev}return ofb.encrypt=function(n,a){for(;n._cache.length<a.length;)n._cache=Buffer.concat([n._cache,e(n)]);var c=n._cache.slice(0,a.length);return n._cache=n._cache.slice(a.length),t(a,c)},ofb}var ctr={},incr32_1,hasRequiredIncr32;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;hasRequiredIncr32=1;function t(e){for(var n=e.length,a;n--;)if(a=e.readUInt8(n),a===255)e.writeUInt8(0,n);else{a++,e.writeUInt8(a,n);break}}return incr32_1=t,incr32_1}var hasRequiredCtr;function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var t=requireBufferXor(),e=requireSafeBuffer$1().Buffer,n=requireIncr32();function a(o){var u=o._cipher.encryptBlockRaw(o._prev);return n(o._prev),u}var c=16;return ctr.encrypt=function(o,u){var h=Math.ceil(u.length/c),l=o._cache.length;o._cache=e.concat([o._cache,e.allocUnsafe(h*c)]);for(var b=0;b<h;b++){var d=a(o),p=l+b*c;o._cache.writeUInt32BE(d[0],p+0),o._cache.writeUInt32BE(d[1],p+4),o._cache.writeUInt32BE(d[2],p+8),o._cache.writeUInt32BE(d[3],p+12)}var x=o._cache.slice(0,u.length);return o._cache=o._cache.slice(u.length),t(u,x)},ctr}const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128,aes192,aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var t={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},e=require$$2;for(var n in e)e[n].module=t[e[n].mode];return modes_1=e,modes_1}var aes={},hasRequiredAes;function requireAes(){if(hasRequiredAes)return aes;hasRequiredAes=1;var t=requireSafeBuffer$1().Buffer;function e(h){t.isBuffer(h)||(h=t.from(h));for(var l=h.length/4|0,b=new Array(l),d=0;d<l;d++)b[d]=h.readUInt32BE(d*4);return b}function n(h){for(var l=0;l<h.length;h++)h[l]=0}function a(h,l,b,d,p){for(var x=b[0],m=b[1],v=b[2],g=b[3],$=h[0]^l[0],B=h[1]^l[1],C=h[2]^l[2],F=h[3]^l[3],H,W,Z,ie,te=4,ae=1;ae<p;ae++)H=x[$>>>24]^m[B>>>16&255]^v[C>>>8&255]^g[F&255]^l[te++],W=x[B>>>24]^m[C>>>16&255]^v[F>>>8&255]^g[$&255]^l[te++],Z=x[C>>>24]^m[F>>>16&255]^v[$>>>8&255]^g[B&255]^l[te++],ie=x[F>>>24]^m[$>>>16&255]^v[B>>>8&255]^g[C&255]^l[te++],$=H,B=W,C=Z,F=ie;return H=(d[$>>>24]<<24|d[B>>>16&255]<<16|d[C>>>8&255]<<8|d[F&255])^l[te++],W=(d[B>>>24]<<24|d[C>>>16&255]<<16|d[F>>>8&255]<<8|d[$&255])^l[te++],Z=(d[C>>>24]<<24|d[F>>>16&255]<<16|d[$>>>8&255]<<8|d[B&255])^l[te++],ie=(d[F>>>24]<<24|d[$>>>16&255]<<16|d[B>>>8&255]<<8|d[C&255])^l[te++],H=H>>>0,W=W>>>0,Z=Z>>>0,ie=ie>>>0,[H,W,Z,ie]}var c=[0,1,2,4,8,16,32,64,128,27,54],o=function(){for(var h=new Array(256),l=0;l<256;l++)l<128?h[l]=l<<1:h[l]=l<<1^283;for(var b=[],d=[],p=[[],[],[],[]],x=[[],[],[],[]],m=0,v=0,g=0;g<256;++g){var $=v^v<<1^v<<2^v<<3^v<<4;$=$>>>8^$&255^99,b[m]=$,d[$]=m;var B=h[m],C=h[B],F=h[C],H=h[$]*257^$*16843008;p[0][m]=H<<24|H>>>8,p[1][m]=H<<16|H>>>16,p[2][m]=H<<8|H>>>24,p[3][m]=H,H=F*16843009^C*65537^B*257^m*16843008,x[0][$]=H<<24|H>>>8,x[1][$]=H<<16|H>>>16,x[2][$]=H<<8|H>>>24,x[3][$]=H,m===0?m=v=1:(m=B^h[h[h[F^B]]],v^=h[h[v]])}return{SBOX:b,INV_SBOX:d,SUB_MIX:p,INV_SUB_MIX:x}}();function u(h){this._key=e(h),this._reset()}return u.blockSize=4*4,u.keySize=256/8,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var h=this._key,l=h.length,b=l+6,d=(b+1)*4,p=[],x=0;x<l;x++)p[x]=h[x];for(x=l;x<d;x++){var m=p[x-1];x%l===0?(m=m<<8|m>>>24,m=o.SBOX[m>>>24]<<24|o.SBOX[m>>>16&255]<<16|o.SBOX[m>>>8&255]<<8|o.SBOX[m&255],m^=c[x/l|0]<<24):l>6&&x%l===4&&(m=o.SBOX[m>>>24]<<24|o.SBOX[m>>>16&255]<<16|o.SBOX[m>>>8&255]<<8|o.SBOX[m&255]),p[x]=p[x-l]^m}for(var v=[],g=0;g<d;g++){var $=d-g,B=p[$-(g%4?0:4)];g<4||$<=4?v[g]=B:v[g]=o.INV_SUB_MIX[0][o.SBOX[B>>>24]]^o.INV_SUB_MIX[1][o.SBOX[B>>>16&255]]^o.INV_SUB_MIX[2][o.SBOX[B>>>8&255]]^o.INV_SUB_MIX[3][o.SBOX[B&255]]}this._nRounds=b,this._keySchedule=p,this._invKeySchedule=v},u.prototype.encryptBlockRaw=function(h){return h=e(h),a(h,this._keySchedule,o.SUB_MIX,o.SBOX,this._nRounds)},u.prototype.encryptBlock=function(h){var l=this.encryptBlockRaw(h),b=t.allocUnsafe(16);return b.writeUInt32BE(l[0],0),b.writeUInt32BE(l[1],4),b.writeUInt32BE(l[2],8),b.writeUInt32BE(l[3],12),b},u.prototype.decryptBlock=function(h){h=e(h);var l=h[1];h[1]=h[3],h[3]=l;var b=a(h,this._invKeySchedule,o.INV_SUB_MIX,o.INV_SBOX,this._nRounds),d=t.allocUnsafe(16);return d.writeUInt32BE(b[0],0),d.writeUInt32BE(b[3],4),d.writeUInt32BE(b[2],8),d.writeUInt32BE(b[1],12),d},u.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},aes.AES=u,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var t=requireSafeBuffer$1().Buffer,e=t.alloc(16,0);function n(o){return[o.readUInt32BE(0),o.readUInt32BE(4),o.readUInt32BE(8),o.readUInt32BE(12)]}function a(o){var u=t.allocUnsafe(16);return u.writeUInt32BE(o[0]>>>0,0),u.writeUInt32BE(o[1]>>>0,4),u.writeUInt32BE(o[2]>>>0,8),u.writeUInt32BE(o[3]>>>0,12),u}function c(o){this.h=o,this.state=t.alloc(16,0),this.cache=t.allocUnsafe(0)}return c.prototype.ghash=function(o){for(var u=-1;++u<o.length;)this.state[u]^=o[u];this._multiply()},c.prototype._multiply=function(){for(var o=n(this.h),u=[0,0,0,0],h,l,b,d=-1;++d<128;){for(l=(this.state[~~(d/8)]&1<<7-d%8)!==0,l&&(u[0]^=o[0],u[1]^=o[1],u[2]^=o[2],u[3]^=o[3]),b=(o[3]&1)!==0,h=3;h>0;h--)o[h]=o[h]>>>1|(o[h-1]&1)<<31;o[0]=o[0]>>>1,b&&(o[0]=o[0]^225<<24)}this.state=a(u)},c.prototype.update=function(o){this.cache=t.concat([this.cache,o]);for(var u;this.cache.length>=16;)u=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(u)},c.prototype.final=function(o,u){return this.cache.length&&this.ghash(t.concat([this.cache,e],16)),this.ghash(a([0,o,0,u])),this.state},ghash=c,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var t=requireAes(),e=requireSafeBuffer$1().Buffer,n=requireCipherBase(),a=inherits_browserExports,c=requireGhash(),o=requireBufferXor(),u=requireIncr32();function h(d,p){var x=0;d.length!==p.length&&x++;for(var m=Math.min(d.length,p.length),v=0;v<m;++v)x+=d[v]^p[v];return x}function l(d,p,x){if(p.length===12)return d._finID=e.concat([p,e.from([0,0,0,1])]),e.concat([p,e.from([0,0,0,2])]);var m=new c(x),v=p.length,g=v%16;m.update(p),g&&(g=16-g,m.update(e.alloc(g,0))),m.update(e.alloc(8,0));var $=v*8,B=e.alloc(8);B.writeUIntBE($,0,8),m.update(B),d._finID=m.state;var C=e.from(d._finID);return u(C),C}function b(d,p,x,m){n.call(this);var v=e.alloc(4,0);this._cipher=new t.AES(p);var g=this._cipher.encryptBlock(v);this._ghash=new c(g),x=l(this,x,g),this._prev=e.from(x),this._cache=e.allocUnsafe(0),this._secCache=e.allocUnsafe(0),this._decrypt=m,this._alen=0,this._len=0,this._mode=d,this._authTag=null,this._called=!1}return a(b,n),b.prototype._update=function(d){if(!this._called&&this._alen){var p=16-this._alen%16;p<16&&(p=e.alloc(p,0),this._ghash.update(p))}this._called=!0;var x=this._mode.encrypt(this,d);return this._decrypt?this._ghash.update(d):this._ghash.update(x),this._len+=d.length,x},b.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var d=o(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&h(d,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=d,this._cipher.scrub()},b.prototype.getAuthTag=function(){if(this._decrypt||!e.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},b.prototype.setAuthTag=function(p){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=p},b.prototype.setAAD=function(p){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(p),this._alen+=p.length},authCipher=b,authCipher}var streamCipher,hasRequiredStreamCipher;function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var t=requireAes(),e=requireSafeBuffer$1().Buffer,n=requireCipherBase(),a=inherits_browserExports;function c(o,u,h,l){n.call(this),this._cipher=new t.AES(u),this._prev=e.from(h),this._cache=e.allocUnsafe(0),this._secCache=e.allocUnsafe(0),this._decrypt=l,this._mode=o}return a(c,n),c.prototype._update=function(o){return this._mode.encrypt(this,o,this._decrypt)},c.prototype._final=function(){this._cipher.scrub()},streamCipher=c,streamCipher}var evp_bytestokey,hasRequiredEvp_bytestokey;function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var t=requireSafeBuffer$1().Buffer,e=requireMd5_js();function n(a,c,o,u){if(t.isBuffer(a)||(a=t.from(a,"binary")),c&&(t.isBuffer(c)||(c=t.from(c,"binary")),c.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var h=o/8,l=t.alloc(h),b=t.alloc(u||0),d=t.alloc(0);h>0||u>0;){var p=new e;p.update(d),p.update(a),c&&p.update(c),d=p.digest();var x=0;if(h>0){var m=l.length-h;x=Math.min(h,d.length),d.copy(l,m,0,x),h-=x}if(x<d.length&&u>0){var v=b.length-u,g=Math.min(u,d.length-x);d.copy(b,v,x,x+g),u-=g}}return d.fill(0),{key:l,iv:b}}return evp_bytestokey=n,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var t=requireModes$1(),e=requireAuthCipher(),n=requireSafeBuffer$1().Buffer,a=requireStreamCipher(),c=requireCipherBase(),o=requireAes(),u=requireEvp_bytestokey(),h=inherits_browserExports;function l(m,v,g){c.call(this),this._cache=new d,this._cipher=new o.AES(v),this._prev=n.from(g),this._mode=m,this._autopadding=!0}h(l,c),l.prototype._update=function(m){this._cache.add(m);for(var v,g,$=[];v=this._cache.get();)g=this._mode.encrypt(this,v),$.push(g);return n.concat($)};var b=n.alloc(16,16);l.prototype._final=function(){var m=this._cache.flush();if(this._autopadding)return m=this._mode.encrypt(this,m),this._cipher.scrub(),m;if(!m.equals(b))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(m){return this._autopadding=!!m,this};function d(){this.cache=n.allocUnsafe(0)}d.prototype.add=function(m){this.cache=n.concat([this.cache,m])},d.prototype.get=function(){if(this.cache.length>15){var m=this.cache.slice(0,16);return this.cache=this.cache.slice(16),m}return null},d.prototype.flush=function(){for(var m=16-this.cache.length,v=n.allocUnsafe(m),g=-1;++g<m;)v.writeUInt8(m,g);return n.concat([this.cache,v])};function p(m,v,g){var $=t[m.toLowerCase()];if(!$)throw new TypeError("invalid suite type");if(typeof v=="string"&&(v=n.from(v)),v.length!==$.key/8)throw new TypeError("invalid key length "+v.length);if(typeof g=="string"&&(g=n.from(g)),$.mode!=="GCM"&&g.length!==$.iv)throw new TypeError("invalid iv length "+g.length);return $.type==="stream"?new a($.module,v,g):$.type==="auth"?new e($.module,v,g):new l($.module,v,g)}function x(m,v){var g=t[m.toLowerCase()];if(!g)throw new TypeError("invalid suite type");var $=u(v,!1,g.key,g.iv);return p(m,$.key,$.iv)}return encrypter.createCipheriv=p,encrypter.createCipher=x,encrypter}var decrypter={},hasRequiredDecrypter;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var t=requireAuthCipher(),e=requireSafeBuffer$1().Buffer,n=requireModes$1(),a=requireStreamCipher(),c=requireCipherBase(),o=requireAes(),u=requireEvp_bytestokey(),h=inherits_browserExports;function l(m,v,g){c.call(this),this._cache=new b,this._last=void 0,this._cipher=new o.AES(v),this._prev=e.from(g),this._mode=m,this._autopadding=!0}h(l,c),l.prototype._update=function(m){this._cache.add(m);for(var v,g,$=[];v=this._cache.get(this._autopadding);)g=this._mode.decrypt(this,v),$.push(g);return e.concat($)},l.prototype._final=function(){var m=this._cache.flush();if(this._autopadding)return d(this._mode.decrypt(this,m));if(m)throw new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(m){return this._autopadding=!!m,this};function b(){this.cache=e.allocUnsafe(0)}b.prototype.add=function(m){this.cache=e.concat([this.cache,m])},b.prototype.get=function(m){var v;if(m){if(this.cache.length>16)return v=this.cache.slice(0,16),this.cache=this.cache.slice(16),v}else if(this.cache.length>=16)return v=this.cache.slice(0,16),this.cache=this.cache.slice(16),v;return null},b.prototype.flush=function(){if(this.cache.length)return this.cache};function d(m){var v=m[15];if(v<1||v>16)throw new Error("unable to decrypt data");for(var g=-1;++g<v;)if(m[g+(16-v)]!==v)throw new Error("unable to decrypt data");if(v!==16)return m.slice(0,16-v)}function p(m,v,g){var $=n[m.toLowerCase()];if(!$)throw new TypeError("invalid suite type");if(typeof g=="string"&&(g=e.from(g)),$.mode!=="GCM"&&g.length!==$.iv)throw new TypeError("invalid iv length "+g.length);if(typeof v=="string"&&(v=e.from(v)),v.length!==$.key/8)throw new TypeError("invalid key length "+v.length);return $.type==="stream"?new a($.module,v,g,!0):$.type==="auth"?new t($.module,v,g,!0):new l($.module,v,g)}function x(m,v){var g=n[m.toLowerCase()];if(!g)throw new TypeError("invalid suite type");var $=u(v,!1,g.key,g.iv);return p(m,$.key,$.iv)}return decrypter.createDecipher=x,decrypter.createDecipheriv=p,decrypter}var hasRequiredBrowser$6;function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$5;hasRequiredBrowser$6=1;var t=requireEncrypter(),e=requireDecrypter(),n=require$$2;function a(){return Object.keys(n)}return browser$5.createCipher=browser$5.Cipher=t.createCipher,browser$5.createCipheriv=browser$5.Cipheriv=t.createCipheriv,browser$5.createDecipher=browser$5.Decipher=e.createDecipher,browser$5.createDecipheriv=browser$5.Decipheriv=e.createDecipheriv,browser$5.listCiphers=browser$5.getCiphers=a,browser$5}var modes={},hasRequiredModes;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,function(t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}}(modes)),modes}var hasRequiredBrowser$5;function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var t=requireBrowserifyDes(),e=requireBrowser$6(),n=requireModes$1(),a=requireModes(),c=requireEvp_bytestokey();function o(d,p){d=d.toLowerCase();var x,m;if(n[d])x=n[d].key,m=n[d].iv;else if(a[d])x=a[d].key*8,m=a[d].iv;else throw new TypeError("invalid suite type");var v=c(p,!1,x,m);return h(d,v.key,v.iv)}function u(d,p){d=d.toLowerCase();var x,m;if(n[d])x=n[d].key,m=n[d].iv;else if(a[d])x=a[d].key*8,m=a[d].iv;else throw new TypeError("invalid suite type");var v=c(p,!1,x,m);return l(d,v.key,v.iv)}function h(d,p,x){if(d=d.toLowerCase(),n[d])return e.createCipheriv(d,p,x);if(a[d])return new t({key:p,iv:x,mode:d});throw new TypeError("invalid suite type")}function l(d,p,x){if(d=d.toLowerCase(),n[d])return e.createDecipheriv(d,p,x);if(a[d])return new t({key:p,iv:x,mode:d,decrypt:!0});throw new TypeError("invalid suite type")}function b(){return Object.keys(a).concat(e.getCiphers())}return browser$6.createCipher=browser$6.Cipher=o,browser$6.createCipheriv=browser$6.Cipheriv=h,browser$6.createDecipher=browser$6.Decipher=u,browser$6.createDecipheriv=browser$6.Decipheriv=l,browser$6.listCiphers=browser$6.getCiphers=b,browser$6}var browser$4={},mr,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var t=bnExports,e=requireBrorand();function n(a){this.rand=a||new e.Rand}return mr=n,n.create=function(c){return new n(c)},n.prototype._randbelow=function(c){var o=c.bitLength(),u=Math.ceil(o/8);do var h=new t(this.rand.generate(u));while(h.cmp(c)>=0);return h},n.prototype._randrange=function(c,o){var u=o.sub(c);return c.add(this._randbelow(u))},n.prototype.test=function(c,o,u){var h=c.bitLength(),l=t.mont(c),b=new t(1).toRed(l);o||(o=Math.max(1,h/48|0));for(var d=c.subn(1),p=0;!d.testn(p);p++);for(var x=c.shrn(p),m=d.toRed(l),v=!0;o>0;o--){var g=this._randrange(new t(2),d);u&&u(g);var $=g.toRed(l).redPow(x);if(!($.cmp(b)===0||$.cmp(m)===0)){for(var B=1;B<p;B++){if($=$.redSqr(),$.cmp(b)===0)return!1;if($.cmp(m)===0)break}if(B===p)return!1}}return v},n.prototype.getDivisor=function(c,o){var u=c.bitLength(),h=t.mont(c),l=new t(1).toRed(h);o||(o=Math.max(1,u/48|0));for(var b=c.subn(1),d=0;!b.testn(d);d++);for(var p=c.shrn(d),x=b.toRed(h);o>0;o--){var m=this._randrange(new t(2),b),v=c.gcd(m);if(v.cmpn(1)!==0)return v;var g=m.toRed(h).redPow(p);if(!(g.cmp(l)===0||g.cmp(x)===0)){for(var $=1;$<d;$++){if(g=g.redSqr(),g.cmp(l)===0)return g.fromRed().subn(1).gcd(c);if(g.cmp(x)===0)break}if($===d)return g=g.redSqr(),g.fromRed().subn(1).gcd(c)}}return!1},mr}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var t=requireBrowser$b();generatePrime=$,$.simpleSieve=v,$.fermatTest=g;var e=bnExports,n=new e(24),a=requireMr(),c=new a,o=new e(1),u=new e(2),h=new e(5);new e(16),new e(8);var l=new e(10),b=new e(3);new e(7);var d=new e(11),p=new e(4);new e(12);var x=null;function m(){if(x!==null)return x;var B=1048576,C=[];C[0]=2;for(var F=1,H=3;H<B;H+=2){for(var W=Math.ceil(Math.sqrt(H)),Z=0;Z<F&&C[Z]<=W&&H%C[Z]!==0;Z++);F!==Z&&C[Z]<=W||(C[F++]=H)}return x=C,C}function v(B){for(var C=m(),F=0;F<C.length;F++)if(B.modn(C[F])===0)return B.cmpn(C[F])===0;return!0}function g(B){var C=e.mont(B);return u.toRed(C).redPow(B.subn(1)).fromRed().cmpn(1)===0}function $(B,C){if(B<16)return C===2||C===5?new e([140,123]):new e([140,39]);C=new e(C);for(var F,H;;){for(F=new e(t(Math.ceil(B/8)));F.bitLength()>B;)F.ishrn(1);if(F.isEven()&&F.iadd(o),F.testn(1)||F.iadd(u),C.cmp(u)){if(!C.cmp(h))for(;F.mod(l).cmp(b);)F.iadd(p)}else for(;F.mod(n).cmp(d);)F.iadd(p);if(H=F.shrn(1),v(H)&&v(F)&&g(H)&&g(F)&&c.test(H)&&c.test(F))return F}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var t=bnExports,e=requireMr(),n=new e,a=new t(24),c=new t(11),o=new t(10),u=new t(3),h=new t(7),l=requireGeneratePrime(),b=requireBrowser$b();dh=v;function d($,B){return B=B||"utf8",Buffer.isBuffer($)||($=new Buffer($,B)),this._pub=new t($),this}function p($,B){return B=B||"utf8",Buffer.isBuffer($)||($=new Buffer($,B)),this._priv=new t($),this}var x={};function m($,B){var C=B.toString("hex"),F=[C,$.toString(16)].join("_");if(F in x)return x[F];var H=0;if($.isEven()||!l.simpleSieve||!l.fermatTest($)||!n.test($))return H+=1,C==="02"||C==="05"?H+=8:H+=4,x[F]=H,H;n.test($.shrn(1))||(H+=2);var W;switch(C){case"02":$.mod(a).cmp(c)&&(H+=8);break;case"05":W=$.mod(o),W.cmp(u)&&W.cmp(h)&&(H+=8);break;default:H+=4}return x[F]=H,H}function v($,B,C){this.setGenerator(B),this.__prime=new t($),this._prime=t.mont(this.__prime),this._primeLen=$.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,C?(this.setPublicKey=d,this.setPrivateKey=p):this._primeCode=8}Object.defineProperty(v.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=m(this.__prime,this.__gen)),this._primeCode}}),v.prototype.generateKeys=function(){return this._priv||(this._priv=new t(b(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},v.prototype.computeSecret=function($){$=new t($),$=$.toRed(this._prime);var B=$.redPow(this._priv).fromRed(),C=new Buffer(B.toArray()),F=this.getPrime();if(C.length<F.length){var H=new Buffer(F.length-C.length);H.fill(0),C=Buffer.concat([H,C])}return C},v.prototype.getPublicKey=function(B){return g(this._pub,B)},v.prototype.getPrivateKey=function(B){return g(this._priv,B)},v.prototype.getPrime=function($){return g(this.__prime,$)},v.prototype.getGenerator=function($){return g(this._gen,$)},v.prototype.setGenerator=function($,B){return B=B||"utf8",Buffer.isBuffer($)||($=new Buffer($,B)),this.__gen=$,this._gen=new t($),this};function g($,B){var C=new Buffer($.toArray());return B?C.toString(B):C}return dh}var hasRequiredBrowser$4;function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$4;hasRequiredBrowser$4=1;var t=requireGeneratePrime(),e=require$$1$1,n=requireDh();function a(u){var h=new Buffer(e[u].prime,"hex"),l=new Buffer(e[u].gen,"hex");return new n(h,l)}var c={binary:!0,hex:!0,base64:!0};function o(u,h,l,b){return Buffer.isBuffer(h)||c[h]===void 0?o(u,"binary",h,l):(h=h||"binary",b=b||"binary",l=l||new Buffer([2]),Buffer.isBuffer(l)||(l=new Buffer(l,b)),typeof u=="number"?new n(t(u,l),l,!0):(Buffer.isBuffer(u)||(u=new Buffer(u,h)),new n(u,l,!0)))}return browser$4.DiffieHellmanGroup=browser$4.createDiffieHellmanGroup=browser$4.getDiffieHellman=a,browser$4.createDiffieHellman=browser$4.DiffieHellman=o,browser$4}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof process$1>"u"||!process$1.version||process$1.version.indexOf("v0.")===0||process$1.version.indexOf("v1.")===0&&process$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:t}:processNextickArgs.exports=process$1;function t(e,n,a,c){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var o=arguments.length,u,h;switch(o){case 0:case 1:return process$1.nextTick(e);case 2:return process$1.nextTick(function(){e.call(null,n)});case 3:return process$1.nextTick(function(){e.call(null,n,a)});case 4:return process$1.nextTick(function(){e.call(null,n,a,c)});default:for(u=new Array(o-1),h=0;h<u.length;)u[h++]=arguments[h];return process$1.nextTick(function(){e.apply(null,u)})}}return processNextickArgs.exports}var isarray,hasRequiredIsarray;function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var t={}.toString;return isarray=Array.isArray||function(e){return t.call(e)=="[object Array]"},isarray}var streamBrowser,hasRequiredStreamBrowser;function requireStreamBrowser(){return hasRequiredStreamBrowser||(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter),streamBrowser}var safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(t,e){var n=require$$1$2,a=n.Buffer;function c(u,h){for(var l in u)h[l]=u[l]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=n:(c(n,e),e.Buffer=o);function o(u,h,l){return a(u,h,l)}c(a,o),o.from=function(u,h,l){if(typeof u=="number")throw new TypeError("Argument must not be a number");return a(u,h,l)},o.alloc=function(u,h,l){if(typeof u!="number")throw new TypeError("Argument must be a number");var b=a(u);return h!==void 0?typeof l=="string"?b.fill(h,l):b.fill(h):b.fill(0),b},o.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return a(u)},o.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(u)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1;function t(g){return Array.isArray?Array.isArray(g):v(g)==="[object Array]"}util.isArray=t;function e(g){return typeof g=="boolean"}util.isBoolean=e;function n(g){return g===null}util.isNull=n;function a(g){return g==null}util.isNullOrUndefined=a;function c(g){return typeof g=="number"}util.isNumber=c;function o(g){return typeof g=="string"}util.isString=o;function u(g){return typeof g=="symbol"}util.isSymbol=u;function h(g){return g===void 0}util.isUndefined=h;function l(g){return v(g)==="[object RegExp]"}util.isRegExp=l;function b(g){return typeof g=="object"&&g!==null}util.isObject=b;function d(g){return v(g)==="[object Date]"}util.isDate=d;function p(g){return v(g)==="[object Error]"||g instanceof Error}util.isError=p;function x(g){return typeof g=="function"}util.isFunction=x;function m(g){return g===null||typeof g=="boolean"||typeof g=="number"||typeof g=="string"||typeof g=="symbol"||typeof g>"u"}util.isPrimitive=m,util.isBuffer=require$$1$2.Buffer.isBuffer;function v(g){return Object.prototype.toString.call(g)}return util}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,function(t){function e(o,u){if(!(o instanceof u))throw new TypeError("Cannot call a class as a function")}var n=requireSafeBuffer().Buffer,a=requireUtil$1();function c(o,u,h){o.copy(u,h)}t.exports=function(){function o(){e(this,o),this.head=null,this.tail=null,this.length=0}return o.prototype.push=function(h){var l={data:h,next:null};this.length>0?this.tail.next=l:this.head=l,this.tail=l,++this.length},o.prototype.unshift=function(h){var l={data:h,next:this.head};this.length===0&&(this.tail=l),this.head=l,++this.length},o.prototype.shift=function(){if(this.length!==0){var h=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,h}},o.prototype.clear=function(){this.head=this.tail=null,this.length=0},o.prototype.join=function(h){if(this.length===0)return"";for(var l=this.head,b=""+l.data;l=l.next;)b+=h+l.data;return b},o.prototype.concat=function(h){if(this.length===0)return n.alloc(0);for(var l=n.allocUnsafe(h>>>0),b=this.head,d=0;b;)c(b.data,l,d),d+=b.data.length,b=b.next;return l},o}(),a&&a.inspect&&a.inspect.custom&&(t.exports.prototype[a.inspect.custom]=function(){var o=a.inspect({length:this.length});return this.constructor.name+" "+o})}(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var t=requireProcessNextickArgs();function e(c,o){var u=this,h=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return h||l?(o?o(c):c&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(a,this,c)):t.nextTick(a,this,c)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(c||null,function(b){!o&&b?u._writableState?u._writableState.errorEmitted||(u._writableState.errorEmitted=!0,t.nextTick(a,u,b)):t.nextTick(a,u,b):o&&o(b)}),this)}function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(c,o){c.emit("error",o)}return destroy_1={destroy:e,undestroy:n},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var t=requireProcessNextickArgs();_stream_writable=g;function e(M){var k=this;this.next=null,this.entry=null,this.finish=function(){I(k,M)}}var n=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:t.nextTick,a;g.WritableState=m;var c=Object.create(requireUtil());c.inherits=inherits_browserExports;var o={deprecate:requireBrowser$a()},u=requireStreamBrowser(),h=requireSafeBuffer().Buffer,l=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function b(M){return h.from(M)}function d(M){return h.isBuffer(M)||M instanceof l}var p=requireDestroy();c.inherits(g,u);function x(){}function m(M,k){a=a||require_stream_duplex(),M=M||{};var P=k instanceof a;this.objectMode=!!M.objectMode,P&&(this.objectMode=this.objectMode||!!M.writableObjectMode);var _=M.highWaterMark,q=M.writableHighWaterMark,E=this.objectMode?16:16*1024;_||_===0?this.highWaterMark=_:P&&(q||q===0)?this.highWaterMark=q:this.highWaterMark=E,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var j=M.decodeStrings===!1;this.decodeStrings=!j,this.defaultEncoding=M.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ee){ie(k,ee)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}m.prototype.getBuffer=function(){for(var k=this.bufferedRequest,P=[];k;)P.push(k),k=k.next;return P},function(){try{Object.defineProperty(m.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var v;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(v=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(M){return v.call(this,M)?!0:this!==g?!1:M&&M._writableState instanceof m}})):v=function(M){return M instanceof this};function g(M){if(a=a||require_stream_duplex(),!v.call(g,this)&&!(this instanceof a))return new g(M);this._writableState=new m(M,this),this.writable=!0,M&&(typeof M.write=="function"&&(this._write=M.write),typeof M.writev=="function"&&(this._writev=M.writev),typeof M.destroy=="function"&&(this._destroy=M.destroy),typeof M.final=="function"&&(this._final=M.final)),u.call(this)}g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function $(M,k){var P=new Error("write after end");M.emit("error",P),t.nextTick(k,P)}function B(M,k,P,_){var q=!0,E=!1;return P===null?E=new TypeError("May not write null values to stream"):typeof P!="string"&&P!==void 0&&!k.objectMode&&(E=new TypeError("Invalid non-string/buffer chunk")),E&&(M.emit("error",E),t.nextTick(_,E),q=!1),q}g.prototype.write=function(M,k,P){var _=this._writableState,q=!1,E=!_.objectMode&&d(M);return E&&!h.isBuffer(M)&&(M=b(M)),typeof k=="function"&&(P=k,k=null),E?k="buffer":k||(k=_.defaultEncoding),typeof P!="function"&&(P=x),_.ended?$(this,P):(E||B(this,_,M,P))&&(_.pendingcb++,q=F(this,_,E,M,k,P)),q},g.prototype.cork=function(){var M=this._writableState;M.corked++},g.prototype.uncork=function(){var M=this._writableState;M.corked&&(M.corked--,!M.writing&&!M.corked&&!M.bufferProcessing&&M.bufferedRequest&&de(this,M))},g.prototype.setDefaultEncoding=function(k){if(typeof k=="string"&&(k=k.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((k+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+k);return this._writableState.defaultEncoding=k,this};function C(M,k,P){return!M.objectMode&&M.decodeStrings!==!1&&typeof k=="string"&&(k=h.from(k,P)),k}Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(M,k,P,_,q,E){if(!P){var j=C(k,_,q);_!==j&&(P=!0,q="buffer",_=j)}var ee=k.objectMode?1:_.length;k.length+=ee;var oe=k.length<k.highWaterMark;if(oe||(k.needDrain=!0),k.writing||k.corked){var Y=k.lastBufferedRequest;k.lastBufferedRequest={chunk:_,encoding:q,isBuf:P,callback:E,next:null},Y?Y.next=k.lastBufferedRequest:k.bufferedRequest=k.lastBufferedRequest,k.bufferedRequestCount+=1}else H(M,k,!1,ee,_,q,E);return oe}function H(M,k,P,_,q,E,j){k.writelen=_,k.writecb=j,k.writing=!0,k.sync=!0,P?M._writev(q,k.onwrite):M._write(q,E,k.onwrite),k.sync=!1}function W(M,k,P,_,q){--k.pendingcb,P?(t.nextTick(q,_),t.nextTick(y,M,k),M._writableState.errorEmitted=!0,M.emit("error",_)):(q(_),M._writableState.errorEmitted=!0,M.emit("error",_),y(M,k))}function Z(M){M.writing=!1,M.writecb=null,M.length-=M.writelen,M.writelen=0}function ie(M,k){var P=M._writableState,_=P.sync,q=P.writecb;if(Z(P),k)W(M,P,_,k,q);else{var E=J(P);!E&&!P.corked&&!P.bufferProcessing&&P.bufferedRequest&&de(M,P),_?n(te,M,P,E,q):te(M,P,E,q)}}function te(M,k,P,_){P||ae(M,k),k.pendingcb--,_(),y(M,k)}function ae(M,k){k.length===0&&k.needDrain&&(k.needDrain=!1,M.emit("drain"))}function de(M,k){k.bufferProcessing=!0;var P=k.bufferedRequest;if(M._writev&&P&&P.next){var _=k.bufferedRequestCount,q=new Array(_),E=k.corkedRequestsFree;E.entry=P;for(var j=0,ee=!0;P;)q[j]=P,P.isBuf||(ee=!1),P=P.next,j+=1;q.allBuffers=ee,H(M,k,!0,k.length,q,"",E.finish),k.pendingcb++,k.lastBufferedRequest=null,E.next?(k.corkedRequestsFree=E.next,E.next=null):k.corkedRequestsFree=new e(k),k.bufferedRequestCount=0}else{for(;P;){var oe=P.chunk,Y=P.encoding,L=P.callback,z=k.objectMode?1:oe.length;if(H(M,k,!1,z,oe,Y,L),P=P.next,k.bufferedRequestCount--,k.writing)break}P===null&&(k.lastBufferedRequest=null)}k.bufferedRequest=P,k.bufferProcessing=!1}g.prototype._write=function(M,k,P){P(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(M,k,P){var _=this._writableState;typeof M=="function"?(P=M,M=null,k=null):typeof k=="function"&&(P=k,k=null),M!=null&&this.write(M,k),_.corked&&(_.corked=1,this.uncork()),_.ending||w(this,_,P)};function J(M){return M.ending&&M.length===0&&M.bufferedRequest===null&&!M.finished&&!M.writing}function R(M,k){M._final(function(P){k.pendingcb--,P&&M.emit("error",P),k.prefinished=!0,M.emit("prefinish"),y(M,k)})}function A(M,k){!k.prefinished&&!k.finalCalled&&(typeof M._final=="function"?(k.pendingcb++,k.finalCalled=!0,t.nextTick(R,M,k)):(k.prefinished=!0,M.emit("prefinish")))}function y(M,k){var P=J(k);return P&&(A(M,k),k.pendingcb===0&&(k.finished=!0,M.emit("finish"))),P}function w(M,k,P){k.ending=!0,y(M,k),P&&(k.finished?t.nextTick(P):M.once("finish",P)),k.ended=!0,M.writable=!1}function I(M,k,P){var _=M.entry;for(M.entry=null;_;){var q=_.callback;k.pendingcb--,q(P),_=_.next}k.corkedRequestsFree.next=M}return Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(M){this._writableState&&(this._writableState.destroyed=M)}}),g.prototype.destroy=p.destroy,g.prototype._undestroy=p.undestroy,g.prototype._destroy=function(M,k){this.end(),k(M)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var t=requireProcessNextickArgs(),e=Object.keys||function(p){var x=[];for(var m in p)x.push(m);return x};_stream_duplex=l;var n=Object.create(requireUtil());n.inherits=inherits_browserExports;var a=require_stream_readable(),c=require_stream_writable();n.inherits(l,a);for(var o=e(c.prototype),u=0;u<o.length;u++){var h=o[u];l.prototype[h]||(l.prototype[h]=c.prototype[h])}function l(p){if(!(this instanceof l))return new l(p);a.call(this,p),c.call(this,p),p&&p.readable===!1&&(this.readable=!1),p&&p.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,p&&p.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",b)}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function b(){this.allowHalfOpen||this._writableState.ended||t.nextTick(d,this)}function d(p){p.end()}return Object.defineProperty(l.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(p){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=p,this._writableState.destroyed=p)}}),l.prototype._destroy=function(p,x){this.push(null),this.end(),t.nextTick(x,p)},_stream_duplex}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var t=requireProcessNextickArgs();_stream_readable=C;var e=requireIsarray(),n;C.ReadableState=B,requireEvents().EventEmitter;var a=function(L,z){return L.listeners(z).length},c=requireStreamBrowser(),o=requireSafeBuffer().Buffer,u=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function h(L){return o.from(L)}function l(L){return o.isBuffer(L)||L instanceof u}var b=Object.create(requireUtil());b.inherits=inherits_browserExports;var d=requireUtil$1(),p=void 0;d&&d.debuglog?p=d.debuglog("stream"):p=function(){};var x=requireBufferList(),m=requireDestroy(),v;b.inherits(C,c);var g=["error","close","destroy","pause","resume"];function $(L,z,re){if(typeof L.prependListener=="function")return L.prependListener(z,re);!L._events||!L._events[z]?L.on(z,re):e(L._events[z])?L._events[z].unshift(re):L._events[z]=[re,L._events[z]]}function B(L,z){n=n||require_stream_duplex(),L=L||{};var re=z instanceof n;this.objectMode=!!L.objectMode,re&&(this.objectMode=this.objectMode||!!L.readableObjectMode);var D=L.highWaterMark,G=L.readableHighWaterMark,U=this.objectMode?16:16*1024;D||D===0?this.highWaterMark=D:re&&(G||G===0)?this.highWaterMark=G:this.highWaterMark=U,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new x,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=L.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,L.encoding&&(v||(v=requireString_decoder().StringDecoder),this.decoder=new v(L.encoding),this.encoding=L.encoding)}function C(L){if(n=n||require_stream_duplex(),!(this instanceof C))return new C(L);this._readableState=new B(L,this),this.readable=!0,L&&(typeof L.read=="function"&&(this._read=L.read),typeof L.destroy=="function"&&(this._destroy=L.destroy)),c.call(this)}Object.defineProperty(C.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(L){this._readableState&&(this._readableState.destroyed=L)}}),C.prototype.destroy=m.destroy,C.prototype._undestroy=m.undestroy,C.prototype._destroy=function(L,z){this.push(null),z(L)},C.prototype.push=function(L,z){var re=this._readableState,D;return re.objectMode?D=!0:typeof L=="string"&&(z=z||re.defaultEncoding,z!==re.encoding&&(L=o.from(L,z),z=""),D=!0),F(this,L,z,!1,D)},C.prototype.unshift=function(L){return F(this,L,null,!0,!1)};function F(L,z,re,D,G){var U=L._readableState;if(z===null)U.reading=!1,de(L,U);else{var Q;G||(Q=W(U,z)),Q?L.emit("error",Q):U.objectMode||z&&z.length>0?(typeof z!="string"&&!U.objectMode&&Object.getPrototypeOf(z)!==o.prototype&&(z=h(z)),D?U.endEmitted?L.emit("error",new Error("stream.unshift() after end event")):H(L,U,z,!0):U.ended?L.emit("error",new Error("stream.push() after EOF")):(U.reading=!1,U.decoder&&!re?(z=U.decoder.write(z),U.objectMode||z.length!==0?H(L,U,z,!1):A(L,U)):H(L,U,z,!1))):D||(U.reading=!1)}return Z(U)}function H(L,z,re,D){z.flowing&&z.length===0&&!z.sync?(L.emit("data",re),L.read(0)):(z.length+=z.objectMode?1:re.length,D?z.buffer.unshift(re):z.buffer.push(re),z.needReadable&&J(L)),A(L,z)}function W(L,z){var re;return!l(z)&&typeof z!="string"&&z!==void 0&&!L.objectMode&&(re=new TypeError("Invalid non-string/buffer chunk")),re}function Z(L){return!L.ended&&(L.needReadable||L.length<L.highWaterMark||L.length===0)}C.prototype.isPaused=function(){return this._readableState.flowing===!1},C.prototype.setEncoding=function(L){return v||(v=requireString_decoder().StringDecoder),this._readableState.decoder=new v(L),this._readableState.encoding=L,this};var ie=8388608;function te(L){return L>=ie?L=ie:(L--,L|=L>>>1,L|=L>>>2,L|=L>>>4,L|=L>>>8,L|=L>>>16,L++),L}function ae(L,z){return L<=0||z.length===0&&z.ended?0:z.objectMode?1:L!==L?z.flowing&&z.length?z.buffer.head.data.length:z.length:(L>z.highWaterMark&&(z.highWaterMark=te(L)),L<=z.length?L:z.ended?z.length:(z.needReadable=!0,0))}C.prototype.read=function(L){p("read",L),L=parseInt(L,10);var z=this._readableState,re=L;if(L!==0&&(z.emittedReadable=!1),L===0&&z.needReadable&&(z.length>=z.highWaterMark||z.ended))return p("read: emitReadable",z.length,z.ended),z.length===0&&z.ended?ee(this):J(this),null;if(L=ae(L,z),L===0&&z.ended)return z.length===0&&ee(this),null;var D=z.needReadable;p("need readable",D),(z.length===0||z.length-L<z.highWaterMark)&&(D=!0,p("length less than watermark",D)),z.ended||z.reading?(D=!1,p("reading or ended",D)):D&&(p("do read"),z.reading=!0,z.sync=!0,z.length===0&&(z.needReadable=!0),this._read(z.highWaterMark),z.sync=!1,z.reading||(L=ae(re,z)));var G;return L>0?G=_(L,z):G=null,G===null?(z.needReadable=!0,L=0):z.length-=L,z.length===0&&(z.ended||(z.needReadable=!0),re!==L&&z.ended&&ee(this)),G!==null&&this.emit("data",G),G};function de(L,z){if(!z.ended){if(z.decoder){var re=z.decoder.end();re&&re.length&&(z.buffer.push(re),z.length+=z.objectMode?1:re.length)}z.ended=!0,J(L)}}function J(L){var z=L._readableState;z.needReadable=!1,z.emittedReadable||(p("emitReadable",z.flowing),z.emittedReadable=!0,z.sync?t.nextTick(R,L):R(L))}function R(L){p("emit readable"),L.emit("readable"),P(L)}function A(L,z){z.readingMore||(z.readingMore=!0,t.nextTick(y,L,z))}function y(L,z){for(var re=z.length;!z.reading&&!z.flowing&&!z.ended&&z.length<z.highWaterMark&&(p("maybeReadMore read 0"),L.read(0),re!==z.length);)re=z.length;z.readingMore=!1}C.prototype._read=function(L){this.emit("error",new Error("_read() is not implemented"))},C.prototype.pipe=function(L,z){var re=this,D=this._readableState;switch(D.pipesCount){case 0:D.pipes=L;break;case 1:D.pipes=[D.pipes,L];break;default:D.pipes.push(L);break}D.pipesCount+=1,p("pipe count=%d opts=%j",D.pipesCount,z);var G=(!z||z.end!==!1)&&L!==process$1.stdout&&L!==process$1.stderr,U=G?fe:Ne;D.endEmitted?t.nextTick(U):re.once("end",U),L.on("unpipe",Q);function Q(ve,Be){p("onunpipe"),ve===re&&Be&&Be.hasUnpiped===!1&&(Be.hasUnpiped=!0,pe())}function fe(){p("onend"),L.end()}var he=w(re);L.on("drain",he);var le=!1;function pe(){p("cleanup"),L.removeListener("close",ye),L.removeListener("finish",$e),L.removeListener("drain",he),L.removeListener("error",ge),L.removeListener("unpipe",Q),re.removeListener("end",fe),re.removeListener("end",Ne),re.removeListener("data",se),le=!0,D.awaitDrain&&(!L._writableState||L._writableState.needDrain)&&he()}var be=!1;re.on("data",se);function se(ve){p("ondata"),be=!1;var Be=L.write(ve);Be===!1&&!be&&((D.pipesCount===1&&D.pipes===L||D.pipesCount>1&&Y(D.pipes,L)!==-1)&&!le&&(p("false write response, pause",D.awaitDrain),D.awaitDrain++,be=!0),re.pause())}function ge(ve){p("onerror",ve),Ne(),L.removeListener("error",ge),a(L,"error")===0&&L.emit("error",ve)}$(L,"error",ge);function ye(){L.removeListener("finish",$e),Ne()}L.once("close",ye);function $e(){p("onfinish"),L.removeListener("close",ye),Ne()}L.once("finish",$e);function Ne(){p("unpipe"),re.unpipe(L)}return L.emit("pipe",re),D.flowing||(p("pipe resume"),re.resume()),L};function w(L){return function(){var z=L._readableState;p("pipeOnDrain",z.awaitDrain),z.awaitDrain&&z.awaitDrain--,z.awaitDrain===0&&a(L,"data")&&(z.flowing=!0,P(L))}}C.prototype.unpipe=function(L){var z=this._readableState,re={hasUnpiped:!1};if(z.pipesCount===0)return this;if(z.pipesCount===1)return L&&L!==z.pipes?this:(L||(L=z.pipes),z.pipes=null,z.pipesCount=0,z.flowing=!1,L&&L.emit("unpipe",this,re),this);if(!L){var D=z.pipes,G=z.pipesCount;z.pipes=null,z.pipesCount=0,z.flowing=!1;for(var U=0;U<G;U++)D[U].emit("unpipe",this,{hasUnpiped:!1});return this}var Q=Y(z.pipes,L);return Q===-1?this:(z.pipes.splice(Q,1),z.pipesCount-=1,z.pipesCount===1&&(z.pipes=z.pipes[0]),L.emit("unpipe",this,re),this)},C.prototype.on=function(L,z){var re=c.prototype.on.call(this,L,z);if(L==="data")this._readableState.flowing!==!1&&this.resume();else if(L==="readable"){var D=this._readableState;!D.endEmitted&&!D.readableListening&&(D.readableListening=D.needReadable=!0,D.emittedReadable=!1,D.reading?D.length&&J(this):t.nextTick(I,this))}return re},C.prototype.addListener=C.prototype.on;function I(L){p("readable nexttick read 0"),L.read(0)}C.prototype.resume=function(){var L=this._readableState;return L.flowing||(p("resume"),L.flowing=!0,M(this,L)),this};function M(L,z){z.resumeScheduled||(z.resumeScheduled=!0,t.nextTick(k,L,z))}function k(L,z){z.reading||(p("resume read 0"),L.read(0)),z.resumeScheduled=!1,z.awaitDrain=0,L.emit("resume"),P(L),z.flowing&&!z.reading&&L.read(0)}C.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function P(L){var z=L._readableState;for(p("flow",z.flowing);z.flowing&&L.read()!==null;);}C.prototype.wrap=function(L){var z=this,re=this._readableState,D=!1;L.on("end",function(){if(p("wrapped end"),re.decoder&&!re.ended){var Q=re.decoder.end();Q&&Q.length&&z.push(Q)}z.push(null)}),L.on("data",function(Q){if(p("wrapped data"),re.decoder&&(Q=re.decoder.write(Q)),!(re.objectMode&&Q==null)&&!(!re.objectMode&&(!Q||!Q.length))){var fe=z.push(Q);fe||(D=!0,L.pause())}});for(var G in L)this[G]===void 0&&typeof L[G]=="function"&&(this[G]=function(Q){return function(){return L[Q].apply(L,arguments)}}(G));for(var U=0;U<g.length;U++)L.on(g[U],this.emit.bind(this,g[U]));return this._read=function(Q){p("wrapped _read",Q),D&&(D=!1,L.resume())},this},Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),C._fromList=_;function _(L,z){if(z.length===0)return null;var re;return z.objectMode?re=z.buffer.shift():!L||L>=z.length?(z.decoder?re=z.buffer.join(""):z.buffer.length===1?re=z.buffer.head.data:re=z.buffer.concat(z.length),z.buffer.clear()):re=q(L,z.buffer,z.decoder),re}function q(L,z,re){var D;return L<z.head.data.length?(D=z.head.data.slice(0,L),z.head.data=z.head.data.slice(L)):L===z.head.data.length?D=z.shift():D=re?E(L,z):j(L,z),D}function E(L,z){var re=z.head,D=1,G=re.data;for(L-=G.length;re=re.next;){var U=re.data,Q=L>U.length?U.length:L;if(Q===U.length?G+=U:G+=U.slice(0,L),L-=Q,L===0){Q===U.length?(++D,re.next?z.head=re.next:z.head=z.tail=null):(z.head=re,re.data=U.slice(Q));break}++D}return z.length-=D,G}function j(L,z){var re=o.allocUnsafe(L),D=z.head,G=1;for(D.data.copy(re),L-=D.data.length;D=D.next;){var U=D.data,Q=L>U.length?U.length:L;if(U.copy(re,re.length-L,0,Q),L-=Q,L===0){Q===U.length?(++G,D.next?z.head=D.next:z.head=z.tail=null):(z.head=D,D.data=U.slice(Q));break}++G}return z.length-=G,re}function ee(L){var z=L._readableState;if(z.length>0)throw new Error('"endReadable()" called on non-empty stream');z.endEmitted||(z.ended=!0,t.nextTick(oe,z,L))}function oe(L,z){!L.endEmitted&&L.length===0&&(L.endEmitted=!0,z.readable=!1,z.emit("end"))}function Y(L,z){for(var re=0,D=L.length;re<D;re++)if(L[re]===z)return re;return-1}return _stream_readable}var _stream_transform,hasRequired_stream_transform;function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=a;var t=require_stream_duplex(),e=Object.create(requireUtil());e.inherits=inherits_browserExports,e.inherits(a,t);function n(u,h){var l=this._transformState;l.transforming=!1;var b=l.writecb;if(!b)return this.emit("error",new Error("write callback called multiple times"));l.writechunk=null,l.writecb=null,h!=null&&this.push(h),b(u);var d=this._readableState;d.reading=!1,(d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}function a(u){if(!(this instanceof a))return new a(u);t.call(this,u),this._transformState={afterTransform:n.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",c)}function c(){var u=this;typeof this._flush=="function"?this._flush(function(h,l){o(u,h,l)}):o(this,null,null)}a.prototype.push=function(u,h){return this._transformState.needTransform=!1,t.prototype.push.call(this,u,h)},a.prototype._transform=function(u,h,l){throw new Error("_transform() is not implemented")},a.prototype._write=function(u,h,l){var b=this._transformState;if(b.writecb=l,b.writechunk=u,b.writeencoding=h,!b.transforming){var d=this._readableState;(b.needTransform||d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}},a.prototype._read=function(u){var h=this._transformState;h.writechunk!==null&&h.writecb&&!h.transforming?(h.transforming=!0,this._transform(h.writechunk,h.writeencoding,h.afterTransform)):h.needTransform=!0},a.prototype._destroy=function(u,h){var l=this;t.prototype._destroy.call(this,u,function(b){h(b),l.emit("close")})};function o(u,h,l){if(h)return u.emit("error",h);if(l!=null&&u.push(l),u._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(u._transformState.transforming)throw new Error("Calling transform done when still transforming");return u.push(null)}return _stream_transform}var _stream_passthrough,hasRequired_stream_passthrough;function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=n;var t=require_stream_transform(),e=Object.create(requireUtil());e.inherits=inherits_browserExports,e.inherits(n,t);function n(a){if(!(this instanceof n))return new n(a);t.call(this,a)}return n.prototype._transform=function(a,c,o){o(null,a)},_stream_passthrough}var hasRequiredReadableBrowser;function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,function(t,e){e=t.exports=require_stream_readable(),e.Stream=e,e.Readable=e,e.Writable=require_stream_writable(),e.Duplex=require_stream_duplex(),e.Transform=require_stream_transform(),e.PassThrough=require_stream_passthrough()}(readableBrowser,readableBrowser.exports)),readableBrowser.exports}var sign$1={exports:{}},bn={exports:{}};bn.exports;var hasRequiredBn;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,function(t){(function(e,n){function a(A,y){if(!A)throw new Error(y||"Assertion failed")}function c(A,y){A.super_=y;var w=function(){};w.prototype=y.prototype,A.prototype=new w,A.prototype.constructor=A}function o(A,y,w){if(o.isBN(A))return A;this.negative=0,this.words=null,this.length=0,this.red=null,A!==null&&((y==="le"||y==="be")&&(w=y,y=10),this._init(A||0,y||10,w||"be"))}typeof e=="object"?e.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=require$$1$2.Buffer}catch{}o.isBN=function(y){return y instanceof o?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===o.wordSize&&Array.isArray(y.words)},o.max=function(y,w){return y.cmp(w)>0?y:w},o.min=function(y,w){return y.cmp(w)<0?y:w},o.prototype._init=function(y,w,I){if(typeof y=="number")return this._initNumber(y,w,I);if(typeof y=="object")return this._initArray(y,w,I);w==="hex"&&(w=16),a(w===(w|0)&&w>=2&&w<=36),y=y.toString().replace(/\s+/g,"");var M=0;y[0]==="-"&&(M++,this.negative=1),M<y.length&&(w===16?this._parseHex(y,M,I):(this._parseBase(y,w,M),I==="le"&&this._initArray(this.toArray(),w,I)))},o.prototype._initNumber=function(y,w,I){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(a(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),I==="le"&&this._initArray(this.toArray(),w,I)},o.prototype._initArray=function(y,w,I){if(a(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var k,P,_=0;if(I==="be")for(M=y.length-1,k=0;M>=0;M-=3)P=y[M]|y[M-1]<<8|y[M-2]<<16,this.words[k]|=P<<_&67108863,this.words[k+1]=P>>>26-_&67108863,_+=24,_>=26&&(_-=26,k++);else if(I==="le")for(M=0,k=0;M<y.length;M+=3)P=y[M]|y[M+1]<<8|y[M+2]<<16,this.words[k]|=P<<_&67108863,this.words[k+1]=P>>>26-_&67108863,_+=24,_>=26&&(_-=26,k++);return this._strip()};function h(A,y){var w=A.charCodeAt(y);if(w>=48&&w<=57)return w-48;if(w>=65&&w<=70)return w-55;if(w>=97&&w<=102)return w-87;a(!1,"Invalid character in "+A)}function l(A,y,w){var I=h(A,w);return w-1>=y&&(I|=h(A,w-1)<<4),I}o.prototype._parseHex=function(y,w,I){this.length=Math.ceil((y.length-w)/6),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var k=0,P=0,_;if(I==="be")for(M=y.length-1;M>=w;M-=2)_=l(y,w,M)<<k,this.words[P]|=_&67108863,k>=18?(k-=18,P+=1,this.words[P]|=_>>>26):k+=8;else{var q=y.length-w;for(M=q%2===0?w+1:w;M<y.length;M+=2)_=l(y,w,M)<<k,this.words[P]|=_&67108863,k>=18?(k-=18,P+=1,this.words[P]|=_>>>26):k+=8}this._strip()};function b(A,y,w,I){for(var M=0,k=0,P=Math.min(A.length,w),_=y;_<P;_++){var q=A.charCodeAt(_)-48;M*=I,q>=49?k=q-49+10:q>=17?k=q-17+10:k=q,a(q>=0&&k<I,"Invalid character"),M+=k}return M}o.prototype._parseBase=function(y,w,I){this.words=[0],this.length=1;for(var M=0,k=1;k<=67108863;k*=w)M++;M--,k=k/w|0;for(var P=y.length-I,_=P%M,q=Math.min(P,P-_)+I,E=0,j=I;j<q;j+=M)E=b(y,j,j+M,w),this.imuln(k),this.words[0]+E<67108864?this.words[0]+=E:this._iaddn(E);if(_!==0){var ee=1;for(E=b(y,j,y.length,w),j=0;j<_;j++)ee*=w;this.imuln(ee),this.words[0]+E<67108864?this.words[0]+=E:this._iaddn(E)}this._strip()},o.prototype.copy=function(y){y.words=new Array(this.length);for(var w=0;w<this.length;w++)y.words[w]=this.words[w];y.length=this.length,y.negative=this.negative,y.red=this.red};function d(A,y){A.words=y.words,A.length=y.length,A.negative=y.negative,A.red=y.red}if(o.prototype._move=function(y){d(y,this)},o.prototype.clone=function(){var y=new o(null);return this.copy(y),y},o.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=p}catch{o.prototype.inspect=p}else o.prototype.inspect=p;function p(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var x=["","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"],m=[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],v=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(y,w){y=y||10,w=w|0||1;var I;if(y===16||y==="hex"){I="";for(var M=0,k=0,P=0;P<this.length;P++){var _=this.words[P],q=((_<<M|k)&16777215).toString(16);k=_>>>24-M&16777215,M+=2,M>=26&&(M-=26,P--),k!==0||P!==this.length-1?I=x[6-q.length]+q+I:I=q+I}for(k!==0&&(I=k.toString(16)+I);I.length%w!==0;)I="0"+I;return this.negative!==0&&(I="-"+I),I}if(y===(y|0)&&y>=2&&y<=36){var E=m[y],j=v[y];I="";var ee=this.clone();for(ee.negative=0;!ee.isZero();){var oe=ee.modrn(j).toString(y);ee=ee.idivn(j),ee.isZero()?I=oe+I:I=x[E-oe.length]+oe+I}for(this.isZero()&&(I="0"+I);I.length%w!==0;)I="0"+I;return this.negative!==0&&(I="-"+I),I}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},o.prototype.toJSON=function(){return this.toString(16,2)},u&&(o.prototype.toBuffer=function(y,w){return this.toArrayLike(u,y,w)}),o.prototype.toArray=function(y,w){return this.toArrayLike(Array,y,w)};var g=function(y,w){return y.allocUnsafe?y.allocUnsafe(w):new y(w)};o.prototype.toArrayLike=function(y,w,I){this._strip();var M=this.byteLength(),k=I||Math.max(1,M);a(M<=k,"byte array longer than desired length"),a(k>0,"Requested array length <= 0");var P=g(y,k),_=w==="le"?"LE":"BE";return this["_toArrayLike"+_](P,M),P},o.prototype._toArrayLikeLE=function(y,w){for(var I=0,M=0,k=0,P=0;k<this.length;k++){var _=this.words[k]<<P|M;y[I++]=_&255,I<y.length&&(y[I++]=_>>8&255),I<y.length&&(y[I++]=_>>16&255),P===6?(I<y.length&&(y[I++]=_>>24&255),M=0,P=0):(M=_>>>24,P+=2)}if(I<y.length)for(y[I++]=M;I<y.length;)y[I++]=0},o.prototype._toArrayLikeBE=function(y,w){for(var I=y.length-1,M=0,k=0,P=0;k<this.length;k++){var _=this.words[k]<<P|M;y[I--]=_&255,I>=0&&(y[I--]=_>>8&255),I>=0&&(y[I--]=_>>16&255),P===6?(I>=0&&(y[I--]=_>>24&255),M=0,P=0):(M=_>>>24,P+=2)}if(I>=0)for(y[I--]=M;I>=0;)y[I--]=0},Math.clz32?o.prototype._countBits=function(y){return 32-Math.clz32(y)}:o.prototype._countBits=function(y){var w=y,I=0;return w>=4096&&(I+=13,w>>>=13),w>=64&&(I+=7,w>>>=7),w>=8&&(I+=4,w>>>=4),w>=2&&(I+=2,w>>>=2),I+w},o.prototype._zeroBits=function(y){if(y===0)return 26;var w=y,I=0;return w&8191||(I+=13,w>>>=13),w&127||(I+=7,w>>>=7),w&15||(I+=4,w>>>=4),w&3||(I+=2,w>>>=2),w&1||I++,I},o.prototype.bitLength=function(){var y=this.words[this.length-1],w=this._countBits(y);return(this.length-1)*26+w};function $(A){for(var y=new Array(A.bitLength()),w=0;w<y.length;w++){var I=w/26|0,M=w%26;y[w]=A.words[I]>>>M&1}return y}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,w=0;w<this.length;w++){var I=this._zeroBits(this.words[w]);if(y+=I,I!==26)break}return y},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},o.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var w=0;w<y.length;w++)this.words[w]=this.words[w]|y.words[w];return this._strip()},o.prototype.ior=function(y){return a((this.negative|y.negative)===0),this.iuor(y)},o.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},o.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},o.prototype.iuand=function(y){var w;this.length>y.length?w=y:w=this;for(var I=0;I<w.length;I++)this.words[I]=this.words[I]&y.words[I];return this.length=w.length,this._strip()},o.prototype.iand=function(y){return a((this.negative|y.negative)===0),this.iuand(y)},o.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},o.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},o.prototype.iuxor=function(y){var w,I;this.length>y.length?(w=this,I=y):(w=y,I=this);for(var M=0;M<I.length;M++)this.words[M]=w.words[M]^I.words[M];if(this!==w)for(;M<w.length;M++)this.words[M]=w.words[M];return this.length=w.length,this._strip()},o.prototype.ixor=function(y){return a((this.negative|y.negative)===0),this.iuxor(y)},o.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},o.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},o.prototype.inotn=function(y){a(typeof y=="number"&&y>=0);var w=Math.ceil(y/26)|0,I=y%26;this._expand(w),I>0&&w--;for(var M=0;M<w;M++)this.words[M]=~this.words[M]&67108863;return I>0&&(this.words[M]=~this.words[M]&67108863>>26-I),this._strip()},o.prototype.notn=function(y){return this.clone().inotn(y)},o.prototype.setn=function(y,w){a(typeof y=="number"&&y>=0);var I=y/26|0,M=y%26;return this._expand(I+1),w?this.words[I]=this.words[I]|1<<M:this.words[I]=this.words[I]&~(1<<M),this._strip()},o.prototype.iadd=function(y){var w;if(this.negative!==0&&y.negative===0)return this.negative=0,w=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,w=this.isub(y),y.negative=1,w._normSign();var I,M;this.length>y.length?(I=this,M=y):(I=y,M=this);for(var k=0,P=0;P<M.length;P++)w=(I.words[P]|0)+(M.words[P]|0)+k,this.words[P]=w&67108863,k=w>>>26;for(;k!==0&&P<I.length;P++)w=(I.words[P]|0)+k,this.words[P]=w&67108863,k=w>>>26;if(this.length=I.length,k!==0)this.words[this.length]=k,this.length++;else if(I!==this)for(;P<I.length;P++)this.words[P]=I.words[P];return this},o.prototype.add=function(y){var w;return y.negative!==0&&this.negative===0?(y.negative=0,w=this.sub(y),y.negative^=1,w):y.negative===0&&this.negative!==0?(this.negative=0,w=y.sub(this),this.negative=1,w):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},o.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var w=this.iadd(y);return y.negative=1,w._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var I=this.cmp(y);if(I===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,k;I>0?(M=this,k=y):(M=y,k=this);for(var P=0,_=0;_<k.length;_++)w=(M.words[_]|0)-(k.words[_]|0)+P,P=w>>26,this.words[_]=w&67108863;for(;P!==0&&_<M.length;_++)w=(M.words[_]|0)+P,P=w>>26,this.words[_]=w&67108863;if(P===0&&_<M.length&&M!==this)for(;_<M.length;_++)this.words[_]=M.words[_];return this.length=Math.max(this.length,_),M!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(y){return this.clone().isub(y)};function B(A,y,w){w.negative=y.negative^A.negative;var I=A.length+y.length|0;w.length=I,I=I-1|0;var M=A.words[0]|0,k=y.words[0]|0,P=M*k,_=P&67108863,q=P/67108864|0;w.words[0]=_;for(var E=1;E<I;E++){for(var j=q>>>26,ee=q&67108863,oe=Math.min(E,y.length-1),Y=Math.max(0,E-A.length+1);Y<=oe;Y++){var L=E-Y|0;M=A.words[L]|0,k=y.words[Y]|0,P=M*k+ee,j+=P/67108864|0,ee=P&67108863}w.words[E]=ee|0,q=j|0}return q!==0?w.words[E]=q|0:w.length--,w._strip()}var C=function(y,w,I){var M=y.words,k=w.words,P=I.words,_=0,q,E,j,ee=M[0]|0,oe=ee&8191,Y=ee>>>13,L=M[1]|0,z=L&8191,re=L>>>13,D=M[2]|0,G=D&8191,U=D>>>13,Q=M[3]|0,fe=Q&8191,he=Q>>>13,le=M[4]|0,pe=le&8191,be=le>>>13,se=M[5]|0,ge=se&8191,ye=se>>>13,$e=M[6]|0,Ne=$e&8191,ve=$e>>>13,Be=M[7]|0,De=Be&8191,Se=Be>>>13,Oe=M[8]|0,je=Oe&8191,V=Oe>>>13,T=M[9]|0,O=T&8191,X=T>>>13,ne=k[0]|0,ce=ne&8191,ue=ne>>>13,me=k[1]|0,Ee=me&8191,xe=me>>>13,Ae=k[2]|0,_e=Ae&8191,Me=Ae>>>13,ze=k[3]|0,Ve=ze&8191,Ie=ze>>>13,We=k[4]|0,Je=We&8191,Pe=We>>>13,Ze=k[5]|0,Xe=Ze&8191,Te=Ze>>>13,Ye=k[6]|0,Qe=Ye&8191,ke=Ye>>>13,et=k[7]|0,tt=et&8191,qe=et>>>13,rt=k[8]|0,it=rt&8191,Ce=rt>>>13,nt=k[9]|0,Ge=nt&8191,Ke=nt>>>13;I.negative=y.negative^w.negative,I.length=19,q=Math.imul(oe,ce),E=Math.imul(oe,ue),E=E+Math.imul(Y,ce)|0,j=Math.imul(Y,ue);var ct=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(ct>>>26)|0,ct&=67108863,q=Math.imul(z,ce),E=Math.imul(z,ue),E=E+Math.imul(re,ce)|0,j=Math.imul(re,ue),q=q+Math.imul(oe,Ee)|0,E=E+Math.imul(oe,xe)|0,E=E+Math.imul(Y,Ee)|0,j=j+Math.imul(Y,xe)|0;var dt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(dt>>>26)|0,dt&=67108863,q=Math.imul(G,ce),E=Math.imul(G,ue),E=E+Math.imul(U,ce)|0,j=Math.imul(U,ue),q=q+Math.imul(z,Ee)|0,E=E+Math.imul(z,xe)|0,E=E+Math.imul(re,Ee)|0,j=j+Math.imul(re,xe)|0,q=q+Math.imul(oe,_e)|0,E=E+Math.imul(oe,Me)|0,E=E+Math.imul(Y,_e)|0,j=j+Math.imul(Y,Me)|0;var ht=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(ht>>>26)|0,ht&=67108863,q=Math.imul(fe,ce),E=Math.imul(fe,ue),E=E+Math.imul(he,ce)|0,j=Math.imul(he,ue),q=q+Math.imul(G,Ee)|0,E=E+Math.imul(G,xe)|0,E=E+Math.imul(U,Ee)|0,j=j+Math.imul(U,xe)|0,q=q+Math.imul(z,_e)|0,E=E+Math.imul(z,Me)|0,E=E+Math.imul(re,_e)|0,j=j+Math.imul(re,Me)|0,q=q+Math.imul(oe,Ve)|0,E=E+Math.imul(oe,Ie)|0,E=E+Math.imul(Y,Ve)|0,j=j+Math.imul(Y,Ie)|0;var lt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(lt>>>26)|0,lt&=67108863,q=Math.imul(pe,ce),E=Math.imul(pe,ue),E=E+Math.imul(be,ce)|0,j=Math.imul(be,ue),q=q+Math.imul(fe,Ee)|0,E=E+Math.imul(fe,xe)|0,E=E+Math.imul(he,Ee)|0,j=j+Math.imul(he,xe)|0,q=q+Math.imul(G,_e)|0,E=E+Math.imul(G,Me)|0,E=E+Math.imul(U,_e)|0,j=j+Math.imul(U,Me)|0,q=q+Math.imul(z,Ve)|0,E=E+Math.imul(z,Ie)|0,E=E+Math.imul(re,Ve)|0,j=j+Math.imul(re,Ie)|0,q=q+Math.imul(oe,Je)|0,E=E+Math.imul(oe,Pe)|0,E=E+Math.imul(Y,Je)|0,j=j+Math.imul(Y,Pe)|0;var pt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(pt>>>26)|0,pt&=67108863,q=Math.imul(ge,ce),E=Math.imul(ge,ue),E=E+Math.imul(ye,ce)|0,j=Math.imul(ye,ue),q=q+Math.imul(pe,Ee)|0,E=E+Math.imul(pe,xe)|0,E=E+Math.imul(be,Ee)|0,j=j+Math.imul(be,xe)|0,q=q+Math.imul(fe,_e)|0,E=E+Math.imul(fe,Me)|0,E=E+Math.imul(he,_e)|0,j=j+Math.imul(he,Me)|0,q=q+Math.imul(G,Ve)|0,E=E+Math.imul(G,Ie)|0,E=E+Math.imul(U,Ve)|0,j=j+Math.imul(U,Ie)|0,q=q+Math.imul(z,Je)|0,E=E+Math.imul(z,Pe)|0,E=E+Math.imul(re,Je)|0,j=j+Math.imul(re,Pe)|0,q=q+Math.imul(oe,Xe)|0,E=E+Math.imul(oe,Te)|0,E=E+Math.imul(Y,Xe)|0,j=j+Math.imul(Y,Te)|0;var bt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(bt>>>26)|0,bt&=67108863,q=Math.imul(Ne,ce),E=Math.imul(Ne,ue),E=E+Math.imul(ve,ce)|0,j=Math.imul(ve,ue),q=q+Math.imul(ge,Ee)|0,E=E+Math.imul(ge,xe)|0,E=E+Math.imul(ye,Ee)|0,j=j+Math.imul(ye,xe)|0,q=q+Math.imul(pe,_e)|0,E=E+Math.imul(pe,Me)|0,E=E+Math.imul(be,_e)|0,j=j+Math.imul(be,Me)|0,q=q+Math.imul(fe,Ve)|0,E=E+Math.imul(fe,Ie)|0,E=E+Math.imul(he,Ve)|0,j=j+Math.imul(he,Ie)|0,q=q+Math.imul(G,Je)|0,E=E+Math.imul(G,Pe)|0,E=E+Math.imul(U,Je)|0,j=j+Math.imul(U,Pe)|0,q=q+Math.imul(z,Xe)|0,E=E+Math.imul(z,Te)|0,E=E+Math.imul(re,Xe)|0,j=j+Math.imul(re,Te)|0,q=q+Math.imul(oe,Qe)|0,E=E+Math.imul(oe,ke)|0,E=E+Math.imul(Y,Qe)|0,j=j+Math.imul(Y,ke)|0;var xt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(xt>>>26)|0,xt&=67108863,q=Math.imul(De,ce),E=Math.imul(De,ue),E=E+Math.imul(Se,ce)|0,j=Math.imul(Se,ue),q=q+Math.imul(Ne,Ee)|0,E=E+Math.imul(Ne,xe)|0,E=E+Math.imul(ve,Ee)|0,j=j+Math.imul(ve,xe)|0,q=q+Math.imul(ge,_e)|0,E=E+Math.imul(ge,Me)|0,E=E+Math.imul(ye,_e)|0,j=j+Math.imul(ye,Me)|0,q=q+Math.imul(pe,Ve)|0,E=E+Math.imul(pe,Ie)|0,E=E+Math.imul(be,Ve)|0,j=j+Math.imul(be,Ie)|0,q=q+Math.imul(fe,Je)|0,E=E+Math.imul(fe,Pe)|0,E=E+Math.imul(he,Je)|0,j=j+Math.imul(he,Pe)|0,q=q+Math.imul(G,Xe)|0,E=E+Math.imul(G,Te)|0,E=E+Math.imul(U,Xe)|0,j=j+Math.imul(U,Te)|0,q=q+Math.imul(z,Qe)|0,E=E+Math.imul(z,ke)|0,E=E+Math.imul(re,Qe)|0,j=j+Math.imul(re,ke)|0,q=q+Math.imul(oe,tt)|0,E=E+Math.imul(oe,qe)|0,E=E+Math.imul(Y,tt)|0,j=j+Math.imul(Y,qe)|0;var yt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(yt>>>26)|0,yt&=67108863,q=Math.imul(je,ce),E=Math.imul(je,ue),E=E+Math.imul(V,ce)|0,j=Math.imul(V,ue),q=q+Math.imul(De,Ee)|0,E=E+Math.imul(De,xe)|0,E=E+Math.imul(Se,Ee)|0,j=j+Math.imul(Se,xe)|0,q=q+Math.imul(Ne,_e)|0,E=E+Math.imul(Ne,Me)|0,E=E+Math.imul(ve,_e)|0,j=j+Math.imul(ve,Me)|0,q=q+Math.imul(ge,Ve)|0,E=E+Math.imul(ge,Ie)|0,E=E+Math.imul(ye,Ve)|0,j=j+Math.imul(ye,Ie)|0,q=q+Math.imul(pe,Je)|0,E=E+Math.imul(pe,Pe)|0,E=E+Math.imul(be,Je)|0,j=j+Math.imul(be,Pe)|0,q=q+Math.imul(fe,Xe)|0,E=E+Math.imul(fe,Te)|0,E=E+Math.imul(he,Xe)|0,j=j+Math.imul(he,Te)|0,q=q+Math.imul(G,Qe)|0,E=E+Math.imul(G,ke)|0,E=E+Math.imul(U,Qe)|0,j=j+Math.imul(U,ke)|0,q=q+Math.imul(z,tt)|0,E=E+Math.imul(z,qe)|0,E=E+Math.imul(re,tt)|0,j=j+Math.imul(re,qe)|0,q=q+Math.imul(oe,it)|0,E=E+Math.imul(oe,Ce)|0,E=E+Math.imul(Y,it)|0,j=j+Math.imul(Y,Ce)|0;var mt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(mt>>>26)|0,mt&=67108863,q=Math.imul(O,ce),E=Math.imul(O,ue),E=E+Math.imul(X,ce)|0,j=Math.imul(X,ue),q=q+Math.imul(je,Ee)|0,E=E+Math.imul(je,xe)|0,E=E+Math.imul(V,Ee)|0,j=j+Math.imul(V,xe)|0,q=q+Math.imul(De,_e)|0,E=E+Math.imul(De,Me)|0,E=E+Math.imul(Se,_e)|0,j=j+Math.imul(Se,Me)|0,q=q+Math.imul(Ne,Ve)|0,E=E+Math.imul(Ne,Ie)|0,E=E+Math.imul(ve,Ve)|0,j=j+Math.imul(ve,Ie)|0,q=q+Math.imul(ge,Je)|0,E=E+Math.imul(ge,Pe)|0,E=E+Math.imul(ye,Je)|0,j=j+Math.imul(ye,Pe)|0,q=q+Math.imul(pe,Xe)|0,E=E+Math.imul(pe,Te)|0,E=E+Math.imul(be,Xe)|0,j=j+Math.imul(be,Te)|0,q=q+Math.imul(fe,Qe)|0,E=E+Math.imul(fe,ke)|0,E=E+Math.imul(he,Qe)|0,j=j+Math.imul(he,ke)|0,q=q+Math.imul(G,tt)|0,E=E+Math.imul(G,qe)|0,E=E+Math.imul(U,tt)|0,j=j+Math.imul(U,qe)|0,q=q+Math.imul(z,it)|0,E=E+Math.imul(z,Ce)|0,E=E+Math.imul(re,it)|0,j=j+Math.imul(re,Ce)|0,q=q+Math.imul(oe,Ge)|0,E=E+Math.imul(oe,Ke)|0,E=E+Math.imul(Y,Ge)|0,j=j+Math.imul(Y,Ke)|0;var vt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(vt>>>26)|0,vt&=67108863,q=Math.imul(O,Ee),E=Math.imul(O,xe),E=E+Math.imul(X,Ee)|0,j=Math.imul(X,xe),q=q+Math.imul(je,_e)|0,E=E+Math.imul(je,Me)|0,E=E+Math.imul(V,_e)|0,j=j+Math.imul(V,Me)|0,q=q+Math.imul(De,Ve)|0,E=E+Math.imul(De,Ie)|0,E=E+Math.imul(Se,Ve)|0,j=j+Math.imul(Se,Ie)|0,q=q+Math.imul(Ne,Je)|0,E=E+Math.imul(Ne,Pe)|0,E=E+Math.imul(ve,Je)|0,j=j+Math.imul(ve,Pe)|0,q=q+Math.imul(ge,Xe)|0,E=E+Math.imul(ge,Te)|0,E=E+Math.imul(ye,Xe)|0,j=j+Math.imul(ye,Te)|0,q=q+Math.imul(pe,Qe)|0,E=E+Math.imul(pe,ke)|0,E=E+Math.imul(be,Qe)|0,j=j+Math.imul(be,ke)|0,q=q+Math.imul(fe,tt)|0,E=E+Math.imul(fe,qe)|0,E=E+Math.imul(he,tt)|0,j=j+Math.imul(he,qe)|0,q=q+Math.imul(G,it)|0,E=E+Math.imul(G,Ce)|0,E=E+Math.imul(U,it)|0,j=j+Math.imul(U,Ce)|0,q=q+Math.imul(z,Ge)|0,E=E+Math.imul(z,Ke)|0,E=E+Math.imul(re,Ge)|0,j=j+Math.imul(re,Ke)|0;var qt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(qt>>>26)|0,qt&=67108863,q=Math.imul(O,_e),E=Math.imul(O,Me),E=E+Math.imul(X,_e)|0,j=Math.imul(X,Me),q=q+Math.imul(je,Ve)|0,E=E+Math.imul(je,Ie)|0,E=E+Math.imul(V,Ve)|0,j=j+Math.imul(V,Ie)|0,q=q+Math.imul(De,Je)|0,E=E+Math.imul(De,Pe)|0,E=E+Math.imul(Se,Je)|0,j=j+Math.imul(Se,Pe)|0,q=q+Math.imul(Ne,Xe)|0,E=E+Math.imul(Ne,Te)|0,E=E+Math.imul(ve,Xe)|0,j=j+Math.imul(ve,Te)|0,q=q+Math.imul(ge,Qe)|0,E=E+Math.imul(ge,ke)|0,E=E+Math.imul(ye,Qe)|0,j=j+Math.imul(ye,ke)|0,q=q+Math.imul(pe,tt)|0,E=E+Math.imul(pe,qe)|0,E=E+Math.imul(be,tt)|0,j=j+Math.imul(be,qe)|0,q=q+Math.imul(fe,it)|0,E=E+Math.imul(fe,Ce)|0,E=E+Math.imul(he,it)|0,j=j+Math.imul(he,Ce)|0,q=q+Math.imul(G,Ge)|0,E=E+Math.imul(G,Ke)|0,E=E+Math.imul(U,Ge)|0,j=j+Math.imul(U,Ke)|0;var Ct=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,q=Math.imul(O,Ve),E=Math.imul(O,Ie),E=E+Math.imul(X,Ve)|0,j=Math.imul(X,Ie),q=q+Math.imul(je,Je)|0,E=E+Math.imul(je,Pe)|0,E=E+Math.imul(V,Je)|0,j=j+Math.imul(V,Pe)|0,q=q+Math.imul(De,Xe)|0,E=E+Math.imul(De,Te)|0,E=E+Math.imul(Se,Xe)|0,j=j+Math.imul(Se,Te)|0,q=q+Math.imul(Ne,Qe)|0,E=E+Math.imul(Ne,ke)|0,E=E+Math.imul(ve,Qe)|0,j=j+Math.imul(ve,ke)|0,q=q+Math.imul(ge,tt)|0,E=E+Math.imul(ge,qe)|0,E=E+Math.imul(ye,tt)|0,j=j+Math.imul(ye,qe)|0,q=q+Math.imul(pe,it)|0,E=E+Math.imul(pe,Ce)|0,E=E+Math.imul(be,it)|0,j=j+Math.imul(be,Ce)|0,q=q+Math.imul(fe,Ge)|0,E=E+Math.imul(fe,Ke)|0,E=E+Math.imul(he,Ge)|0,j=j+Math.imul(he,Ke)|0;var Nt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,q=Math.imul(O,Je),E=Math.imul(O,Pe),E=E+Math.imul(X,Je)|0,j=Math.imul(X,Pe),q=q+Math.imul(je,Xe)|0,E=E+Math.imul(je,Te)|0,E=E+Math.imul(V,Xe)|0,j=j+Math.imul(V,Te)|0,q=q+Math.imul(De,Qe)|0,E=E+Math.imul(De,ke)|0,E=E+Math.imul(Se,Qe)|0,j=j+Math.imul(Se,ke)|0,q=q+Math.imul(Ne,tt)|0,E=E+Math.imul(Ne,qe)|0,E=E+Math.imul(ve,tt)|0,j=j+Math.imul(ve,qe)|0,q=q+Math.imul(ge,it)|0,E=E+Math.imul(ge,Ce)|0,E=E+Math.imul(ye,it)|0,j=j+Math.imul(ye,Ce)|0,q=q+Math.imul(pe,Ge)|0,E=E+Math.imul(pe,Ke)|0,E=E+Math.imul(be,Ge)|0,j=j+Math.imul(be,Ke)|0;var Ot=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,q=Math.imul(O,Xe),E=Math.imul(O,Te),E=E+Math.imul(X,Xe)|0,j=Math.imul(X,Te),q=q+Math.imul(je,Qe)|0,E=E+Math.imul(je,ke)|0,E=E+Math.imul(V,Qe)|0,j=j+Math.imul(V,ke)|0,q=q+Math.imul(De,tt)|0,E=E+Math.imul(De,qe)|0,E=E+Math.imul(Se,tt)|0,j=j+Math.imul(Se,qe)|0,q=q+Math.imul(Ne,it)|0,E=E+Math.imul(Ne,Ce)|0,E=E+Math.imul(ve,it)|0,j=j+Math.imul(ve,Ce)|0,q=q+Math.imul(ge,Ge)|0,E=E+Math.imul(ge,Ke)|0,E=E+Math.imul(ye,Ge)|0,j=j+Math.imul(ye,Ke)|0;var Dt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,q=Math.imul(O,Qe),E=Math.imul(O,ke),E=E+Math.imul(X,Qe)|0,j=Math.imul(X,ke),q=q+Math.imul(je,tt)|0,E=E+Math.imul(je,qe)|0,E=E+Math.imul(V,tt)|0,j=j+Math.imul(V,qe)|0,q=q+Math.imul(De,it)|0,E=E+Math.imul(De,Ce)|0,E=E+Math.imul(Se,it)|0,j=j+Math.imul(Se,Ce)|0,q=q+Math.imul(Ne,Ge)|0,E=E+Math.imul(Ne,Ke)|0,E=E+Math.imul(ve,Ge)|0,j=j+Math.imul(ve,Ke)|0;var Lt=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,q=Math.imul(O,tt),E=Math.imul(O,qe),E=E+Math.imul(X,tt)|0,j=Math.imul(X,qe),q=q+Math.imul(je,it)|0,E=E+Math.imul(je,Ce)|0,E=E+Math.imul(V,it)|0,j=j+Math.imul(V,Ce)|0,q=q+Math.imul(De,Ge)|0,E=E+Math.imul(De,Ke)|0,E=E+Math.imul(Se,Ge)|0,j=j+Math.imul(Se,Ke)|0;var Ft=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,q=Math.imul(O,it),E=Math.imul(O,Ce),E=E+Math.imul(X,it)|0,j=Math.imul(X,Ce),q=q+Math.imul(je,Ge)|0,E=E+Math.imul(je,Ke)|0,E=E+Math.imul(V,Ge)|0,j=j+Math.imul(V,Ke)|0;var pr=(_+q|0)+((E&8191)<<13)|0;_=(j+(E>>>13)|0)+(pr>>>26)|0,pr&=67108863,q=Math.imul(O,Ge),E=Math.imul(O,Ke),E=E+Math.imul(X,Ge)|0,j=Math.imul(X,Ke);var br=(_+q|0)+((E&8191)<<13)|0;return _=(j+(E>>>13)|0)+(br>>>26)|0,br&=67108863,P[0]=ct,P[1]=dt,P[2]=ht,P[3]=lt,P[4]=pt,P[5]=bt,P[6]=xt,P[7]=yt,P[8]=mt,P[9]=vt,P[10]=qt,P[11]=Ct,P[12]=Nt,P[13]=Ot,P[14]=Dt,P[15]=Lt,P[16]=Ft,P[17]=pr,P[18]=br,_!==0&&(P[19]=_,I.length++),I};Math.imul||(C=B);function F(A,y,w){w.negative=y.negative^A.negative,w.length=A.length+y.length;for(var I=0,M=0,k=0;k<w.length-1;k++){var P=M;M=0;for(var _=I&67108863,q=Math.min(k,y.length-1),E=Math.max(0,k-A.length+1);E<=q;E++){var j=k-E,ee=A.words[j]|0,oe=y.words[E]|0,Y=ee*oe,L=Y&67108863;P=P+(Y/67108864|0)|0,L=L+_|0,_=L&67108863,P=P+(L>>>26)|0,M+=P>>>26,P&=67108863}w.words[k]=_,I=P,P=M}return I!==0?w.words[k]=I:w.length--,w._strip()}function H(A,y,w){return F(A,y,w)}o.prototype.mulTo=function(y,w){var I,M=this.length+y.length;return this.length===10&&y.length===10?I=C(this,y,w):M<63?I=B(this,y,w):M<1024?I=F(this,y,w):I=H(this,y,w),I},o.prototype.mul=function(y){var w=new o(null);return w.words=new Array(this.length+y.length),this.mulTo(y,w)},o.prototype.mulf=function(y){var w=new o(null);return w.words=new Array(this.length+y.length),H(this,y,w)},o.prototype.imul=function(y){return this.clone().mulTo(y,this)},o.prototype.imuln=function(y){var w=y<0;w&&(y=-y),a(typeof y=="number"),a(y<67108864);for(var I=0,M=0;M<this.length;M++){var k=(this.words[M]|0)*y,P=(k&67108863)+(I&67108863);I>>=26,I+=k/67108864|0,I+=P>>>26,this.words[M]=P&67108863}return I!==0&&(this.words[M]=I,this.length++),w?this.ineg():this},o.prototype.muln=function(y){return this.clone().imuln(y)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(y){var w=$(y);if(w.length===0)return new o(1);for(var I=this,M=0;M<w.length&&w[M]===0;M++,I=I.sqr());if(++M<w.length)for(var k=I.sqr();M<w.length;M++,k=k.sqr())w[M]!==0&&(I=I.mul(k));return I},o.prototype.iushln=function(y){a(typeof y=="number"&&y>=0);var w=y%26,I=(y-w)/26,M=67108863>>>26-w<<26-w,k;if(w!==0){var P=0;for(k=0;k<this.length;k++){var _=this.words[k]&M,q=(this.words[k]|0)-_<<w;this.words[k]=q|P,P=_>>>26-w}P&&(this.words[k]=P,this.length++)}if(I!==0){for(k=this.length-1;k>=0;k--)this.words[k+I]=this.words[k];for(k=0;k<I;k++)this.words[k]=0;this.length+=I}return this._strip()},o.prototype.ishln=function(y){return a(this.negative===0),this.iushln(y)},o.prototype.iushrn=function(y,w,I){a(typeof y=="number"&&y>=0);var M;w?M=(w-w%26)/26:M=0;var k=y%26,P=Math.min((y-k)/26,this.length),_=67108863^67108863>>>k<<k,q=I;if(M-=P,M=Math.max(0,M),q){for(var E=0;E<P;E++)q.words[E]=this.words[E];q.length=P}if(P!==0)if(this.length>P)for(this.length-=P,E=0;E<this.length;E++)this.words[E]=this.words[E+P];else this.words[0]=0,this.length=1;var j=0;for(E=this.length-1;E>=0&&(j!==0||E>=M);E--){var ee=this.words[E]|0;this.words[E]=j<<26-k|ee>>>k,j=ee&_}return q&&j!==0&&(q.words[q.length++]=j),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(y,w,I){return a(this.negative===0),this.iushrn(y,w,I)},o.prototype.shln=function(y){return this.clone().ishln(y)},o.prototype.ushln=function(y){return this.clone().iushln(y)},o.prototype.shrn=function(y){return this.clone().ishrn(y)},o.prototype.ushrn=function(y){return this.clone().iushrn(y)},o.prototype.testn=function(y){a(typeof y=="number"&&y>=0);var w=y%26,I=(y-w)/26,M=1<<w;if(this.length<=I)return!1;var k=this.words[I];return!!(k&M)},o.prototype.imaskn=function(y){a(typeof y=="number"&&y>=0);var w=y%26,I=(y-w)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=I)return this;if(w!==0&&I++,this.length=Math.min(I,this.length),w!==0){var M=67108863^67108863>>>w<<w;this.words[this.length-1]&=M}return this._strip()},o.prototype.maskn=function(y){return this.clone().imaskn(y)},o.prototype.iaddn=function(y){return a(typeof y=="number"),a(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},o.prototype._iaddn=function(y){this.words[0]+=y;for(var w=0;w<this.length&&this.words[w]>=67108864;w++)this.words[w]-=67108864,w===this.length-1?this.words[w+1]=1:this.words[w+1]++;return this.length=Math.max(this.length,w+1),this},o.prototype.isubn=function(y){if(a(typeof y=="number"),a(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var w=0;w<this.length&&this.words[w]<0;w++)this.words[w]+=67108864,this.words[w+1]-=1;return this._strip()},o.prototype.addn=function(y){return this.clone().iaddn(y)},o.prototype.subn=function(y){return this.clone().isubn(y)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(y,w,I){var M=y.length+I,k;this._expand(M);var P,_=0;for(k=0;k<y.length;k++){P=(this.words[k+I]|0)+_;var q=(y.words[k]|0)*w;P-=q&67108863,_=(P>>26)-(q/67108864|0),this.words[k+I]=P&67108863}for(;k<this.length-I;k++)P=(this.words[k+I]|0)+_,_=P>>26,this.words[k+I]=P&67108863;if(_===0)return this._strip();for(a(_===-1),_=0,k=0;k<this.length;k++)P=-(this.words[k]|0)+_,_=P>>26,this.words[k]=P&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(y,w){var I=this.length-y.length,M=this.clone(),k=y,P=k.words[k.length-1]|0,_=this._countBits(P);I=26-_,I!==0&&(k=k.ushln(I),M.iushln(I),P=k.words[k.length-1]|0);var q=M.length-k.length,E;if(w!=="mod"){E=new o(null),E.length=q+1,E.words=new Array(E.length);for(var j=0;j<E.length;j++)E.words[j]=0}var ee=M.clone()._ishlnsubmul(k,1,q);ee.negative===0&&(M=ee,E&&(E.words[q]=1));for(var oe=q-1;oe>=0;oe--){var Y=(M.words[k.length+oe]|0)*67108864+(M.words[k.length+oe-1]|0);for(Y=Math.min(Y/P|0,67108863),M._ishlnsubmul(k,Y,oe);M.negative!==0;)Y--,M.negative=0,M._ishlnsubmul(k,1,oe),M.isZero()||(M.negative^=1);E&&(E.words[oe]=Y)}return E&&E._strip(),M._strip(),w!=="div"&&I!==0&&M.iushrn(I),{div:E||null,mod:M}},o.prototype.divmod=function(y,w,I){if(a(!y.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var M,k,P;return this.negative!==0&&y.negative===0?(P=this.neg().divmod(y,w),w!=="mod"&&(M=P.div.neg()),w!=="div"&&(k=P.mod.neg(),I&&k.negative!==0&&k.iadd(y)),{div:M,mod:k}):this.negative===0&&y.negative!==0?(P=this.divmod(y.neg(),w),w!=="mod"&&(M=P.div.neg()),{div:M,mod:P.mod}):this.negative&y.negative?(P=this.neg().divmod(y.neg(),w),w!=="div"&&(k=P.mod.neg(),I&&k.negative!==0&&k.isub(y)),{div:P.div,mod:k}):y.length>this.length||this.cmp(y)<0?{div:new o(0),mod:this}:y.length===1?w==="div"?{div:this.divn(y.words[0]),mod:null}:w==="mod"?{div:null,mod:new o(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new o(this.modrn(y.words[0]))}:this._wordDiv(y,w)},o.prototype.div=function(y){return this.divmod(y,"div",!1).div},o.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},o.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},o.prototype.divRound=function(y){var w=this.divmod(y);if(w.mod.isZero())return w.div;var I=w.div.negative!==0?w.mod.isub(y):w.mod,M=y.ushrn(1),k=y.andln(1),P=I.cmp(M);return P<0||k===1&&P===0?w.div:w.div.negative!==0?w.div.isubn(1):w.div.iaddn(1)},o.prototype.modrn=function(y){var w=y<0;w&&(y=-y),a(y<=67108863);for(var I=(1<<26)%y,M=0,k=this.length-1;k>=0;k--)M=(I*M+(this.words[k]|0))%y;return w?-M:M},o.prototype.modn=function(y){return this.modrn(y)},o.prototype.idivn=function(y){var w=y<0;w&&(y=-y),a(y<=67108863);for(var I=0,M=this.length-1;M>=0;M--){var k=(this.words[M]|0)+I*67108864;this.words[M]=k/y|0,I=k%y}return this._strip(),w?this.ineg():this},o.prototype.divn=function(y){return this.clone().idivn(y)},o.prototype.egcd=function(y){a(y.negative===0),a(!y.isZero());var w=this,I=y.clone();w.negative!==0?w=w.umod(y):w=w.clone();for(var M=new o(1),k=new o(0),P=new o(0),_=new o(1),q=0;w.isEven()&&I.isEven();)w.iushrn(1),I.iushrn(1),++q;for(var E=I.clone(),j=w.clone();!w.isZero();){for(var ee=0,oe=1;!(w.words[0]&oe)&&ee<26;++ee,oe<<=1);if(ee>0)for(w.iushrn(ee);ee-- >0;)(M.isOdd()||k.isOdd())&&(M.iadd(E),k.isub(j)),M.iushrn(1),k.iushrn(1);for(var Y=0,L=1;!(I.words[0]&L)&&Y<26;++Y,L<<=1);if(Y>0)for(I.iushrn(Y);Y-- >0;)(P.isOdd()||_.isOdd())&&(P.iadd(E),_.isub(j)),P.iushrn(1),_.iushrn(1);w.cmp(I)>=0?(w.isub(I),M.isub(P),k.isub(_)):(I.isub(w),P.isub(M),_.isub(k))}return{a:P,b:_,gcd:I.iushln(q)}},o.prototype._invmp=function(y){a(y.negative===0),a(!y.isZero());var w=this,I=y.clone();w.negative!==0?w=w.umod(y):w=w.clone();for(var M=new o(1),k=new o(0),P=I.clone();w.cmpn(1)>0&&I.cmpn(1)>0;){for(var _=0,q=1;!(w.words[0]&q)&&_<26;++_,q<<=1);if(_>0)for(w.iushrn(_);_-- >0;)M.isOdd()&&M.iadd(P),M.iushrn(1);for(var E=0,j=1;!(I.words[0]&j)&&E<26;++E,j<<=1);if(E>0)for(I.iushrn(E);E-- >0;)k.isOdd()&&k.iadd(P),k.iushrn(1);w.cmp(I)>=0?(w.isub(I),M.isub(k)):(I.isub(w),k.isub(M))}var ee;return w.cmpn(1)===0?ee=M:ee=k,ee.cmpn(0)<0&&ee.iadd(y),ee},o.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var w=this.clone(),I=y.clone();w.negative=0,I.negative=0;for(var M=0;w.isEven()&&I.isEven();M++)w.iushrn(1),I.iushrn(1);do{for(;w.isEven();)w.iushrn(1);for(;I.isEven();)I.iushrn(1);var k=w.cmp(I);if(k<0){var P=w;w=I,I=P}else if(k===0||I.cmpn(1)===0)break;w.isub(I)}while(!0);return I.iushln(M)},o.prototype.invm=function(y){return this.egcd(y).a.umod(y)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(y){return this.words[0]&y},o.prototype.bincn=function(y){a(typeof y=="number");var w=y%26,I=(y-w)/26,M=1<<w;if(this.length<=I)return this._expand(I+1),this.words[I]|=M,this;for(var k=M,P=I;k!==0&&P<this.length;P++){var _=this.words[P]|0;_+=k,k=_>>>26,_&=67108863,this.words[P]=_}return k!==0&&(this.words[P]=k,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(y){var w=y<0;if(this.negative!==0&&!w)return-1;if(this.negative===0&&w)return 1;this._strip();var I;if(this.length>1)I=1;else{w&&(y=-y),a(y<=67108863,"Number is too big");var M=this.words[0]|0;I=M===y?0:M<y?-1:1}return this.negative!==0?-I|0:I},o.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var w=this.ucmp(y);return this.negative!==0?-w|0:w},o.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var w=0,I=this.length-1;I>=0;I--){var M=this.words[I]|0,k=y.words[I]|0;if(M!==k){M<k?w=-1:M>k&&(w=1);break}}return w},o.prototype.gtn=function(y){return this.cmpn(y)===1},o.prototype.gt=function(y){return this.cmp(y)===1},o.prototype.gten=function(y){return this.cmpn(y)>=0},o.prototype.gte=function(y){return this.cmp(y)>=0},o.prototype.ltn=function(y){return this.cmpn(y)===-1},o.prototype.lt=function(y){return this.cmp(y)===-1},o.prototype.lten=function(y){return this.cmpn(y)<=0},o.prototype.lte=function(y){return this.cmp(y)<=0},o.prototype.eqn=function(y){return this.cmpn(y)===0},o.prototype.eq=function(y){return this.cmp(y)===0},o.red=function(y){return new J(y)},o.prototype.toRed=function(y){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(y){return this.red=y,this},o.prototype.forceRed=function(y){return a(!this.red,"Already a number in reduction context"),this._forceRed(y)},o.prototype.redAdd=function(y){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},o.prototype.redIAdd=function(y){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},o.prototype.redSub=function(y){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},o.prototype.redISub=function(y){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},o.prototype.redShl=function(y){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},o.prototype.redMul=function(y){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},o.prototype.redIMul=function(y){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(y){return a(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var W={k256:null,p224:null,p192:null,p25519:null};function Z(A,y){this.name=A,this.p=new o(y,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Z.prototype._tmp=function(){var y=new o(null);return y.words=new Array(Math.ceil(this.n/13)),y},Z.prototype.ireduce=function(y){var w=y,I;do this.split(w,this.tmp),w=this.imulK(w),w=w.iadd(this.tmp),I=w.bitLength();while(I>this.n);var M=I<this.n?-1:w.ucmp(this.p);return M===0?(w.words[0]=0,w.length=1):M>0?w.isub(this.p):w.strip!==void 0?w.strip():w._strip(),w},Z.prototype.split=function(y,w){y.iushrn(this.n,0,w)},Z.prototype.imulK=function(y){return y.imul(this.k)};function ie(){Z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}c(ie,Z),ie.prototype.split=function(y,w){for(var I=4194303,M=Math.min(y.length,9),k=0;k<M;k++)w.words[k]=y.words[k];if(w.length=M,y.length<=9){y.words[0]=0,y.length=1;return}var P=y.words[9];for(w.words[w.length++]=P&I,k=10;k<y.length;k++){var _=y.words[k]|0;y.words[k-10]=(_&I)<<4|P>>>22,P=_}P>>>=22,y.words[k-10]=P,P===0&&y.length>10?y.length-=10:y.length-=9},ie.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var w=0,I=0;I<y.length;I++){var M=y.words[I]|0;w+=M*977,y.words[I]=w&67108863,w=M*64+(w/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function te(){Z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}c(te,Z);function ae(){Z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}c(ae,Z);function de(){Z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}c(de,Z),de.prototype.imulK=function(y){for(var w=0,I=0;I<y.length;I++){var M=(y.words[I]|0)*19+w,k=M&67108863;M>>>=26,y.words[I]=k,w=M}return w!==0&&(y.words[y.length++]=w),y},o._prime=function(y){if(W[y])return W[y];var w;if(y==="k256")w=new ie;else if(y==="p224")w=new te;else if(y==="p192")w=new ae;else if(y==="p25519")w=new de;else throw new Error("Unknown prime "+y);return W[y]=w,w};function J(A){if(typeof A=="string"){var y=o._prime(A);this.m=y.p,this.prime=y}else a(A.gtn(1),"modulus must be greater than 1"),this.m=A,this.prime=null}J.prototype._verify1=function(y){a(y.negative===0,"red works only with positives"),a(y.red,"red works only with red numbers")},J.prototype._verify2=function(y,w){a((y.negative|w.negative)===0,"red works only with positives"),a(y.red&&y.red===w.red,"red works only with red numbers")},J.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(d(y,y.umod(this.m)._forceRed(this)),y)},J.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},J.prototype.add=function(y,w){this._verify2(y,w);var I=y.add(w);return I.cmp(this.m)>=0&&I.isub(this.m),I._forceRed(this)},J.prototype.iadd=function(y,w){this._verify2(y,w);var I=y.iadd(w);return I.cmp(this.m)>=0&&I.isub(this.m),I},J.prototype.sub=function(y,w){this._verify2(y,w);var I=y.sub(w);return I.cmpn(0)<0&&I.iadd(this.m),I._forceRed(this)},J.prototype.isub=function(y,w){this._verify2(y,w);var I=y.isub(w);return I.cmpn(0)<0&&I.iadd(this.m),I},J.prototype.shl=function(y,w){return this._verify1(y),this.imod(y.ushln(w))},J.prototype.imul=function(y,w){return this._verify2(y,w),this.imod(y.imul(w))},J.prototype.mul=function(y,w){return this._verify2(y,w),this.imod(y.mul(w))},J.prototype.isqr=function(y){return this.imul(y,y.clone())},J.prototype.sqr=function(y){return this.mul(y,y)},J.prototype.sqrt=function(y){if(y.isZero())return y.clone();var w=this.m.andln(3);if(a(w%2===1),w===3){var I=this.m.add(new o(1)).iushrn(2);return this.pow(y,I)}for(var M=this.m.subn(1),k=0;!M.isZero()&&M.andln(1)===0;)k++,M.iushrn(1);a(!M.isZero());var P=new o(1).toRed(this),_=P.redNeg(),q=this.m.subn(1).iushrn(1),E=this.m.bitLength();for(E=new o(2*E*E).toRed(this);this.pow(E,q).cmp(_)!==0;)E.redIAdd(_);for(var j=this.pow(E,M),ee=this.pow(y,M.addn(1).iushrn(1)),oe=this.pow(y,M),Y=k;oe.cmp(P)!==0;){for(var L=oe,z=0;L.cmp(P)!==0;z++)L=L.redSqr();a(z<Y);var re=this.pow(j,new o(1).iushln(Y-z-1));ee=ee.redMul(re),j=re.redSqr(),oe=oe.redMul(j),Y=z}return ee},J.prototype.invm=function(y){var w=y._invmp(this.m);return w.negative!==0?(w.negative=0,this.imod(w).redNeg()):this.imod(w)},J.prototype.pow=function(y,w){if(w.isZero())return new o(1).toRed(this);if(w.cmpn(1)===0)return y.clone();var I=4,M=new Array(1<<I);M[0]=new o(1).toRed(this),M[1]=y;for(var k=2;k<M.length;k++)M[k]=this.mul(M[k-1],y);var P=M[0],_=0,q=0,E=w.bitLength()%26;for(E===0&&(E=26),k=w.length-1;k>=0;k--){for(var j=w.words[k],ee=E-1;ee>=0;ee--){var oe=j>>ee&1;if(P!==M[0]&&(P=this.sqr(P)),oe===0&&_===0){q=0;continue}_<<=1,_|=oe,q++,!(q!==I&&(k!==0||ee!==0))&&(P=this.mul(P,M[_]),q=0,_=0)}E=26}return P},J.prototype.convertTo=function(y){var w=y.umod(this.m);return w===y?w.clone():w},J.prototype.convertFrom=function(y){var w=y.clone();return w.red=null,w},o.mont=function(y){return new R(y)};function R(A){J.call(this,A),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}c(R,J),R.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},R.prototype.convertFrom=function(y){var w=this.imod(y.mul(this.rinv));return w.red=null,w},R.prototype.imul=function(y,w){if(y.isZero()||w.isZero())return y.words[0]=0,y.length=1,y;var I=y.imul(w),M=I.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=I.isub(M).iushrn(this.shift),P=k;return k.cmp(this.m)>=0?P=k.isub(this.m):k.cmpn(0)<0&&(P=k.iadd(this.m)),P._forceRed(this)},R.prototype.mul=function(y,w){if(y.isZero()||w.isZero())return new o(0)._forceRed(this);var I=y.mul(w),M=I.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=I.isub(M).iushrn(this.shift),P=k;return k.cmp(this.m)>=0?P=k.isub(this.m):k.cmpn(0)<0&&(P=k.iadd(this.m)),P._forceRed(this)},R.prototype.invm=function(y){var w=this.imod(y._invmp(this.m).mul(this.r2));return w._forceRed(this)}})(t,commonjsGlobal)}(bn)),bn.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var t=requireBn(),e=requireBrowser$b(),n=requireSafeBuffer$1().Buffer;function a(u){var h=u.modulus.byteLength(),l;do l=new t(e(h));while(l.cmp(u.modulus)>=0||!l.umod(u.prime1)||!l.umod(u.prime2));return l}function c(u){var h=a(u),l=h.toRed(t.mont(u.modulus)).redPow(new t(u.publicExponent)).fromRed();return{blinder:l,unblinder:h.invm(u.modulus)}}function o(u,h){var l=c(h),b=h.modulus.byteLength(),d=new t(u).mul(l.blinder).umod(h.modulus),p=d.toRed(t.mont(h.prime1)),x=d.toRed(t.mont(h.prime2)),m=h.coefficient,v=h.prime1,g=h.prime2,$=p.redPow(h.exponent1).fromRed(),B=x.redPow(h.exponent2).fromRed(),C=$.isub(B).imul(m).umod(v).imul(g);return B.iadd(C).imul(l.unblinder).umod(h.modulus).toArrayLike(n,"be",b)}return o.getr=a,browserifyRsa=o,browserifyRsa}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,function(exports){var indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1},Object_keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var n in t)e.push(n);return e},forEach=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e(t[n],n,t)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(t,e,n){Object.defineProperty(t,e,{writable:!0,enumerable:!1,configurable:!0,value:n})}}catch{return function(e,n,a){e[n]=a}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(t){if(!(t instanceof Context))throw new TypeError("needs a 'context' argument.");var e=document.createElement("iframe");e.style||(e.style={}),e.style.display="none",document.body.appendChild(e);var n=e.contentWindow,a=n.eval,c=n.execScript;!a&&c&&(c.call(n,"null"),a=n.eval),forEach(Object_keys(t),function(h){n[h]=t[h]}),forEach(globals,function(h){t[h]&&(n[h]=t[h])});var o=Object_keys(n),u=a.call(n,this.code);return forEach(Object_keys(n),function(h){(h in t||indexOf(o,h)===-1)&&(t[h]=n[h])}),forEach(globals,function(h){h in t||defineProp(t,h,n[h])}),document.body.removeChild(e),u},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(t){var e=Script.createContext(t),n=this.runInContext(e);return t&&forEach(Object_keys(e),function(a){t[a]=e[a]}),n},forEach(Object_keys(Script.prototype),function(t){exports[t]=Script[t]=function(e){var n=Script(e);return n[t].apply(n,[].slice.call(arguments,1))}}),exports.isContext=function(t){return t instanceof Context},exports.createScript=function(t){return exports.Script(t)},exports.createContext=Script.createContext=function(t){var e=new Context;return typeof t=="object"&&forEach(Object_keys(t),function(n){e[n]=t[n]}),e}}(vmBrowserify)),vmBrowserify}var hasRequiredApi;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,function(t){var e=requireAsn1$1(),n=inherits_browserExports,a=t;a.define=function(u,h){return new c(u,h)};function c(o,u){this.name=o,this.body=u,this.decoders={},this.encoders={}}c.prototype._createNamed=function(u){var h;try{h=requireVmBrowserify().runInThisContext("(function "+this.name+`(entity) {
|
|
20
|
-
this._initNamed(entity);
|
|
21
|
-
})`)}catch{h=function(b){this._initNamed(b)}}return n(h,u),h.prototype._initNamed=function(b){u.call(this,b)},new h(this)},c.prototype._getDecoder=function(u){return u=u||"der",this.decoders.hasOwnProperty(u)||(this.decoders[u]=this._createNamed(e.decoders[u])),this.decoders[u]},c.prototype.decode=function(u,h,l){return this._getDecoder(h).decode(u,l)},c.prototype._getEncoder=function(u){return u=u||"der",this.encoders.hasOwnProperty(u)||(this.encoders[u]=this._createNamed(e.encoders[u])),this.encoders[u]},c.prototype.encode=function(u,h,l){return this._getEncoder(h).encode(u,l)}}(api)),api}var base$1={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var t=inherits_browserExports;function e(a){this._reporterState={obj:null,path:[],options:a||{},errors:[]}}reporter.Reporter=e,e.prototype.isError=function(c){return c instanceof n},e.prototype.save=function(){var c=this._reporterState;return{obj:c.obj,pathLen:c.path.length}},e.prototype.restore=function(c){var o=this._reporterState;o.obj=c.obj,o.path=o.path.slice(0,c.pathLen)},e.prototype.enterKey=function(c){return this._reporterState.path.push(c)},e.prototype.exitKey=function(c){var o=this._reporterState;o.path=o.path.slice(0,c-1)},e.prototype.leaveKey=function(c,o,u){var h=this._reporterState;this.exitKey(c),h.obj!==null&&(h.obj[o]=u)},e.prototype.path=function(){return this._reporterState.path.join("/")},e.prototype.enterObject=function(){var c=this._reporterState,o=c.obj;return c.obj={},o},e.prototype.leaveObject=function(c){var o=this._reporterState,u=o.obj;return o.obj=c,u},e.prototype.error=function(c){var o,u=this._reporterState,h=c instanceof n;if(h?o=c:o=new n(u.path.map(function(l){return"["+JSON.stringify(l)+"]"}).join(""),c.message||c,c.stack),!u.options.partial)throw o;return h||u.errors.push(o),o},e.prototype.wrapResult=function(c){var o=this._reporterState;return o.options.partial?{result:this.isError(c)?null:c,errors:o.errors}:c};function n(a,c){this.path=a,this.rethrow(c)}return t(n,Error),n.prototype.rethrow=function(c){if(this.message=c+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,n),!this.stack)try{throw new Error(this.message)}catch(o){this.stack=o.stack}return this},reporter}var buffer={},hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var t=inherits_browserExports,e=requireBase().Reporter,n=require$$1$2.Buffer;function a(o,u){if(e.call(this,u),!n.isBuffer(o)){this.error("Input not Buffer");return}this.base=o,this.offset=0,this.length=o.length}t(a,e),buffer.DecoderBuffer=a,a.prototype.save=function(){return{offset:this.offset,reporter:e.prototype.save.call(this)}},a.prototype.restore=function(u){var h=new a(this.base);return h.offset=u.offset,h.length=this.offset,this.offset=u.offset,e.prototype.restore.call(this,u.reporter),h},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(u){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(u||"DecoderBuffer overrun")},a.prototype.skip=function(u,h){if(!(this.offset+u<=this.length))return this.error(h||"DecoderBuffer overrun");var l=new a(this.base);return l._reporterState=this._reporterState,l.offset=this.offset,l.length=this.offset+u,this.offset+=u,l},a.prototype.raw=function(u){return this.base.slice(u?u.offset:this.offset,this.length)};function c(o,u){if(Array.isArray(o))this.length=0,this.value=o.map(function(h){return h instanceof c||(h=new c(h,u)),this.length+=h.length,h},this);else if(typeof o=="number"){if(!(0<=o&&o<=255))return u.error("non-byte EncoderBuffer value");this.value=o,this.length=1}else if(typeof o=="string")this.value=o,this.length=n.byteLength(o);else if(n.isBuffer(o))this.value=o,this.length=o.length;else return u.error("Unsupported type: "+typeof o)}return buffer.EncoderBuffer=c,c.prototype.join=function(u,h){return u||(u=new n(this.length)),h||(h=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(l){l.join(u,h),h+=l.length}):(typeof this.value=="number"?u[h]=this.value:typeof this.value=="string"?u.write(this.value,h):n.isBuffer(this.value)&&this.value.copy(u,h),h+=this.length)),u},buffer}var node,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var t=requireBase().Reporter,e=requireBase().EncoderBuffer,n=requireBase().DecoderBuffer,a=minimalisticAssert,c=["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"],o=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(c),u=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function h(b,d){var p={};this._baseState=p,p.enc=b,p.parent=d||null,p.children=null,p.tag=null,p.args=null,p.reverseArgs=null,p.choice=null,p.optional=!1,p.any=!1,p.obj=!1,p.use=null,p.useDecoder=null,p.key=null,p.default=null,p.explicit=null,p.implicit=null,p.contains=null,p.parent||(p.children=[],this._wrap())}node=h;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return h.prototype.clone=function(){var d=this._baseState,p={};l.forEach(function(m){p[m]=d[m]});var x=new this.constructor(p.parent);return x._baseState=p,x},h.prototype._wrap=function(){var d=this._baseState;o.forEach(function(p){this[p]=function(){var m=new this.constructor(this);return d.children.push(m),m[p].apply(m,arguments)}},this)},h.prototype._init=function(d){var p=this._baseState;a(p.parent===null),d.call(this),p.children=p.children.filter(function(x){return x._baseState.parent===this},this),a.equal(p.children.length,1,"Root node can have only one child")},h.prototype._useArgs=function(d){var p=this._baseState,x=d.filter(function(m){return m instanceof this.constructor},this);d=d.filter(function(m){return!(m instanceof this.constructor)},this),x.length!==0&&(a(p.children===null),p.children=x,x.forEach(function(m){m._baseState.parent=this},this)),d.length!==0&&(a(p.args===null),p.args=d,p.reverseArgs=d.map(function(m){if(typeof m!="object"||m.constructor!==Object)return m;var v={};return Object.keys(m).forEach(function(g){g==(g|0)&&(g|=0);var $=m[g];v[$]=g}),v}))},u.forEach(function(b){h.prototype[b]=function(){var p=this._baseState;throw new Error(b+" not implemented for encoding: "+p.enc)}}),c.forEach(function(b){h.prototype[b]=function(){var p=this._baseState,x=Array.prototype.slice.call(arguments);return a(p.tag===null),p.tag=b,this._useArgs(x),this}}),h.prototype.use=function(d){a(d);var p=this._baseState;return a(p.use===null),p.use=d,this},h.prototype.optional=function(){var d=this._baseState;return d.optional=!0,this},h.prototype.def=function(d){var p=this._baseState;return a(p.default===null),p.default=d,p.optional=!0,this},h.prototype.explicit=function(d){var p=this._baseState;return a(p.explicit===null&&p.implicit===null),p.explicit=d,this},h.prototype.implicit=function(d){var p=this._baseState;return a(p.explicit===null&&p.implicit===null),p.implicit=d,this},h.prototype.obj=function(){var d=this._baseState,p=Array.prototype.slice.call(arguments);return d.obj=!0,p.length!==0&&this._useArgs(p),this},h.prototype.key=function(d){var p=this._baseState;return a(p.key===null),p.key=d,this},h.prototype.any=function(){var d=this._baseState;return d.any=!0,this},h.prototype.choice=function(d){var p=this._baseState;return a(p.choice===null),p.choice=d,this._useArgs(Object.keys(d).map(function(x){return d[x]})),this},h.prototype.contains=function(d){var p=this._baseState;return a(p.use===null),p.contains=d,this},h.prototype._decode=function(d,p){var x=this._baseState;if(x.parent===null)return d.wrapResult(x.children[0]._decode(d,p));var m=x.default,v=!0,g=null;if(x.key!==null&&(g=d.enterKey(x.key)),x.optional){var $=null;if(x.explicit!==null?$=x.explicit:x.implicit!==null?$=x.implicit:x.tag!==null&&($=x.tag),$===null&&!x.any){var B=d.save();try{x.choice===null?this._decodeGeneric(x.tag,d,p):this._decodeChoice(d,p),v=!0}catch{v=!1}d.restore(B)}else if(v=this._peekTag(d,$,x.any),d.isError(v))return v}var C;if(x.obj&&v&&(C=d.enterObject()),v){if(x.explicit!==null){var F=this._decodeTag(d,x.explicit);if(d.isError(F))return F;d=F}var H=d.offset;if(x.use===null&&x.choice===null){if(x.any)var B=d.save();var W=this._decodeTag(d,x.implicit!==null?x.implicit:x.tag,x.any);if(d.isError(W))return W;x.any?m=d.raw(B):d=W}if(p&&p.track&&x.tag!==null&&p.track(d.path(),H,d.length,"tagged"),p&&p.track&&x.tag!==null&&p.track(d.path(),d.offset,d.length,"content"),x.any?m=m:x.choice===null?m=this._decodeGeneric(x.tag,d,p):m=this._decodeChoice(d,p),d.isError(m))return m;if(!x.any&&x.choice===null&&x.children!==null&&x.children.forEach(function(te){te._decode(d,p)}),x.contains&&(x.tag==="octstr"||x.tag==="bitstr")){var Z=new n(m);m=this._getUse(x.contains,d._reporterState.obj)._decode(Z,p)}}return x.obj&&v&&(m=d.leaveObject(C)),x.key!==null&&(m!==null||v===!0)?d.leaveKey(g,x.key,m):g!==null&&d.exitKey(g),m},h.prototype._decodeGeneric=function(d,p,x){var m=this._baseState;return d==="seq"||d==="set"?null:d==="seqof"||d==="setof"?this._decodeList(p,d,m.args[0],x):/str$/.test(d)?this._decodeStr(p,d,x):d==="objid"&&m.args?this._decodeObjid(p,m.args[0],m.args[1],x):d==="objid"?this._decodeObjid(p,null,null,x):d==="gentime"||d==="utctime"?this._decodeTime(p,d,x):d==="null_"?this._decodeNull(p,x):d==="bool"?this._decodeBool(p,x):d==="objDesc"?this._decodeStr(p,d,x):d==="int"||d==="enum"?this._decodeInt(p,m.args&&m.args[0],x):m.use!==null?this._getUse(m.use,p._reporterState.obj)._decode(p,x):p.error("unknown tag: "+d)},h.prototype._getUse=function(d,p){var x=this._baseState;return x.useDecoder=this._use(d,p),a(x.useDecoder._baseState.parent===null),x.useDecoder=x.useDecoder._baseState.children[0],x.implicit!==x.useDecoder._baseState.implicit&&(x.useDecoder=x.useDecoder.clone(),x.useDecoder._baseState.implicit=x.implicit),x.useDecoder},h.prototype._decodeChoice=function(d,p){var x=this._baseState,m=null,v=!1;return Object.keys(x.choice).some(function(g){var $=d.save(),B=x.choice[g];try{var C=B._decode(d,p);if(d.isError(C))return!1;m={type:g,value:C},v=!0}catch{return d.restore($),!1}return!0},this),v?m:d.error("Choice not matched")},h.prototype._createEncoderBuffer=function(d){return new e(d,this.reporter)},h.prototype._encode=function(d,p,x){var m=this._baseState;if(!(m.default!==null&&m.default===d)){var v=this._encodeValue(d,p,x);if(v!==void 0&&!this._skipDefault(v,p,x))return v}},h.prototype._encodeValue=function(d,p,x){var m=this._baseState;if(m.parent===null)return m.children[0]._encode(d,p||new t);var B=null;if(this.reporter=p,m.optional&&d===void 0)if(m.default!==null)d=m.default;else return;var v=null,g=!1;if(m.any)B=this._createEncoderBuffer(d);else if(m.choice)B=this._encodeChoice(d,p);else if(m.contains)v=this._getUse(m.contains,x)._encode(d,p),g=!0;else if(m.children)v=m.children.map(function(H){if(H._baseState.tag==="null_")return H._encode(null,p,d);if(H._baseState.key===null)return p.error("Child should have a key");var W=p.enterKey(H._baseState.key);if(typeof d!="object")return p.error("Child expected, but input is not object");var Z=H._encode(d[H._baseState.key],p,d);return p.leaveKey(W),Z},this).filter(function(H){return H}),v=this._createEncoderBuffer(v);else if(m.tag==="seqof"||m.tag==="setof"){if(!(m.args&&m.args.length===1))return p.error("Too many args for : "+m.tag);if(!Array.isArray(d))return p.error("seqof/setof, but data is not Array");var $=this.clone();$._baseState.implicit=null,v=this._createEncoderBuffer(d.map(function(H){var W=this._baseState;return this._getUse(W.args[0],d)._encode(H,p)},$))}else m.use!==null?B=this._getUse(m.use,x)._encode(d,p):(v=this._encodePrimitive(m.tag,d),g=!0);var B;if(!m.any&&m.choice===null){var C=m.implicit!==null?m.implicit:m.tag,F=m.implicit===null?"universal":"context";C===null?m.use===null&&p.error("Tag could be omitted only for .use()"):m.use===null&&(B=this._encodeComposite(C,g,F,v))}return m.explicit!==null&&(B=this._encodeComposite(m.explicit,!1,"context",B)),B},h.prototype._encodeChoice=function(d,p){var x=this._baseState,m=x.choice[d.type];return m||a(!1,d.type+" not found in "+JSON.stringify(Object.keys(x.choice))),m._encode(d.value,p)},h.prototype._encodePrimitive=function(d,p){var x=this._baseState;if(/str$/.test(d))return this._encodeStr(p,d);if(d==="objid"&&x.args)return this._encodeObjid(p,x.reverseArgs[0],x.args[1]);if(d==="objid")return this._encodeObjid(p,null,null);if(d==="gentime"||d==="utctime")return this._encodeTime(p,d);if(d==="null_")return this._encodeNull();if(d==="int"||d==="enum")return this._encodeInt(p,x.args&&x.reverseArgs[0]);if(d==="bool")return this._encodeBool(p);if(d==="objDesc")return this._encodeStr(p,d);throw new Error("Unsupported tag: "+d)},h.prototype._isNumstr=function(d){return/^[0-9 ]*$/.test(d)},h.prototype._isPrintstr=function(d){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(d)},node}var hasRequiredBase;function requireBase(){return hasRequiredBase||(hasRequiredBase=1,function(t){var e=t;e.Reporter=requireReporter().Reporter,e.DecoderBuffer=requireBuffer().DecoderBuffer,e.EncoderBuffer=requireBuffer().EncoderBuffer,e.Node=requireNode()}(base$1)),base$1}var constants={},der={},hasRequiredDer$2;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,function(t){var e=requireConstants();t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=e._reverse(t.tagClass),t.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"},t.tagByName=e._reverse(t.tag)}(der)),der}var hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,function(t){var e=t;e._reverse=function(a){var c={};return Object.keys(a).forEach(function(o){(o|0)==o&&(o=o|0);var u=a[o];c[u]=o}),c},e.der=requireDer$2()}(constants)),constants}var decoders={},der_1$1,hasRequiredDer$1;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var t=inherits_browserExports,e=requireAsn1$1(),n=e.base,a=e.bignum,c=e.constants.der;function o(b){this.enc="der",this.name=b.name,this.entity=b,this.tree=new u,this.tree._init(b.body)}der_1$1=o,o.prototype.decode=function(d,p){return d instanceof n.DecoderBuffer||(d=new n.DecoderBuffer(d,p)),this.tree._decode(d,p)};function u(b){n.Node.call(this,"der",b)}t(u,n.Node),u.prototype._peekTag=function(d,p,x){if(d.isEmpty())return!1;var m=d.save(),v=h(d,'Failed to peek tag: "'+p+'"');return d.isError(v)?v:(d.restore(m),v.tag===p||v.tagStr===p||v.tagStr+"of"===p||x)},u.prototype._decodeTag=function(d,p,x){var m=h(d,'Failed to decode tag of "'+p+'"');if(d.isError(m))return m;var v=l(d,m.primitive,'Failed to get length of "'+p+'"');if(d.isError(v))return v;if(!x&&m.tag!==p&&m.tagStr!==p&&m.tagStr+"of"!==p)return d.error('Failed to match tag: "'+p+'"');if(m.primitive||v!==null)return d.skip(v,'Failed to match body of: "'+p+'"');var g=d.save(),$=this._skipUntilEnd(d,'Failed to skip indefinite length body: "'+this.tag+'"');return d.isError($)?$:(v=d.offset-g.offset,d.restore(g),d.skip(v,'Failed to match body of: "'+p+'"'))},u.prototype._skipUntilEnd=function(d,p){for(;;){var x=h(d,p);if(d.isError(x))return x;var m=l(d,x.primitive,p);if(d.isError(m))return m;var v;if(x.primitive||m!==null?v=d.skip(m):v=this._skipUntilEnd(d,p),d.isError(v))return v;if(x.tagStr==="end")break}},u.prototype._decodeList=function(d,p,x,m){for(var v=[];!d.isEmpty();){var g=this._peekTag(d,"end");if(d.isError(g))return g;var $=x.decode(d,"der",m);if(d.isError($)&&g)break;v.push($)}return v},u.prototype._decodeStr=function(d,p){if(p==="bitstr"){var x=d.readUInt8();return d.isError(x)?x:{unused:x,data:d.raw()}}else if(p==="bmpstr"){var m=d.raw();if(m.length%2===1)return d.error("Decoding of string type: bmpstr length mismatch");for(var v="",g=0;g<m.length/2;g++)v+=String.fromCharCode(m.readUInt16BE(g*2));return v}else if(p==="numstr"){var $=d.raw().toString("ascii");return this._isNumstr($)?$:d.error("Decoding of string type: numstr unsupported characters")}else{if(p==="octstr")return d.raw();if(p==="objDesc")return d.raw();if(p==="printstr"){var B=d.raw().toString("ascii");return this._isPrintstr(B)?B:d.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(p)?d.raw().toString():d.error("Decoding of string type: "+p+" unsupported")}},u.prototype._decodeObjid=function(d,p,x){for(var m,v=[],g=0;!d.isEmpty();){var $=d.readUInt8();g<<=7,g|=$&127,$&128||(v.push(g),g=0)}$&128&&v.push(g);var B=v[0]/40|0,C=v[0]%40;if(x?m=v:m=[B,C].concat(v.slice(1)),p){var F=p[m.join(" ")];F===void 0&&(F=p[m.join(".")]),F!==void 0&&(m=F)}return m},u.prototype._decodeTime=function(d,p){var x=d.raw().toString();if(p==="gentime")var m=x.slice(0,4)|0,v=x.slice(4,6)|0,g=x.slice(6,8)|0,$=x.slice(8,10)|0,B=x.slice(10,12)|0,C=x.slice(12,14)|0;else if(p==="utctime"){var m=x.slice(0,2)|0,v=x.slice(2,4)|0,g=x.slice(4,6)|0,$=x.slice(6,8)|0,B=x.slice(8,10)|0,C=x.slice(10,12)|0;m<70?m=2e3+m:m=1900+m}else return d.error("Decoding "+p+" time is not supported yet");return Date.UTC(m,v-1,g,$,B,C,0)},u.prototype._decodeNull=function(d){return null},u.prototype._decodeBool=function(d){var p=d.readUInt8();return d.isError(p)?p:p!==0},u.prototype._decodeInt=function(d,p){var x=d.raw(),m=new a(x);return p&&(m=p[m.toString(10)]||m),m},u.prototype._use=function(d,p){return typeof d=="function"&&(d=d(p)),d._getDecoder("der").tree};function h(b,d){var p=b.readUInt8(d);if(b.isError(p))return p;var x=c.tagClass[p>>6],m=(p&32)===0;if((p&31)===31){var v=p;for(p=0;(v&128)===128;){if(v=b.readUInt8(d),b.isError(v))return v;p<<=7,p|=v&127}}else p&=31;var g=c.tag[p];return{cls:x,primitive:m,tag:p,tagStr:g}}function l(b,d,p){var x=b.readUInt8(p);if(b.isError(x))return x;if(!d&&x===128)return null;if(!(x&128))return x;var m=x&127;if(m>4)return b.error("length octect is too long");x=0;for(var v=0;v<m;v++){x<<=8;var g=b.readUInt8(p);if(b.isError(g))return g;x|=g}return x}return der_1$1}var pem$1,hasRequiredPem$1;function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var t=inherits_browserExports,e=require$$1$2.Buffer,n=requireDer$1();function a(c){n.call(this,c),this.enc="pem"}return t(a,n),pem$1=a,a.prototype.decode=function(o,u){for(var h=o.toString().split(/[\r\n]+/g),l=u.label.toUpperCase(),b=/^-----(BEGIN|END) ([^-]+)-----$/,d=-1,p=-1,x=0;x<h.length;x++){var m=h[x].match(b);if(m!==null&&m[2]===l)if(d===-1){if(m[1]!=="BEGIN")break;d=x}else{if(m[1]!=="END")break;p=x;break}}if(d===-1||p===-1)throw new Error("PEM section not found for: "+l);var v=h.slice(d+1,p).join("");v.replace(/[^a-z0-9\+\/=]+/gi,"");var g=new e(v,"base64");return n.prototype.decode.call(this,g,u)},pem$1}var hasRequiredDecoders;function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,function(t){var e=t;e.der=requireDer$1(),e.pem=requirePem$1()}(decoders)),decoders}var encoders={},der_1,hasRequiredDer;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var t=inherits_browserExports,e=require$$1$2.Buffer,n=requireAsn1$1(),a=n.base,c=n.constants.der;function o(b){this.enc="der",this.name=b.name,this.entity=b,this.tree=new u,this.tree._init(b.body)}der_1=o,o.prototype.encode=function(d,p){return this.tree._encode(d,p).join()};function u(b){a.Node.call(this,"der",b)}t(u,a.Node),u.prototype._encodeComposite=function(d,p,x,m){var v=l(d,p,x,this.reporter);if(m.length<128){var B=new e(2);return B[0]=v,B[1]=m.length,this._createEncoderBuffer([B,m])}for(var g=1,$=m.length;$>=256;$>>=8)g++;var B=new e(2+g);B[0]=v,B[1]=128|g;for(var $=1+g,C=m.length;C>0;$--,C>>=8)B[$]=C&255;return this._createEncoderBuffer([B,m])},u.prototype._encodeStr=function(d,p){if(p==="bitstr")return this._createEncoderBuffer([d.unused|0,d.data]);if(p==="bmpstr"){for(var x=new e(d.length*2),m=0;m<d.length;m++)x.writeUInt16BE(d.charCodeAt(m),m*2);return this._createEncoderBuffer(x)}else return p==="numstr"?this._isNumstr(d)?this._createEncoderBuffer(d):this.reporter.error("Encoding of string type: numstr supports only digits and space"):p==="printstr"?this._isPrintstr(d)?this._createEncoderBuffer(d):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(p)?this._createEncoderBuffer(d):p==="objDesc"?this._createEncoderBuffer(d):this.reporter.error("Encoding of string type: "+p+" unsupported")},u.prototype._encodeObjid=function(d,p,x){if(typeof d=="string"){if(!p)return this.reporter.error("string objid given, but no values map found");if(!p.hasOwnProperty(d))return this.reporter.error("objid not found in values map");d=p[d].split(/[\s\.]+/g);for(var m=0;m<d.length;m++)d[m]|=0}else if(Array.isArray(d)){d=d.slice();for(var m=0;m<d.length;m++)d[m]|=0}if(!Array.isArray(d))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(d));if(!x){if(d[1]>=40)return this.reporter.error("Second objid identifier OOB");d.splice(0,2,d[0]*40+d[1])}for(var v=0,m=0;m<d.length;m++){var g=d[m];for(v++;g>=128;g>>=7)v++}for(var $=new e(v),B=$.length-1,m=d.length-1;m>=0;m--){var g=d[m];for($[B--]=g&127;(g>>=7)>0;)$[B--]=128|g&127}return this._createEncoderBuffer($)};function h(b){return b<10?"0"+b:b}u.prototype._encodeTime=function(d,p){var x,m=new Date(d);return p==="gentime"?x=[h(m.getFullYear()),h(m.getUTCMonth()+1),h(m.getUTCDate()),h(m.getUTCHours()),h(m.getUTCMinutes()),h(m.getUTCSeconds()),"Z"].join(""):p==="utctime"?x=[h(m.getFullYear()%100),h(m.getUTCMonth()+1),h(m.getUTCDate()),h(m.getUTCHours()),h(m.getUTCMinutes()),h(m.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+p+" time is not supported yet"),this._encodeStr(x,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(d,p){if(typeof d=="string"){if(!p)return this.reporter.error("String int or enum given, but no values map");if(!p.hasOwnProperty(d))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(d));d=p[d]}if(typeof d!="number"&&!e.isBuffer(d)){var x=d.toArray();!d.sign&&x[0]&128&&x.unshift(0),d=new e(x)}if(e.isBuffer(d)){var m=d.length;d.length===0&&m++;var g=new e(m);return d.copy(g),d.length===0&&(g[0]=0),this._createEncoderBuffer(g)}if(d<128)return this._createEncoderBuffer(d);if(d<256)return this._createEncoderBuffer([0,d]);for(var m=1,v=d;v>=256;v>>=8)m++;for(var g=new Array(m),v=g.length-1;v>=0;v--)g[v]=d&255,d>>=8;return g[0]&128&&g.unshift(0),this._createEncoderBuffer(new e(g))},u.prototype._encodeBool=function(d){return this._createEncoderBuffer(d?255:0)},u.prototype._use=function(d,p){return typeof d=="function"&&(d=d(p)),d._getEncoder("der").tree},u.prototype._skipDefault=function(d,p,x){var m=this._baseState,v;if(m.default===null)return!1;var g=d.join();if(m.defaultBuffer===void 0&&(m.defaultBuffer=this._encodeValue(m.default,p,x).join()),g.length!==m.defaultBuffer.length)return!1;for(v=0;v<g.length;v++)if(g[v]!==m.defaultBuffer[v])return!1;return!0};function l(b,d,p,x){var m;if(b==="seqof"?b="seq":b==="setof"&&(b="set"),c.tagByName.hasOwnProperty(b))m=c.tagByName[b];else if(typeof b=="number"&&(b|0)===b)m=b;else return x.error("Unknown tag: "+b);return m>=31?x.error("Multi-octet tag encoding unsupported"):(d||(m|=32),m|=c.tagClassByName[p||"universal"]<<6,m)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var t=inherits_browserExports,e=requireDer();function n(a){e.call(this,a),this.enc="pem"}return t(n,e),pem=n,n.prototype.encode=function(c,o){for(var u=e.prototype.encode.call(this,c),h=u.toString("base64"),l=["-----BEGIN "+o.label+"-----"],b=0;b<h.length;b+=64)l.push(h.slice(b,b+64));return l.push("-----END "+o.label+"-----"),l.join(`
|
|
22
|
-
`)},pem}var hasRequiredEncoders;function requireEncoders(){return hasRequiredEncoders||(hasRequiredEncoders=1,function(t){var e=t;e.der=requireDer(),e.pem=requirePem()}(encoders)),encoders}var hasRequiredAsn1$1;function requireAsn1$1(){return hasRequiredAsn1$1||(hasRequiredAsn1$1=1,function(t){var e=t;e.bignum=bnExports,e.define=requireApi().define,e.base=requireBase(),e.constants=requireConstants(),e.decoders=requireDecoders(),e.encoders=requireEncoders()}(asn1)),asn1}var certificate,hasRequiredCertificate;function requireCertificate(){if(hasRequiredCertificate)return certificate;hasRequiredCertificate=1;var t=requireAsn1$1(),e=t.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),n=t.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=t.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),c=t.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),o=t.define("RelativeDistinguishedName",function(){this.setof(n)}),u=t.define("RDNSequence",function(){this.seqof(o)}),h=t.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),l=t.define("Validity",function(){this.seq().obj(this.key("notBefore").use(e),this.key("notAfter").use(e))}),b=t.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=t.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(h),this.key("validity").use(l),this.key("subject").use(h),this.key("subjectPublicKeyInfo").use(c),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(b).optional())}),p=t.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});return certificate=p,certificate}var hasRequiredAsn1;function requireAsn1(){if(hasRequiredAsn1)return asn1$1;hasRequiredAsn1=1;var t=requireAsn1$1();asn1$1.certificate=requireCertificate();var e=t.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())});asn1$1.RSAPrivateKey=e;var n=t.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});asn1$1.RSAPublicKey=n;var a=t.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())}),c=t.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())});asn1$1.PublicKey=c;var o=t.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())});asn1$1.PrivateKey=o;var u=t.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())});asn1$1.EncryptedPrivateKey=u;var h=t.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())});asn1$1.DSAPrivateKey=h,asn1$1.DSAparam=t.define("DSAparam",function(){this.int()});var l=t.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),b=t.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(l),this.key("publicKey").optional().explicit(1).bitstr())});return asn1$1.ECPrivateKey=b,asn1$1.signature=t.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),asn1$1}const require$$1={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var fixProc,hasRequiredFixProc;function requireFixProc(){if(hasRequiredFixProc)return fixProc;hasRequiredFixProc=1;var t=/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,e=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=requireEvp_bytestokey(),c=requireBrowser$6(),o=requireSafeBuffer$1().Buffer;return fixProc=function(u,h){var l=u.toString(),b=l.match(t),d;if(b){var x="aes"+b[1],m=o.from(b[2],"hex"),v=o.from(b[3].replace(/[\r\n]/g,""),"base64"),g=a(h,m.slice(0,8),parseInt(b[1],10)).key,$=[],B=c.createDecipheriv(x,g,m);$.push(B.update(v)),$.push(B.final()),d=o.concat($)}else{var p=l.match(n);d=o.from(p[2].replace(/[\r\n]/g,""),"base64")}var C=l.match(e)[1];return{tag:C,data:d}},fixProc}var parseAsn1,hasRequiredParseAsn1;function requireParseAsn1(){if(hasRequiredParseAsn1)return parseAsn1;hasRequiredParseAsn1=1;var t=requireAsn1(),e=require$$1,n=requireFixProc(),a=requireBrowser$6(),c=requireBrowser$7(),o=requireSafeBuffer$1().Buffer;function u(l,b){var d=l.algorithm.decrypt.kde.kdeparams.salt,p=parseInt(l.algorithm.decrypt.kde.kdeparams.iters.toString(),10),x=e[l.algorithm.decrypt.cipher.algo.join(".")],m=l.algorithm.decrypt.cipher.iv,v=l.subjectPrivateKey,g=parseInt(x.split("-")[1],10)/8,$=c.pbkdf2Sync(b,d,p,g,"sha1"),B=a.createDecipheriv(x,$,m),C=[];return C.push(B.update(v)),C.push(B.final()),o.concat(C)}function h(l){var b;typeof l=="object"&&!o.isBuffer(l)&&(b=l.passphrase,l=l.key),typeof l=="string"&&(l=o.from(l));var d=n(l,b),p=d.tag,x=d.data,m,v;switch(p){case"CERTIFICATE":v=t.certificate.decode(x,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(v||(v=t.PublicKey.decode(x,"der")),m=v.algorithm.algorithm.join("."),m){case"1.2.840.113549.1.1.1":return t.RSAPublicKey.decode(v.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return v.subjectPrivateKey=v.subjectPublicKey,{type:"ec",data:v};case"1.2.840.10040.4.1":return v.algorithm.params.pub_key=t.DSAparam.decode(v.subjectPublicKey.data,"der"),{type:"dsa",data:v.algorithm.params};default:throw new Error("unknown key id "+m)}case"ENCRYPTED PRIVATE KEY":x=t.EncryptedPrivateKey.decode(x,"der"),x=u(x,b);case"PRIVATE KEY":switch(v=t.PrivateKey.decode(x,"der"),m=v.algorithm.algorithm.join("."),m){case"1.2.840.113549.1.1.1":return t.RSAPrivateKey.decode(v.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:v.algorithm.curve,privateKey:t.ECPrivateKey.decode(v.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return v.algorithm.params.priv_key=t.DSAparam.decode(v.subjectPrivateKey,"der"),{type:"dsa",params:v.algorithm.params};default:throw new Error("unknown key id "+m)}case"RSA PUBLIC KEY":return t.RSAPublicKey.decode(x,"der");case"RSA PRIVATE KEY":return t.RSAPrivateKey.decode(x,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:t.DSAPrivateKey.decode(x,"der")};case"EC PRIVATE KEY":return x=t.ECPrivateKey.decode(x,"der"),{curve:x.parameters.value,privateKey:x.privateKey};default:throw new Error("unknown key type "+p)}}return h.signature=t.signature,parseAsn1=h,parseAsn1}const require$$4={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var hasRequiredSign;function requireSign(){if(hasRequiredSign)return sign$1.exports;hasRequiredSign=1;var t=requireSafeBuffer$1().Buffer,e=requireBrowser$8(),n=requireBrowserifyRsa(),a=requireElliptic().ec,c=requireBn(),o=requireParseAsn1(),u=require$$4,h=1;function l(B,C,F,H,W){var Z=o(C);if(Z.curve){if(H!=="ecdsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");return b(B,Z)}else if(Z.type==="dsa"){if(H!=="dsa")throw new Error("wrong private key type");return d(B,Z,F)}if(H!=="rsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");if(C.padding!==void 0&&C.padding!==h)throw new Error("illegal or unsupported padding mode");B=t.concat([W,B]);for(var ie=Z.modulus.byteLength(),te=[0,1];B.length+te.length+1<ie;)te.push(255);te.push(0);for(var ae=-1;++ae<B.length;)te.push(B[ae]);var de=n(te,Z);return de}function b(B,C){var F=u[C.curve.join(".")];if(!F)throw new Error("unknown curve "+C.curve.join("."));var H=new a(F),W=H.keyFromPrivate(C.privateKey),Z=W.sign(B);return t.from(Z.toDER())}function d(B,C,F){for(var H=C.params.priv_key,W=C.params.p,Z=C.params.q,ie=C.params.g,te=new c(0),ae,de=m(B,Z).mod(Z),J=!1,R=x(H,Z,B,F);J===!1;)ae=g(Z,R,F),te=$(ie,ae,W,Z),J=ae.invm(Z).imul(de.add(H.mul(te))).mod(Z),J.cmpn(0)===0&&(J=!1,te=new c(0));return p(te,J)}function p(B,C){B=B.toArray(),C=C.toArray(),B[0]&128&&(B=[0].concat(B)),C[0]&128&&(C=[0].concat(C));var F=B.length+C.length+4,H=[48,F,2,B.length];return H=H.concat(B,[2,C.length],C),t.from(H)}function x(B,C,F,H){if(B=t.from(B.toArray()),B.length<C.byteLength()){var W=t.alloc(C.byteLength()-B.length);B=t.concat([W,B])}var Z=F.length,ie=v(F,C),te=t.alloc(Z);te.fill(1);var ae=t.alloc(Z);return ae=e(H,ae).update(te).update(t.from([0])).update(B).update(ie).digest(),te=e(H,ae).update(te).digest(),ae=e(H,ae).update(te).update(t.from([1])).update(B).update(ie).digest(),te=e(H,ae).update(te).digest(),{k:ae,v:te}}function m(B,C){var F=new c(B),H=(B.length<<3)-C.bitLength();return H>0&&F.ishrn(H),F}function v(B,C){B=m(B,C),B=B.mod(C);var F=t.from(B.toArray());if(F.length<C.byteLength()){var H=t.alloc(C.byteLength()-F.length);F=t.concat([H,F])}return F}function g(B,C,F){var H,W;do{for(H=t.alloc(0);H.length*8<B.bitLength();)C.v=e(F,C.k).update(C.v).digest(),H=t.concat([H,C.v]);W=m(H,B),C.k=e(F,C.k).update(C.v).update(t.from([0])).digest(),C.v=e(F,C.k).update(C.v).digest()}while(W.cmp(B)!==-1);return W}function $(B,C,F,H){return B.toRed(c.mont(F)).redPow(C).fromRed().mod(H)}return sign$1.exports=l,sign$1.exports.getKey=x,sign$1.exports.makeKey=g,sign$1.exports}var verify_1,hasRequiredVerify;function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var t=requireSafeBuffer$1().Buffer,e=requireBn(),n=requireElliptic().ec,a=requireParseAsn1(),c=require$$4;function o(b,d,p,x,m){var v=a(p);if(v.type==="ec"){if(x!=="ecdsa"&&x!=="ecdsa/rsa")throw new Error("wrong public key type");return u(b,d,v)}else if(v.type==="dsa"){if(x!=="dsa")throw new Error("wrong public key type");return h(b,d,v)}if(x!=="rsa"&&x!=="ecdsa/rsa")throw new Error("wrong public key type");d=t.concat([m,d]);for(var g=v.modulus.byteLength(),$=[1],B=0;d.length+$.length+2<g;)$.push(255),B+=1;$.push(0);for(var C=-1;++C<d.length;)$.push(d[C]);$=t.from($);var F=e.mont(v.modulus);b=new e(b).toRed(F),b=b.redPow(new e(v.publicExponent)),b=t.from(b.fromRed().toArray());var H=B<8?1:0;for(g=Math.min(b.length,$.length),b.length!==$.length&&(H=1),C=-1;++C<g;)H|=b[C]^$[C];return H===0}function u(b,d,p){var x=c[p.data.algorithm.curve.join(".")];if(!x)throw new Error("unknown curve "+p.data.algorithm.curve.join("."));var m=new n(x),v=p.data.subjectPrivateKey.data;return m.verify(d,b,v)}function h(b,d,p){var x=p.data.p,m=p.data.q,v=p.data.g,g=p.data.pub_key,$=a.signature.decode(b,"der"),B=$.s,C=$.r;l(B,m),l(C,m);var F=e.mont(x),H=B.invm(m),W=v.toRed(F).redPow(new e(d).mul(H).mod(m)).fromRed().mul(g.toRed(F).redPow(C.mul(H).mod(m)).fromRed()).mod(x).mod(m);return W.cmp(C)===0}function l(b,d){if(b.cmpn(0)<=0)throw new Error("invalid sig");if(b.cmp(d)>=0)throw new Error("invalid sig")}return verify_1=o,verify_1}var browser$3,hasRequiredBrowser$3;function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$3;hasRequiredBrowser$3=1;var t=requireSafeBuffer$1().Buffer,e=requireBrowser$9(),n=requireReadableBrowser(),a=inherits_browserExports,c=requireSign(),o=requireVerify(),u=require$$6;Object.keys(u).forEach(function(p){u[p].id=t.from(u[p].id,"hex"),u[p.toLowerCase()]=u[p]});function h(p){n.Writable.call(this);var x=u[p];if(!x)throw new Error("Unknown message digest");this._hashType=x.hash,this._hash=e(x.hash),this._tag=x.id,this._signType=x.sign}a(h,n.Writable),h.prototype._write=function(x,m,v){this._hash.update(x),v()},h.prototype.update=function(x,m){return this._hash.update(typeof x=="string"?t.from(x,m):x),this},h.prototype.sign=function(x,m){this.end();var v=this._hash.digest(),g=c(v,x,this._hashType,this._signType,this._tag);return m?g.toString(m):g};function l(p){n.Writable.call(this);var x=u[p];if(!x)throw new Error("Unknown message digest");this._hash=e(x.hash),this._tag=x.id,this._signType=x.sign}a(l,n.Writable),l.prototype._write=function(x,m,v){this._hash.update(x),v()},l.prototype.update=function(x,m){return this._hash.update(typeof x=="string"?t.from(x,m):x),this},l.prototype.verify=function(x,m,v){var g=typeof m=="string"?t.from(m,v):m;this.end();var $=this._hash.digest();return o(g,$,x,this._signType,this._tag)};function b(p){return new h(p)}function d(p){return new l(p)}return browser$3={Sign:b,Verify:d,createSign:b,createVerify:d},browser$3}var browser$2,hasRequiredBrowser$2;function requireBrowser$2(){if(hasRequiredBrowser$2)return browser$2;hasRequiredBrowser$2=1;var t=requireElliptic(),e=bnExports;browser$2=function(u){return new a(u)};var n={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}};n.p224=n.secp224r1,n.p256=n.secp256r1=n.prime256v1,n.p192=n.secp192r1=n.prime192v1,n.p384=n.secp384r1,n.p521=n.secp521r1;function a(o){this.curveType=n[o],this.curveType||(this.curveType={name:o}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}a.prototype.generateKeys=function(o,u){return this.keys=this.curve.genKeyPair(),this.getPublicKey(o,u)},a.prototype.computeSecret=function(o,u,h){u=u||"utf8",Buffer.isBuffer(o)||(o=new Buffer(o,u));var l=this.curve.keyFromPublic(o).getPublic(),b=l.mul(this.keys.getPrivate()).getX();return c(b,h,this.curveType.byteLength)},a.prototype.getPublicKey=function(o,u){var h=this.keys.getPublic(u==="compressed",!0);return u==="hybrid"&&(h[h.length-1]%2?h[0]=7:h[0]=6),c(h,o)},a.prototype.getPrivateKey=function(o){return c(this.keys.getPrivate(),o)},a.prototype.setPublicKey=function(o,u){return u=u||"utf8",Buffer.isBuffer(o)||(o=new Buffer(o,u)),this.keys._importPublic(o),this},a.prototype.setPrivateKey=function(o,u){u=u||"utf8",Buffer.isBuffer(o)||(o=new Buffer(o,u));var h=new e(o);return h=h.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(h),this};function c(o,u,h){Array.isArray(o)||(o=o.toArray());var l=new Buffer(o);if(h&&l.length<h){var b=new Buffer(h-l.length);b.fill(0),l=Buffer.concat([b,l])}return u?l.toString(u):l}return browser$2}var browser$1={},mgf,hasRequiredMgf;function requireMgf(){if(hasRequiredMgf)return mgf;hasRequiredMgf=1;var t=requireBrowser$9(),e=requireSafeBuffer$1().Buffer;mgf=function(a,c){for(var o=e.alloc(0),u=0,h;o.length<c;)h=n(u++),o=e.concat([o,t("sha1").update(a).update(h).digest()]);return o.slice(0,c)};function n(a){var c=e.allocUnsafe(4);return c.writeUInt32BE(a,0),c}return mgf}var xor,hasRequiredXor;function requireXor(){return hasRequiredXor||(hasRequiredXor=1,xor=function(e,n){for(var a=e.length,c=-1;++c<a;)e[c]^=n[c];return e}),xor}var withPublic_1,hasRequiredWithPublic;function requireWithPublic(){if(hasRequiredWithPublic)return withPublic_1;hasRequiredWithPublic=1;var t=bnExports,e=requireSafeBuffer$1().Buffer;function n(a,c){return e.from(a.toRed(t.mont(c.modulus)).redPow(new t(c.publicExponent)).fromRed().toArray())}return withPublic_1=n,withPublic_1}var publicEncrypt,hasRequiredPublicEncrypt;function requirePublicEncrypt(){if(hasRequiredPublicEncrypt)return publicEncrypt;hasRequiredPublicEncrypt=1;var t=requireParseAsn1(),e=requireBrowser$b(),n=requireBrowser$9(),a=requireMgf(),c=requireXor(),o=bnExports,u=requireWithPublic(),h=requireBrowserifyRsa(),l=requireSafeBuffer$1().Buffer;publicEncrypt=function(m,v,g){var $;m.padding?$=m.padding:g?$=1:$=4;var B=t(m),C;if($===4)C=b(B,v);else if($===1)C=d(B,v,g);else if($===3){if(C=new o(v),C.cmp(B.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return g?h(C,B):u(C,B)};function b(x,m){var v=x.modulus.byteLength(),g=m.length,$=n("sha1").update(l.alloc(0)).digest(),B=$.length,C=2*B;if(g>v-C-2)throw new Error("message too long");var F=l.alloc(v-g-C-2),H=v-B-1,W=e(B),Z=c(l.concat([$,F,l.alloc(1,1),m],H),a(W,H)),ie=c(W,a(Z,B));return new o(l.concat([l.alloc(1),ie,Z],v))}function d(x,m,v){var g=m.length,$=x.modulus.byteLength();if(g>$-11)throw new Error("message too long");var B;return v?B=l.alloc($-g-3,255):B=p($-g-3),new o(l.concat([l.from([0,v?1:2]),B,l.alloc(1),m],$))}function p(x){for(var m=l.allocUnsafe(x),v=0,g=e(x*2),$=0,B;v<x;)$===g.length&&(g=e(x*2),$=0),B=g[$++],B&&(m[v++]=B);return m}return publicEncrypt}var privateDecrypt,hasRequiredPrivateDecrypt;function requirePrivateDecrypt(){if(hasRequiredPrivateDecrypt)return privateDecrypt;hasRequiredPrivateDecrypt=1;var t=requireParseAsn1(),e=requireMgf(),n=requireXor(),a=bnExports,c=requireBrowserifyRsa(),o=requireBrowser$9(),u=requireWithPublic(),h=requireSafeBuffer$1().Buffer;privateDecrypt=function(x,m,v){var g;x.padding?g=x.padding:v?g=1:g=4;var $=t(x),B=$.modulus.byteLength();if(m.length>B||new a(m).cmp($.modulus)>=0)throw new Error("decryption error");var C;v?C=u(new a(m),$):C=c(m,$);var F=h.alloc(B-C.length);if(C=h.concat([F,C],B),g===4)return l($,C);if(g===1)return b($,C,v);if(g===3)return C;throw new Error("unknown padding")};function l(p,x){var m=p.modulus.byteLength(),v=o("sha1").update(h.alloc(0)).digest(),g=v.length;if(x[0]!==0)throw new Error("decryption error");var $=x.slice(1,g+1),B=x.slice(g+1),C=n($,e(B,g)),F=n(B,e(C,m-g-1));if(d(v,F.slice(0,g)))throw new Error("decryption error");for(var H=g;F[H]===0;)H++;if(F[H++]!==1)throw new Error("decryption error");return F.slice(H)}function b(p,x,m){for(var v=x.slice(0,2),g=2,$=0;x[g++]!==0;)if(g>=x.length){$++;break}var B=x.slice(2,g-1);if((v.toString("hex")!=="0002"&&!m||v.toString("hex")!=="0001"&&m)&&$++,B.length<8&&$++,$)throw new Error("decryption error");return x.slice(g)}function d(p,x){p=h.from(p),x=h.from(x);var m=0,v=p.length;p.length!==x.length&&(m++,v=Math.min(p.length,x.length));for(var g=-1;++g<v;)m+=p[g]^x[g];return m}return privateDecrypt}var hasRequiredBrowser$1;function requireBrowser$1(){return hasRequiredBrowser$1||(hasRequiredBrowser$1=1,function(t){t.publicEncrypt=requirePublicEncrypt(),t.privateDecrypt=requirePrivateDecrypt(),t.privateEncrypt=function(n,a){return t.publicEncrypt(n,a,!0)},t.publicDecrypt=function(n,a){return t.privateDecrypt(n,a,!0)}}(browser$1)),browser$1}var browser={},hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser;hasRequiredBrowser=1;function t(){throw new Error(`secure random number generation not supported by this browser
|
|
23
|
-
use chrome, FireFox or Internet Explorer 11`)}var e=requireSafeBuffer$1(),n=requireBrowser$b(),a=e.Buffer,c=e.kMaxLength,o=commonjsGlobal.crypto||commonjsGlobal.msCrypto,u=Math.pow(2,32)-1;function h(x,m){if(typeof x!="number"||x!==x)throw new TypeError("offset must be a number");if(x>u||x<0)throw new TypeError("offset must be a uint32");if(x>c||x>m)throw new RangeError("offset out of range")}function l(x,m,v){if(typeof x!="number"||x!==x)throw new TypeError("size must be a number");if(x>u||x<0)throw new TypeError("size must be a uint32");if(x+m>v||x>c)throw new RangeError("buffer too small")}o&&o.getRandomValues||!process$1.browser?(browser.randomFill=b,browser.randomFillSync=p):(browser.randomFill=t,browser.randomFillSync=t);function b(x,m,v,g){if(!a.isBuffer(x)&&!(x instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof m=="function")g=m,m=0,v=x.length;else if(typeof v=="function")g=v,v=x.length-m;else if(typeof g!="function")throw new TypeError('"cb" argument must be a function');return h(m,x.length),l(v,m,x.length),d(x,m,v,g)}function d(x,m,v,g){if(process$1.browser){var $=x.buffer,B=new Uint8Array($,m,v);if(o.getRandomValues(B),g){process$1.nextTick(function(){g(null,x)});return}return x}if(g){n(v,function(F,H){if(F)return g(F);H.copy(x,m),g(null,x)});return}var C=n(v);return C.copy(x,m),x}function p(x,m,v){if(typeof m>"u"&&(m=0),!a.isBuffer(x)&&!(x instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return h(m,x.length),v===void 0&&(v=x.length-m),l(v,m,x.length),d(x,m,v)}return browser}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=requireBrowser$b(),cryptoBrowserify.createHash=cryptoBrowserify.Hash=requireBrowser$9(),cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=requireBrowser$8();var t=requireAlgos(),e=Object.keys(t),n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(e);cryptoBrowserify.getHashes=function(){return n};var a=requireBrowser$7();cryptoBrowserify.pbkdf2=a.pbkdf2,cryptoBrowserify.pbkdf2Sync=a.pbkdf2Sync;var c=requireBrowser$5();cryptoBrowserify.Cipher=c.Cipher,cryptoBrowserify.createCipher=c.createCipher,cryptoBrowserify.Cipheriv=c.Cipheriv,cryptoBrowserify.createCipheriv=c.createCipheriv,cryptoBrowserify.Decipher=c.Decipher,cryptoBrowserify.createDecipher=c.createDecipher,cryptoBrowserify.Decipheriv=c.Decipheriv,cryptoBrowserify.createDecipheriv=c.createDecipheriv,cryptoBrowserify.getCiphers=c.getCiphers,cryptoBrowserify.listCiphers=c.listCiphers;var o=requireBrowser$4();cryptoBrowserify.DiffieHellmanGroup=o.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=o.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=o.getDiffieHellman,cryptoBrowserify.createDiffieHellman=o.createDiffieHellman,cryptoBrowserify.DiffieHellman=o.DiffieHellman;var u=requireBrowser$3();cryptoBrowserify.createSign=u.createSign,cryptoBrowserify.Sign=u.Sign,cryptoBrowserify.createVerify=u.createVerify,cryptoBrowserify.Verify=u.Verify,cryptoBrowserify.createECDH=requireBrowser$2();var h=requireBrowser$1();cryptoBrowserify.publicEncrypt=h.publicEncrypt,cryptoBrowserify.privateEncrypt=h.privateEncrypt,cryptoBrowserify.publicDecrypt=h.publicDecrypt,cryptoBrowserify.privateDecrypt=h.privateDecrypt;var l=requireBrowser();return cryptoBrowserify.randomFill=l.randomFill,cryptoBrowserify.randomFillSync=l.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(`
|
|
24
|
-
`))},cryptoBrowserify.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},cryptoBrowserify}var hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var t;brorand.exports=function(c){return t||(t=new e(null)),t.generate(c)};function e(a){this.rand=a}if(brorand.exports.Rand=e,e.prototype.generate=function(c){return this._rand(c)},e.prototype._rand=function(c){if(this.rand.getBytes)return this.rand.getBytes(c);for(var o=new Uint8Array(c),u=0;u<o.length;u++)o[u]=this.rand.getByte();return o},typeof self=="object")self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(c){var o=new Uint8Array(c);return self.crypto.getRandomValues(o),o}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(c){var o=new Uint8Array(c);return self.msCrypto.getRandomValues(o),o}:typeof window=="object"&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var n=requireCryptoBrowserify();if(typeof n.randomBytes!="function")throw new Error("Not supported");e.prototype._rand=function(c){return n.randomBytes(c)}}catch{}return brorand.exports}var curve={},BN$6=bnExports,utils$l=utils$o,getNAF=utils$l.getNAF,getJSF=utils$l.getJSF,assert$d=utils$l.assert;function BaseCurve(t,e){this.type=t,this.p=new BN$6(e.p,16),this.red=e.prime?BN$6.red(e.prime):BN$6.mont(this.p),this.zero=new BN$6(0).toRed(this.red),this.one=new BN$6(1).toRed(this.red),this.two=new BN$6(2).toRed(this.red),this.n=e.n&&new BN$6(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base=BaseCurve;BaseCurve.prototype.point=function t(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function t(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function t(e,n){assert$d(e.precomputed);var a=e._getDoubles(),c=getNAF(n,1,this._bitLength),o=(1<<a.step+1)-(a.step%2===0?2:1);o/=3;var u=[],h,l;for(h=0;h<c.length;h+=a.step){l=0;for(var b=h+a.step-1;b>=h;b--)l=(l<<1)+c[b];u.push(l)}for(var d=this.jpoint(null,null,null),p=this.jpoint(null,null,null),x=o;x>0;x--){for(h=0;h<u.length;h++)l=u[h],l===x?p=p.mixedAdd(a.points[h]):l===-x&&(p=p.mixedAdd(a.points[h].neg()));d=d.add(p)}return d.toP()},BaseCurve.prototype._wnafMul=function t(e,n){var a=4,c=e._getNAFPoints(a);a=c.wnd;for(var o=c.points,u=getNAF(n,a,this._bitLength),h=this.jpoint(null,null,null),l=u.length-1;l>=0;l--){for(var b=0;l>=0&&u[l]===0;l--)b++;if(l>=0&&b++,h=h.dblp(b),l<0)break;var d=u[l];assert$d(d!==0),e.type==="affine"?d>0?h=h.mixedAdd(o[d-1>>1]):h=h.mixedAdd(o[-d-1>>1].neg()):d>0?h=h.add(o[d-1>>1]):h=h.add(o[-d-1>>1].neg())}return e.type==="affine"?h.toP():h},BaseCurve.prototype._wnafMulAdd=function t(e,n,a,c,o){var u=this._wnafT1,h=this._wnafT2,l=this._wnafT3,b=0,d,p,x;for(d=0;d<c;d++){x=n[d];var m=x._getNAFPoints(e);u[d]=m.wnd,h[d]=m.points}for(d=c-1;d>=1;d-=2){var v=d-1,g=d;if(u[v]!==1||u[g]!==1){l[v]=getNAF(a[v],u[v],this._bitLength),l[g]=getNAF(a[g],u[g],this._bitLength),b=Math.max(l[v].length,b),b=Math.max(l[g].length,b);continue}var $=[n[v],null,null,n[g]];n[v].y.cmp(n[g].y)===0?($[1]=n[v].add(n[g]),$[2]=n[v].toJ().mixedAdd(n[g].neg())):n[v].y.cmp(n[g].y.redNeg())===0?($[1]=n[v].toJ().mixedAdd(n[g]),$[2]=n[v].add(n[g].neg())):($[1]=n[v].toJ().mixedAdd(n[g]),$[2]=n[v].toJ().mixedAdd(n[g].neg()));var B=[-3,-1,-5,-7,0,7,5,1,3],C=getJSF(a[v],a[g]);for(b=Math.max(C[0].length,b),l[v]=new Array(b),l[g]=new Array(b),p=0;p<b;p++){var F=C[0][p]|0,H=C[1][p]|0;l[v][p]=B[(F+1)*3+(H+1)],l[g][p]=0,h[v]=$}}var W=this.jpoint(null,null,null),Z=this._wnafT4;for(d=b;d>=0;d--){for(var ie=0;d>=0;){var te=!0;for(p=0;p<c;p++)Z[p]=l[p][d]|0,Z[p]!==0&&(te=!1);if(!te)break;ie++,d--}if(d>=0&&ie++,W=W.dblp(ie),d<0)break;for(p=0;p<c;p++){var ae=Z[p];ae!==0&&(ae>0?x=h[p][ae-1>>1]:ae<0&&(x=h[p][-ae-1>>1].neg()),x.type==="affine"?W=W.mixedAdd(x):W=W.add(x))}}for(d=0;d<c;d++)h[d]=null;return o?W:W.toP()};function BasePoint(t,e){this.curve=t,this.type=e,this.precomputed=null}BaseCurve.BasePoint=BasePoint,BasePoint.prototype.eq=function t(){throw new Error("Not implemented")},BasePoint.prototype.validate=function t(){return this.curve.validate(this)},BaseCurve.prototype.decodePoint=function t(e,n){e=utils$l.toArray(e,n);var a=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*a){e[0]===6?assert$d(e[e.length-1]%2===0):e[0]===7&&assert$d(e[e.length-1]%2===1);var c=this.point(e.slice(1,1+a),e.slice(1+a,1+2*a));return c}else if((e[0]===2||e[0]===3)&&e.length-1===a)return this.pointFromX(e.slice(1,1+a),e[0]===3);throw new Error("Unknown point format")},BasePoint.prototype.encodeCompressed=function t(e){return this.encode(e,!0)},BasePoint.prototype._encode=function t(e){var n=this.curve.p.byteLength(),a=this.getX().toArray("be",n);return e?[this.getY().isEven()?2:3].concat(a):[4].concat(a,this.getY().toArray("be",n))},BasePoint.prototype.encode=function t(e,n){return utils$l.encode(this._encode(n),e)},BasePoint.prototype.precompute=function t(e){if(this.precomputed)return this;var n={doubles:null,naf:null,beta:null};return n.naf=this._getNAFPoints(8),n.doubles=this._getDoubles(4,e),n.beta=this._getBeta(),this.precomputed=n,this},BasePoint.prototype._hasDoubles=function t(e){if(!this.precomputed)return!1;var n=this.precomputed.doubles;return n?n.points.length>=Math.ceil((e.bitLength()+1)/n.step):!1},BasePoint.prototype._getDoubles=function t(e,n){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],c=this,o=0;o<n;o+=e){for(var u=0;u<e;u++)c=c.dbl();a.push(c)}return{step:e,points:a}},BasePoint.prototype._getNAFPoints=function t(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var n=[this],a=(1<<e)-1,c=a===1?null:this.dbl(),o=1;o<a;o++)n[o]=n[o-1].add(c);return{wnd:e,points:n}},BasePoint.prototype._getBeta=function t(){return null},BasePoint.prototype.dblp=function t(e){for(var n=this,a=0;a<e;a++)n=n.dbl();return n};var utils$k=utils$o,BN$5=bnExports,inherits$4=inherits_browserExports,Base$2=base,assert$c=utils$k.assert;function ShortCurve(t){Base$2.call(this,"short",t),this.a=new BN$5(t.a,16).toRed(this.red),this.b=new BN$5(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}inherits$4(ShortCurve,Base$2);var short=ShortCurve;ShortCurve.prototype._getEndomorphism=function t(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var n,a;if(e.beta)n=new BN$5(e.beta,16).toRed(this.red);else{var c=this._getEndoRoots(this.p);n=c[0].cmp(c[1])<0?c[0]:c[1],n=n.toRed(this.red)}if(e.lambda)a=new BN$5(e.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(n))===0?a=o[0]:(a=o[1],assert$c(this.g.mul(a).x.cmp(this.g.x.redMul(n))===0))}var u;return e.basis?u=e.basis.map(function(h){return{a:new BN$5(h.a,16),b:new BN$5(h.b,16)}}):u=this._getEndoBasis(a),{beta:n,lambda:a,basis:u}}},ShortCurve.prototype._getEndoRoots=function t(e){var n=e===this.p?this.red:BN$5.mont(e),a=new BN$5(2).toRed(n).redInvm(),c=a.redNeg(),o=new BN$5(3).toRed(n).redNeg().redSqrt().redMul(a),u=c.redAdd(o).fromRed(),h=c.redSub(o).fromRed();return[u,h]},ShortCurve.prototype._getEndoBasis=function t(e){for(var n=this.n.ushrn(Math.floor(this.n.bitLength()/2)),a=e,c=this.n.clone(),o=new BN$5(1),u=new BN$5(0),h=new BN$5(0),l=new BN$5(1),b,d,p,x,m,v,g,$=0,B,C;a.cmpn(0)!==0;){var F=c.div(a);B=c.sub(F.mul(a)),C=h.sub(F.mul(o));var H=l.sub(F.mul(u));if(!p&&B.cmp(n)<0)b=g.neg(),d=o,p=B.neg(),x=C;else if(p&&++$===2)break;g=B,c=a,a=B,h=o,o=C,l=u,u=H}m=B.neg(),v=C;var W=p.sqr().add(x.sqr()),Z=m.sqr().add(v.sqr());return Z.cmp(W)>=0&&(m=b,v=d),p.negative&&(p=p.neg(),x=x.neg()),m.negative&&(m=m.neg(),v=v.neg()),[{a:p,b:x},{a:m,b:v}]},ShortCurve.prototype._endoSplit=function t(e){var n=this.endo.basis,a=n[0],c=n[1],o=c.b.mul(e).divRound(this.n),u=a.b.neg().mul(e).divRound(this.n),h=o.mul(a.a),l=u.mul(c.a),b=o.mul(a.b),d=u.mul(c.b),p=e.sub(h).sub(l),x=b.add(d).neg();return{k1:p,k2:x}},ShortCurve.prototype.pointFromX=function t(e,n){e=new BN$5(e,16),e.red||(e=e.toRed(this.red));var a=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),c=a.redSqrt();if(c.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var o=c.fromRed().isOdd();return(n&&!o||!n&&o)&&(c=c.redNeg()),this.point(e,c)},ShortCurve.prototype.validate=function t(e){if(e.inf)return!0;var n=e.x,a=e.y,c=this.a.redMul(n),o=n.redSqr().redMul(n).redIAdd(c).redIAdd(this.b);return a.redSqr().redISub(o).cmpn(0)===0},ShortCurve.prototype._endoWnafMulAdd=function t(e,n,a){for(var c=this._endoWnafT1,o=this._endoWnafT2,u=0;u<e.length;u++){var h=this._endoSplit(n[u]),l=e[u],b=l._getBeta();h.k1.negative&&(h.k1.ineg(),l=l.neg(!0)),h.k2.negative&&(h.k2.ineg(),b=b.neg(!0)),c[u*2]=l,c[u*2+1]=b,o[u*2]=h.k1,o[u*2+1]=h.k2}for(var d=this._wnafMulAdd(1,c,o,u*2,a),p=0;p<u*2;p++)c[p]=null,o[p]=null;return d};function Point$2(t,e,n,a){Base$2.BasePoint.call(this,t,"affine"),e===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN$5(e,16),this.y=new BN$5(n,16),a&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}inherits$4(Point$2,Base$2.BasePoint),ShortCurve.prototype.point=function t(e,n,a){return new Point$2(this,e,n,a)},ShortCurve.prototype.pointFromJSON=function t(e,n){return Point$2.fromJSON(this,e,n)},Point$2.prototype._getBeta=function t(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var n=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var a=this.curve,c=function(o){return a.point(o.x.redMul(a.endo.beta),o.y)};e.beta=n,n.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(c)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(c)}}}return n}},Point$2.prototype.toJSON=function t(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point$2.fromJSON=function t(e,n,a){typeof n=="string"&&(n=JSON.parse(n));var c=e.point(n[0],n[1],a);if(!n[2])return c;function o(h){return e.point(h[0],h[1],a)}var u=n[2];return c.precomputed={beta:null,doubles:u.doubles&&{step:u.doubles.step,points:[c].concat(u.doubles.points.map(o))},naf:u.naf&&{wnd:u.naf.wnd,points:[c].concat(u.naf.points.map(o))}},c},Point$2.prototype.inspect=function t(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point$2.prototype.isInfinity=function t(){return this.inf},Point$2.prototype.add=function t(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var n=this.y.redSub(e.y);n.cmpn(0)!==0&&(n=n.redMul(this.x.redSub(e.x).redInvm()));var a=n.redSqr().redISub(this.x).redISub(e.x),c=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,c)},Point$2.prototype.dbl=function t(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var n=this.curve.a,a=this.x.redSqr(),c=e.redInvm(),o=a.redAdd(a).redIAdd(a).redIAdd(n).redMul(c),u=o.redSqr().redISub(this.x.redAdd(this.x)),h=o.redMul(this.x.redSub(u)).redISub(this.y);return this.curve.point(u,h)},Point$2.prototype.getX=function t(){return this.x.fromRed()},Point$2.prototype.getY=function t(){return this.y.fromRed()},Point$2.prototype.mul=function t(e){return e=new BN$5(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Point$2.prototype.mulAdd=function t(e,n,a){var c=[this,n],o=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(c,o):this.curve._wnafMulAdd(1,c,o,2)},Point$2.prototype.jmulAdd=function t(e,n,a){var c=[this,n],o=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(c,o,!0):this.curve._wnafMulAdd(1,c,o,2,!0)},Point$2.prototype.eq=function t(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},Point$2.prototype.neg=function t(e){if(this.inf)return this;var n=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var a=this.precomputed,c=function(o){return o.neg()};n.precomputed={naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(c)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(c)}}}return n},Point$2.prototype.toJ=function t(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function JPoint(t,e,n,a){Base$2.BasePoint.call(this,t,"jacobian"),e===null&&n===null&&a===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$5(0)):(this.x=new BN$5(e,16),this.y=new BN$5(n,16),this.z=new BN$5(a,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$4(JPoint,Base$2.BasePoint),ShortCurve.prototype.jpoint=function t(e,n,a){return new JPoint(this,e,n,a)},JPoint.prototype.toP=function t(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),n=e.redSqr(),a=this.x.redMul(n),c=this.y.redMul(n).redMul(e);return this.curve.point(a,c)},JPoint.prototype.neg=function t(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function t(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var n=e.z.redSqr(),a=this.z.redSqr(),c=this.x.redMul(n),o=e.x.redMul(a),u=this.y.redMul(n.redMul(e.z)),h=e.y.redMul(a.redMul(this.z)),l=c.redSub(o),b=u.redSub(h);if(l.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=l.redSqr(),p=d.redMul(l),x=c.redMul(d),m=b.redSqr().redIAdd(p).redISub(x).redISub(x),v=b.redMul(x.redISub(m)).redISub(u.redMul(p)),g=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(m,v,g)},JPoint.prototype.mixedAdd=function t(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var n=this.z.redSqr(),a=this.x,c=e.x.redMul(n),o=this.y,u=e.y.redMul(n).redMul(this.z),h=a.redSub(c),l=o.redSub(u);if(h.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=h.redSqr(),d=b.redMul(h),p=a.redMul(b),x=l.redSqr().redIAdd(d).redISub(p).redISub(p),m=l.redMul(p.redISub(x)).redISub(o.redMul(d)),v=this.z.redMul(h);return this.curve.jpoint(x,m,v)},JPoint.prototype.dblp=function t(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var n;if(this.curve.zeroA||this.curve.threeA){var a=this;for(n=0;n<e;n++)a=a.dbl();return a}var c=this.curve.a,o=this.curve.tinv,u=this.x,h=this.y,l=this.z,b=l.redSqr().redSqr(),d=h.redAdd(h);for(n=0;n<e;n++){var p=u.redSqr(),x=d.redSqr(),m=x.redSqr(),v=p.redAdd(p).redIAdd(p).redIAdd(c.redMul(b)),g=u.redMul(x),$=v.redSqr().redISub(g.redAdd(g)),B=g.redISub($),C=v.redMul(B);C=C.redIAdd(C).redISub(m);var F=d.redMul(l);n+1<e&&(b=b.redMul(m)),u=$,l=F,d=C}return this.curve.jpoint(u,d.redMul(o),l)},JPoint.prototype.dbl=function t(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint.prototype._zeroDbl=function t(){var e,n,a;if(this.zOne){var c=this.x.redSqr(),o=this.y.redSqr(),u=o.redSqr(),h=this.x.redAdd(o).redSqr().redISub(c).redISub(u);h=h.redIAdd(h);var l=c.redAdd(c).redIAdd(c),b=l.redSqr().redISub(h).redISub(h),d=u.redIAdd(u);d=d.redIAdd(d),d=d.redIAdd(d),e=b,n=l.redMul(h.redISub(b)).redISub(d),a=this.y.redAdd(this.y)}else{var p=this.x.redSqr(),x=this.y.redSqr(),m=x.redSqr(),v=this.x.redAdd(x).redSqr().redISub(p).redISub(m);v=v.redIAdd(v);var g=p.redAdd(p).redIAdd(p),$=g.redSqr(),B=m.redIAdd(m);B=B.redIAdd(B),B=B.redIAdd(B),e=$.redISub(v).redISub(v),n=g.redMul(v.redISub(e)).redISub(B),a=this.y.redMul(this.z),a=a.redIAdd(a)}return this.curve.jpoint(e,n,a)},JPoint.prototype._threeDbl=function t(){var e,n,a;if(this.zOne){var c=this.x.redSqr(),o=this.y.redSqr(),u=o.redSqr(),h=this.x.redAdd(o).redSqr().redISub(c).redISub(u);h=h.redIAdd(h);var l=c.redAdd(c).redIAdd(c).redIAdd(this.curve.a),b=l.redSqr().redISub(h).redISub(h);e=b;var d=u.redIAdd(u);d=d.redIAdd(d),d=d.redIAdd(d),n=l.redMul(h.redISub(b)).redISub(d),a=this.y.redAdd(this.y)}else{var p=this.z.redSqr(),x=this.y.redSqr(),m=this.x.redMul(x),v=this.x.redSub(p).redMul(this.x.redAdd(p));v=v.redAdd(v).redIAdd(v);var g=m.redIAdd(m);g=g.redIAdd(g);var $=g.redAdd(g);e=v.redSqr().redISub($),a=this.y.redAdd(this.z).redSqr().redISub(x).redISub(p);var B=x.redSqr();B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B),n=v.redMul(g.redISub(e)).redISub(B)}return this.curve.jpoint(e,n,a)},JPoint.prototype._dbl=function t(){var e=this.curve.a,n=this.x,a=this.y,c=this.z,o=c.redSqr().redSqr(),u=n.redSqr(),h=a.redSqr(),l=u.redAdd(u).redIAdd(u).redIAdd(e.redMul(o)),b=n.redAdd(n);b=b.redIAdd(b);var d=b.redMul(h),p=l.redSqr().redISub(d.redAdd(d)),x=d.redISub(p),m=h.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var v=l.redMul(x).redISub(m),g=a.redAdd(a).redMul(c);return this.curve.jpoint(p,v,g)},JPoint.prototype.trpl=function t(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),n=this.y.redSqr(),a=this.z.redSqr(),c=n.redSqr(),o=e.redAdd(e).redIAdd(e),u=o.redSqr(),h=this.x.redAdd(n).redSqr().redISub(e).redISub(c);h=h.redIAdd(h),h=h.redAdd(h).redIAdd(h),h=h.redISub(u);var l=h.redSqr(),b=c.redIAdd(c);b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var d=o.redIAdd(h).redSqr().redISub(u).redISub(l).redISub(b),p=n.redMul(d);p=p.redIAdd(p),p=p.redIAdd(p);var x=this.x.redMul(l).redISub(p);x=x.redIAdd(x),x=x.redIAdd(x);var m=this.y.redMul(d.redMul(b.redISub(d)).redISub(h.redMul(l)));m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var v=this.z.redAdd(h).redSqr().redISub(a).redISub(l);return this.curve.jpoint(x,m,v)},JPoint.prototype.mul=function t(e,n){return e=new BN$5(e,n),this.curve._wnafMul(this,e)},JPoint.prototype.eq=function t(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var n=this.z.redSqr(),a=e.z.redSqr();if(this.x.redMul(a).redISub(e.x.redMul(n)).cmpn(0)!==0)return!1;var c=n.redMul(this.z),o=a.redMul(e.z);return this.y.redMul(o).redISub(e.y.redMul(c)).cmpn(0)===0},JPoint.prototype.eqXToP=function t(e){var n=this.z.redSqr(),a=e.toRed(this.curve.red).redMul(n);if(this.x.cmp(a)===0)return!0;for(var c=e.clone(),o=this.curve.redN.redMul(n);;){if(c.iadd(this.curve.n),c.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(o),this.x.cmp(a)===0)return!0}},JPoint.prototype.inspect=function t(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint.prototype.isInfinity=function t(){return this.z.cmpn(0)===0};var BN$4=bnExports,inherits$3=inherits_browserExports,Base$1=base,utils$j=utils$o;function MontCurve(t){Base$1.call(this,"mont",t),this.a=new BN$4(t.a,16).toRed(this.red),this.b=new BN$4(t.b,16).toRed(this.red),this.i4=new BN$4(4).toRed(this.red).redInvm(),this.two=new BN$4(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$3(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function t(e){var n=e.normalize().x,a=n.redSqr(),c=a.redMul(n).redAdd(a.redMul(this.a)).redAdd(n),o=c.redSqrt();return o.redSqr().cmp(c)===0};function Point$1(t,e,n){Base$1.BasePoint.call(this,t,"projective"),e===null&&n===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$4(e,16),this.z=new BN$4(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$3(Point$1,Base$1.BasePoint),MontCurve.prototype.decodePoint=function t(e,n){return this.point(utils$j.toArray(e,n),1)},MontCurve.prototype.point=function t(e,n){return new Point$1(this,e,n)},MontCurve.prototype.pointFromJSON=function t(e){return Point$1.fromJSON(this,e)},Point$1.prototype.precompute=function t(){},Point$1.prototype._encode=function t(){return this.getX().toArray("be",this.curve.p.byteLength())},Point$1.fromJSON=function t(e,n){return new Point$1(e,n[0],n[1]||e.one)},Point$1.prototype.inspect=function t(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point$1.prototype.isInfinity=function t(){return this.z.cmpn(0)===0},Point$1.prototype.dbl=function t(){var e=this.x.redAdd(this.z),n=e.redSqr(),a=this.x.redSub(this.z),c=a.redSqr(),o=n.redSub(c),u=n.redMul(c),h=o.redMul(c.redAdd(this.curve.a24.redMul(o)));return this.curve.point(u,h)},Point$1.prototype.add=function t(){throw new Error("Not supported on Montgomery curve")},Point$1.prototype.diffAdd=function t(e,n){var a=this.x.redAdd(this.z),c=this.x.redSub(this.z),o=e.x.redAdd(e.z),u=e.x.redSub(e.z),h=u.redMul(a),l=o.redMul(c),b=n.z.redMul(h.redAdd(l).redSqr()),d=n.x.redMul(h.redISub(l).redSqr());return this.curve.point(b,d)},Point$1.prototype.mul=function t(e){for(var n=e.clone(),a=this,c=this.curve.point(null,null),o=this,u=[];n.cmpn(0)!==0;n.iushrn(1))u.push(n.andln(1));for(var h=u.length-1;h>=0;h--)u[h]===0?(a=a.diffAdd(c,o),c=c.dbl()):(c=a.diffAdd(c,o),a=a.dbl());return c},Point$1.prototype.mulAdd=function t(){throw new Error("Not supported on Montgomery curve")},Point$1.prototype.jumlAdd=function t(){throw new Error("Not supported on Montgomery curve")},Point$1.prototype.eq=function t(e){return this.getX().cmp(e.getX())===0},Point$1.prototype.normalize=function t(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point$1.prototype.getX=function t(){return this.normalize(),this.x.fromRed()};var utils$i=utils$o,BN$3=bnExports,inherits$2=inherits_browserExports,Base=base,assert$b=utils$i.assert;function EdwardsCurve(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",t),this.a=new BN$3(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$3(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$3(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$b(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}inherits$2(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function t(e){return this.mOneA?e.redNeg():this.a.redMul(e)},EdwardsCurve.prototype._mulC=function t(e){return this.oneC?e:this.c.redMul(e)},EdwardsCurve.prototype.jpoint=function t(e,n,a,c){return this.point(e,n,a,c)},EdwardsCurve.prototype.pointFromX=function t(e,n){e=new BN$3(e,16),e.red||(e=e.toRed(this.red));var a=e.redSqr(),c=this.c2.redSub(this.a.redMul(a)),o=this.one.redSub(this.c2.redMul(this.d).redMul(a)),u=c.redMul(o.redInvm()),h=u.redSqrt();if(h.redSqr().redSub(u).cmp(this.zero)!==0)throw new Error("invalid point");var l=h.fromRed().isOdd();return(n&&!l||!n&&l)&&(h=h.redNeg()),this.point(e,h)},EdwardsCurve.prototype.pointFromY=function t(e,n){e=new BN$3(e,16),e.red||(e=e.toRed(this.red));var a=e.redSqr(),c=a.redSub(this.c2),o=a.redMul(this.d).redMul(this.c2).redSub(this.a),u=c.redMul(o.redInvm());if(u.cmp(this.zero)===0){if(n)throw new Error("invalid point");return this.point(this.zero,e)}var h=u.redSqrt();if(h.redSqr().redSub(u).cmp(this.zero)!==0)throw new Error("invalid point");return h.fromRed().isOdd()!==n&&(h=h.redNeg()),this.point(h,e)},EdwardsCurve.prototype.validate=function t(e){if(e.isInfinity())return!0;e.normalize();var n=e.x.redSqr(),a=e.y.redSqr(),c=n.redMul(this.a).redAdd(a),o=this.c2.redMul(this.one.redAdd(this.d.redMul(n).redMul(a)));return c.cmp(o)===0};function Point(t,e,n,a,c){Base.BasePoint.call(this,t,"projective"),e===null&&n===null&&a===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$3(e,16),this.y=new BN$3(n,16),this.z=a?new BN$3(a,16):this.curve.one,this.t=c&&new BN$3(c,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits$2(Point,Base.BasePoint),EdwardsCurve.prototype.pointFromJSON=function t(e){return Point.fromJSON(this,e)},EdwardsCurve.prototype.point=function t(e,n,a,c){return new Point(this,e,n,a,c)},Point.fromJSON=function t(e,n){return new Point(e,n[0],n[1],n[2])},Point.prototype.inspect=function t(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function t(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},Point.prototype._extDbl=function t(){var e=this.x.redSqr(),n=this.y.redSqr(),a=this.z.redSqr();a=a.redIAdd(a);var c=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(n),u=c.redAdd(n),h=u.redSub(a),l=c.redSub(n),b=o.redMul(h),d=u.redMul(l),p=o.redMul(l),x=h.redMul(u);return this.curve.point(b,d,x,p)},Point.prototype._projDbl=function t(){var e=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr(),c,o,u,h,l,b;if(this.curve.twisted){h=this.curve._mulA(n);var d=h.redAdd(a);this.zOne?(c=e.redSub(n).redSub(a).redMul(d.redSub(this.curve.two)),o=d.redMul(h.redSub(a)),u=d.redSqr().redSub(d).redSub(d)):(l=this.z.redSqr(),b=d.redSub(l).redISub(l),c=e.redSub(n).redISub(a).redMul(b),o=d.redMul(h.redSub(a)),u=d.redMul(b))}else h=n.redAdd(a),l=this.curve._mulC(this.z).redSqr(),b=h.redSub(l).redSub(l),c=this.curve._mulC(e.redISub(h)).redMul(b),o=this.curve._mulC(h).redMul(n.redISub(a)),u=h.redMul(b);return this.curve.point(c,o,u)},Point.prototype.dbl=function t(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function t(e){var n=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),a=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),c=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),u=a.redSub(n),h=o.redSub(c),l=o.redAdd(c),b=a.redAdd(n),d=u.redMul(h),p=l.redMul(b),x=u.redMul(b),m=h.redMul(l);return this.curve.point(d,p,m,x)},Point.prototype._projAdd=function t(e){var n=this.z.redMul(e.z),a=n.redSqr(),c=this.x.redMul(e.x),o=this.y.redMul(e.y),u=this.curve.d.redMul(c).redMul(o),h=a.redSub(u),l=a.redAdd(u),b=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(c).redISub(o),d=n.redMul(h).redMul(b),p,x;return this.curve.twisted?(p=n.redMul(l).redMul(o.redSub(this.curve._mulA(c))),x=h.redMul(l)):(p=n.redMul(l).redMul(o.redSub(c)),x=this.curve._mulC(h).redMul(l)),this.curve.point(d,p,x)},Point.prototype.add=function t(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},Point.prototype.mul=function t(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},Point.prototype.mulAdd=function t(e,n,a){return this.curve._wnafMulAdd(1,[this,n],[e,a],2,!1)},Point.prototype.jmulAdd=function t(e,n,a){return this.curve._wnafMulAdd(1,[this,n],[e,a],2,!0)},Point.prototype.normalize=function t(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function t(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function t(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function t(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function t(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},Point.prototype.eqXToP=function t(e){var n=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(n)===0)return!0;for(var a=e.clone(),c=this.curve.redN.redMul(this.z);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(c),this.x.cmp(n)===0)return!0}},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add,function(t){var e=t;e.base=base,e.short=short,e.mont=mont,e.edwards=edwards}(curve);var curves$1={},hash$2={},utils$h={},assert$a=minimalisticAssert,inherits$1=inherits_browserExports;utils$h.inherits=inherits$1;function isSurrogatePair(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function toArray$1(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),c=0;c<t.length;c+=2)n.push(parseInt(t[c]+t[c+1],16))}else for(var a=0,c=0;c<t.length;c++){var o=t.charCodeAt(c);o<128?n[a++]=o:o<2048?(n[a++]=o>>6|192,n[a++]=o&63|128):isSurrogatePair(t,c)?(o=65536+((o&1023)<<10)+(t.charCodeAt(++c)&1023),n[a++]=o>>18|240,n[a++]=o>>12&63|128,n[a++]=o>>6&63|128,n[a++]=o&63|128):(n[a++]=o>>12|224,n[a++]=o>>6&63|128,n[a++]=o&63|128)}else for(c=0;c<t.length;c++)n[c]=t[c]|0;return n}utils$h.toArray=toArray$1;function toHex(t){for(var e="",n=0;n<t.length;n++)e+=zero2(t[n].toString(16));return e}utils$h.toHex=toHex;function htonl(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}utils$h.htonl=htonl;function toHex32(t,e){for(var n="",a=0;a<t.length;a++){var c=t[a];e==="little"&&(c=htonl(c)),n+=zero8(c.toString(16))}return n}utils$h.toHex32=toHex32;function zero2(t){return t.length===1?"0"+t:t}utils$h.zero2=zero2;function zero8(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}utils$h.zero8=zero8;function join32(t,e,n,a){var c=n-e;assert$a(c%4===0);for(var o=new Array(c/4),u=0,h=e;u<o.length;u++,h+=4){var l;a==="big"?l=t[h]<<24|t[h+1]<<16|t[h+2]<<8|t[h+3]:l=t[h+3]<<24|t[h+2]<<16|t[h+1]<<8|t[h],o[u]=l>>>0}return o}utils$h.join32=join32;function split32(t,e){for(var n=new Array(t.length*4),a=0,c=0;a<t.length;a++,c+=4){var o=t[a];e==="big"?(n[c]=o>>>24,n[c+1]=o>>>16&255,n[c+2]=o>>>8&255,n[c+3]=o&255):(n[c+3]=o>>>24,n[c+2]=o>>>16&255,n[c+1]=o>>>8&255,n[c]=o&255)}return n}utils$h.split32=split32;function rotr32$1(t,e){return t>>>e|t<<32-e}utils$h.rotr32=rotr32$1;function rotl32$2(t,e){return t<<e|t>>>32-e}utils$h.rotl32=rotl32$2;function sum32$3(t,e){return t+e>>>0}utils$h.sum32=sum32$3;function sum32_3$1(t,e,n){return t+e+n>>>0}utils$h.sum32_3=sum32_3$1;function sum32_4$2(t,e,n,a){return t+e+n+a>>>0}utils$h.sum32_4=sum32_4$2;function sum32_5$2(t,e,n,a,c){return t+e+n+a+c>>>0}utils$h.sum32_5=sum32_5$2;function sum64$1(t,e,n,a){var c=t[e],o=t[e+1],u=a+o>>>0,h=(u<a?1:0)+n+c;t[e]=h>>>0,t[e+1]=u}utils$h.sum64=sum64$1;function sum64_hi$1(t,e,n,a){var c=e+a>>>0,o=(c<e?1:0)+t+n;return o>>>0}utils$h.sum64_hi=sum64_hi$1;function sum64_lo$1(t,e,n,a){var c=e+a;return c>>>0}utils$h.sum64_lo=sum64_lo$1;function sum64_4_hi$1(t,e,n,a,c,o,u,h){var l=0,b=e;b=b+a>>>0,l+=b<e?1:0,b=b+o>>>0,l+=b<o?1:0,b=b+h>>>0,l+=b<h?1:0;var d=t+n+c+u+l;return d>>>0}utils$h.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(t,e,n,a,c,o,u,h){var l=e+a+o+h;return l>>>0}utils$h.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(t,e,n,a,c,o,u,h,l,b){var d=0,p=e;p=p+a>>>0,d+=p<e?1:0,p=p+o>>>0,d+=p<o?1:0,p=p+h>>>0,d+=p<h?1:0,p=p+b>>>0,d+=p<b?1:0;var x=t+n+c+u+l+d;return x>>>0}utils$h.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(t,e,n,a,c,o,u,h,l,b){var d=e+a+o+h+b;return d>>>0}utils$h.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(t,e,n){var a=e<<32-n|t>>>n;return a>>>0}utils$h.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(t,e,n){var a=t<<32-n|e>>>n;return a>>>0}utils$h.rotr64_lo=rotr64_lo$1;function shr64_hi$1(t,e,n){return t>>>n}utils$h.shr64_hi=shr64_hi$1;function shr64_lo$1(t,e,n){var a=t<<32-n|e>>>n;return a>>>0}utils$h.shr64_lo=shr64_lo$1;var common$5={},utils$g=utils$h,assert$9=minimalisticAssert;function BlockHash$4(){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}common$5.BlockHash=BlockHash$4,BlockHash$4.prototype.update=function t(e,n){if(e=utils$g.toArray(e,n),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var a=e.length%this._delta8;this.pending=e.slice(e.length-a,e.length),this.pending.length===0&&(this.pending=null),e=utils$g.join32(e,0,e.length-a,this.endian);for(var c=0;c<e.length;c+=this._delta32)this._update(e,c,c+this._delta32)}return this},BlockHash$4.prototype.digest=function t(e){return this.update(this._pad()),assert$9(this.pending===null),this._digest(e)},BlockHash$4.prototype._pad=function t(){var e=this.pendingTotal,n=this._delta8,a=n-(e+this.padLength)%n,c=new Array(a+this.padLength);c[0]=128;for(var o=1;o<a;o++)c[o]=0;if(e<<=3,this.endian==="big"){for(var u=8;u<this.padLength;u++)c[o++]=0;c[o++]=0,c[o++]=0,c[o++]=0,c[o++]=0,c[o++]=e>>>24&255,c[o++]=e>>>16&255,c[o++]=e>>>8&255,c[o++]=e&255}else for(c[o++]=e&255,c[o++]=e>>>8&255,c[o++]=e>>>16&255,c[o++]=e>>>24&255,c[o++]=0,c[o++]=0,c[o++]=0,c[o++]=0,u=8;u<this.padLength;u++)c[o++]=0;return c};var sha={},common$4={},utils$f=utils$h,rotr32=utils$f.rotr32;function ft_1$1(t,e,n,a){if(t===0)return ch32$1(e,n,a);if(t===1||t===3)return p32(e,n,a);if(t===2)return maj32$1(e,n,a)}common$4.ft_1=ft_1$1;function ch32$1(t,e,n){return t&e^~t&n}common$4.ch32=ch32$1;function maj32$1(t,e,n){return t&e^t&n^e&n}common$4.maj32=maj32$1;function p32(t,e,n){return t^e^n}common$4.p32=p32;function s0_256$1(t){return rotr32(t,2)^rotr32(t,13)^rotr32(t,22)}common$4.s0_256=s0_256$1;function s1_256$1(t){return rotr32(t,6)^rotr32(t,11)^rotr32(t,25)}common$4.s1_256=s1_256$1;function g0_256$1(t){return rotr32(t,7)^rotr32(t,18)^t>>>3}common$4.g0_256=g0_256$1;function g1_256$1(t){return rotr32(t,17)^rotr32(t,19)^t>>>10}common$4.g1_256=g1_256$1;var utils$e=utils$h,common$3=common$5,shaCommon$1=common$4,rotl32$1=utils$e.rotl32,sum32$2=utils$e.sum32,sum32_5$1=utils$e.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$3.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$e.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512,SHA1.outSize=160,SHA1.hmacStrength=80,SHA1.padLength=64,SHA1.prototype._update=function t(e,n){for(var a=this.W,c=0;c<16;c++)a[c]=e[n+c];for(;c<a.length;c++)a[c]=rotl32$1(a[c-3]^a[c-8]^a[c-14]^a[c-16],1);var o=this.h[0],u=this.h[1],h=this.h[2],l=this.h[3],b=this.h[4];for(c=0;c<a.length;c++){var d=~~(c/20),p=sum32_5$1(rotl32$1(o,5),ft_1(d,u,h,l),b,a[c],sha1_K[d]);b=l,l=h,h=rotl32$1(u,30),u=o,o=p}this.h[0]=sum32$2(this.h[0],o),this.h[1]=sum32$2(this.h[1],u),this.h[2]=sum32$2(this.h[2],h),this.h[3]=sum32$2(this.h[3],l),this.h[4]=sum32$2(this.h[4],b)},SHA1.prototype._digest=function t(e){return e==="hex"?utils$e.toHex32(this.h,"big"):utils$e.split32(this.h,"big")};var utils$d=utils$h,common$2=common$5,shaCommon=common$4,assert$8=minimalisticAssert,sum32$1=utils$d.sum32,sum32_4$1=utils$d.sum32_4,sum32_5=utils$d.sum32_5,ch32=shaCommon.ch32,maj32=shaCommon.maj32,s0_256=shaCommon.s0_256,s1_256=shaCommon.s1_256,g0_256=shaCommon.g0_256,g1_256=shaCommon.g1_256,BlockHash$2=common$2.BlockHash,sha256_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 SHA256$1(){if(!(this instanceof SHA256$1))return new SHA256$1;BlockHash$2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=sha256_K,this.W=new Array(64)}utils$d.inherits(SHA256$1,BlockHash$2);var _256=SHA256$1;SHA256$1.blockSize=512,SHA256$1.outSize=256,SHA256$1.hmacStrength=192,SHA256$1.padLength=64,SHA256$1.prototype._update=function t(e,n){for(var a=this.W,c=0;c<16;c++)a[c]=e[n+c];for(;c<a.length;c++)a[c]=sum32_4$1(g1_256(a[c-2]),a[c-7],g0_256(a[c-15]),a[c-16]);var o=this.h[0],u=this.h[1],h=this.h[2],l=this.h[3],b=this.h[4],d=this.h[5],p=this.h[6],x=this.h[7];for(assert$8(this.k.length===a.length),c=0;c<a.length;c++){var m=sum32_5(x,s1_256(b),ch32(b,d,p),this.k[c],a[c]),v=sum32$1(s0_256(o),maj32(o,u,h));x=p,p=d,d=b,b=sum32$1(l,m),l=h,h=u,u=o,o=sum32$1(m,v)}this.h[0]=sum32$1(this.h[0],o),this.h[1]=sum32$1(this.h[1],u),this.h[2]=sum32$1(this.h[2],h),this.h[3]=sum32$1(this.h[3],l),this.h[4]=sum32$1(this.h[4],b),this.h[5]=sum32$1(this.h[5],d),this.h[6]=sum32$1(this.h[6],p),this.h[7]=sum32$1(this.h[7],x)},SHA256$1.prototype._digest=function t(e){return e==="hex"?utils$d.toHex32(this.h,"big"):utils$d.split32(this.h,"big")};var utils$c=utils$h,SHA256=_256;function SHA224(){if(!(this instanceof SHA224))return new SHA224;SHA256.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}utils$c.inherits(SHA224,SHA256);var _224=SHA224;SHA224.blockSize=512,SHA224.outSize=224,SHA224.hmacStrength=192,SHA224.padLength=64,SHA224.prototype._digest=function t(e){return e==="hex"?utils$c.toHex32(this.h.slice(0,7),"big"):utils$c.split32(this.h.slice(0,7),"big")};var utils$b=utils$h,common$1=common$5,assert$7=minimalisticAssert,rotr64_hi=utils$b.rotr64_hi,rotr64_lo=utils$b.rotr64_lo,shr64_hi=utils$b.shr64_hi,shr64_lo=utils$b.shr64_lo,sum64=utils$b.sum64,sum64_hi=utils$b.sum64_hi,sum64_lo=utils$b.sum64_lo,sum64_4_hi=utils$b.sum64_4_hi,sum64_4_lo=utils$b.sum64_4_lo,sum64_5_hi=utils$b.sum64_5_hi,sum64_5_lo=utils$b.sum64_5_lo,BlockHash$1=common$1.BlockHash,sha512_K=[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 SHA512$1(){if(!(this instanceof SHA512$1))return new SHA512$1;BlockHash$1.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sha512_K,this.W=new Array(160)}utils$b.inherits(SHA512$1,BlockHash$1);var _512=SHA512$1;SHA512$1.blockSize=1024,SHA512$1.outSize=512,SHA512$1.hmacStrength=192,SHA512$1.padLength=128,SHA512$1.prototype._prepareBlock=function t(e,n){for(var a=this.W,c=0;c<32;c++)a[c]=e[n+c];for(;c<a.length;c+=2){var o=g1_512_hi(a[c-4],a[c-3]),u=g1_512_lo(a[c-4],a[c-3]),h=a[c-14],l=a[c-13],b=g0_512_hi(a[c-30],a[c-29]),d=g0_512_lo(a[c-30],a[c-29]),p=a[c-32],x=a[c-31];a[c]=sum64_4_hi(o,u,h,l,b,d,p,x),a[c+1]=sum64_4_lo(o,u,h,l,b,d,p,x)}},SHA512$1.prototype._update=function t(e,n){this._prepareBlock(e,n);var a=this.W,c=this.h[0],o=this.h[1],u=this.h[2],h=this.h[3],l=this.h[4],b=this.h[5],d=this.h[6],p=this.h[7],x=this.h[8],m=this.h[9],v=this.h[10],g=this.h[11],$=this.h[12],B=this.h[13],C=this.h[14],F=this.h[15];assert$7(this.k.length===a.length);for(var H=0;H<a.length;H+=2){var W=C,Z=F,ie=s1_512_hi(x,m),te=s1_512_lo(x,m),ae=ch64_hi(x,m,v,g,$),de=ch64_lo(x,m,v,g,$,B),J=this.k[H],R=this.k[H+1],A=a[H],y=a[H+1],w=sum64_5_hi(W,Z,ie,te,ae,de,J,R,A,y),I=sum64_5_lo(W,Z,ie,te,ae,de,J,R,A,y);W=s0_512_hi(c,o),Z=s0_512_lo(c,o),ie=maj64_hi(c,o,u,h,l),te=maj64_lo(c,o,u,h,l,b);var M=sum64_hi(W,Z,ie,te),k=sum64_lo(W,Z,ie,te);C=$,F=B,$=v,B=g,v=x,g=m,x=sum64_hi(d,p,w,I),m=sum64_lo(p,p,w,I),d=l,p=b,l=u,b=h,u=c,h=o,c=sum64_hi(w,I,M,k),o=sum64_lo(w,I,M,k)}sum64(this.h,0,c,o),sum64(this.h,2,u,h),sum64(this.h,4,l,b),sum64(this.h,6,d,p),sum64(this.h,8,x,m),sum64(this.h,10,v,g),sum64(this.h,12,$,B),sum64(this.h,14,C,F)},SHA512$1.prototype._digest=function t(e){return e==="hex"?utils$b.toHex32(this.h,"big"):utils$b.split32(this.h,"big")};function ch64_hi(t,e,n,a,c){var o=t&n^~t&c;return o<0&&(o+=4294967296),o}function ch64_lo(t,e,n,a,c,o){var u=e&a^~e&o;return u<0&&(u+=4294967296),u}function maj64_hi(t,e,n,a,c){var o=t&n^t&c^n&c;return o<0&&(o+=4294967296),o}function maj64_lo(t,e,n,a,c,o){var u=e&a^e&o^a&o;return u<0&&(u+=4294967296),u}function s0_512_hi(t,e){var n=rotr64_hi(t,e,28),a=rotr64_hi(e,t,2),c=rotr64_hi(e,t,7),o=n^a^c;return o<0&&(o+=4294967296),o}function s0_512_lo(t,e){var n=rotr64_lo(t,e,28),a=rotr64_lo(e,t,2),c=rotr64_lo(e,t,7),o=n^a^c;return o<0&&(o+=4294967296),o}function s1_512_hi(t,e){var n=rotr64_hi(t,e,14),a=rotr64_hi(t,e,18),c=rotr64_hi(e,t,9),o=n^a^c;return o<0&&(o+=4294967296),o}function s1_512_lo(t,e){var n=rotr64_lo(t,e,14),a=rotr64_lo(t,e,18),c=rotr64_lo(e,t,9),o=n^a^c;return o<0&&(o+=4294967296),o}function g0_512_hi(t,e){var n=rotr64_hi(t,e,1),a=rotr64_hi(t,e,8),c=shr64_hi(t,e,7),o=n^a^c;return o<0&&(o+=4294967296),o}function g0_512_lo(t,e){var n=rotr64_lo(t,e,1),a=rotr64_lo(t,e,8),c=shr64_lo(t,e,7),o=n^a^c;return o<0&&(o+=4294967296),o}function g1_512_hi(t,e){var n=rotr64_hi(t,e,19),a=rotr64_hi(e,t,29),c=shr64_hi(t,e,6),o=n^a^c;return o<0&&(o+=4294967296),o}function g1_512_lo(t,e){var n=rotr64_lo(t,e,19),a=rotr64_lo(e,t,29),c=shr64_lo(t,e,6),o=n^a^c;return o<0&&(o+=4294967296),o}var utils$a=utils$h,SHA512=_512;function SHA384(){if(!(this instanceof SHA384))return new SHA384;SHA512.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}utils$a.inherits(SHA384,SHA512);var _384=SHA384;SHA384.blockSize=1024,SHA384.outSize=384,SHA384.hmacStrength=192,SHA384.padLength=128,SHA384.prototype._digest=function t(e){return e==="hex"?utils$a.toHex32(this.h.slice(0,12),"big"):utils$a.split32(this.h.slice(0,12),"big")},sha.sha1=_1,sha.sha224=_224,sha.sha256=_256,sha.sha384=_384,sha.sha512=_512;var ripemd={},utils$9=utils$h,common=common$5,rotl32=utils$9.rotl32,sum32=utils$9.sum32,sum32_3=utils$9.sum32_3,sum32_4=utils$9.sum32_4,BlockHash=common.BlockHash;function RIPEMD160(){if(!(this instanceof RIPEMD160))return new RIPEMD160;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}utils$9.inherits(RIPEMD160,BlockHash),ripemd.ripemd160=RIPEMD160,RIPEMD160.blockSize=512,RIPEMD160.outSize=160,RIPEMD160.hmacStrength=192,RIPEMD160.padLength=64,RIPEMD160.prototype._update=function t(e,n){for(var a=this.h[0],c=this.h[1],o=this.h[2],u=this.h[3],h=this.h[4],l=a,b=c,d=o,p=u,x=h,m=0;m<80;m++){var v=sum32(rotl32(sum32_4(a,f(m,c,o,u),e[r[m]+n],K(m)),s[m]),h);a=h,h=u,u=rotl32(o,10),o=c,c=v,v=sum32(rotl32(sum32_4(l,f(79-m,b,d,p),e[rh[m]+n],Kh(m)),sh[m]),x),l=x,x=p,p=rotl32(d,10),d=b,b=v}v=sum32_3(this.h[1],o,p),this.h[1]=sum32_3(this.h[2],u,x),this.h[2]=sum32_3(this.h[3],h,l),this.h[3]=sum32_3(this.h[4],a,b),this.h[4]=sum32_3(this.h[0],c,d),this.h[0]=v},RIPEMD160.prototype._digest=function t(e){return e==="hex"?utils$9.toHex32(this.h,"little"):utils$9.split32(this.h,"little")};function f(t,e,n,a){return t<=15?e^n^a:t<=31?e&n|~e&a:t<=47?(e|~n)^a:t<=63?e&a|n&~a:e^(n|~a)}function K(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Kh(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var r=[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],rh=[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],s=[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],sh=[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],utils$8=utils$h,assert$6=minimalisticAssert;function Hmac(t,e,n){if(!(this instanceof Hmac))return new Hmac(t,e,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(utils$8.toArray(e,n))}var hmac=Hmac;Hmac.prototype._init=function t(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),assert$6(e.length<=this.blockSize);for(var n=e.length;n<this.blockSize;n++)e.push(0);for(n=0;n<e.length;n++)e[n]^=54;for(this.inner=new this.Hash().update(e),n=0;n<e.length;n++)e[n]^=106;this.outer=new this.Hash().update(e)},Hmac.prototype.update=function t(e,n){return this.inner.update(e,n),this},Hmac.prototype.digest=function t(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(t){var e=t;e.utils=utils$h,e.common=common$5,e.sha=sha,e.ripemd=ripemd,e.hmac=hmac,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(hash$2);var secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={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"]]}}),secp256k1}(function(t){var e=t,n=hash$2,a=curve,c=utils$o,o=c.assert;function u(b){b.type==="short"?this.curve=new a.short(b):b.type==="edwards"?this.curve=new a.edwards(b):this.curve=new a.mont(b),this.g=this.curve.g,this.n=this.curve.n,this.hash=b.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=u;function h(b,d){Object.defineProperty(e,b,{configurable:!0,enumerable:!0,get:function(){var p=new u(d);return Object.defineProperty(e,b,{configurable:!0,enumerable:!0,value:p}),p}})}h("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:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("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:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("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:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("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:n.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"]}),h("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:n.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"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),h("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:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var l;try{l=requireSecp256k1()}catch{l=void 0}h("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:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",l]})})(curves$1);var hash$1=hash$2,utils$7=utils$n,assert$5=minimalisticAssert;function HmacDRBG(t){if(!(this instanceof HmacDRBG))return new HmacDRBG(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=utils$7.toArray(t.entropy,t.entropyEnc||"hex"),n=utils$7.toArray(t.nonce,t.nonceEnc||"hex"),a=utils$7.toArray(t.pers,t.persEnc||"hex");assert$5(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,a)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function t(e,n,a){var c=e.concat(n).concat(a);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(c),this._reseed=1,this.reseedInterval=281474976710656},HmacDRBG.prototype._hmac=function t(){return new hash$1.hmac(this.hash,this.K)},HmacDRBG.prototype._update=function t(e){var n=this._hmac().update(this.V).update([0]);e&&(n=n.update(e)),this.K=n.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},HmacDRBG.prototype.reseed=function t(e,n,a,c){typeof n!="string"&&(c=a,a=n,n=null),e=utils$7.toArray(e,n),a=utils$7.toArray(a,c),assert$5(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(a||[])),this._reseed=1},HmacDRBG.prototype.generate=function t(e,n,a,c){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof n!="string"&&(c=a,a=n,n=null),a&&(a=utils$7.toArray(a,c||"hex"),this._update(a));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var u=o.slice(0,e);return this._update(a),this._reseed++,utils$7.encode(u,n)};var BN$2=bnExports,utils$6=utils$o,assert$4=utils$6.assert;function KeyPair$2(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var key$1=KeyPair$2;KeyPair$2.fromPublic=function t(e,n,a){return n instanceof KeyPair$2?n:new KeyPair$2(e,{pub:n,pubEnc:a})},KeyPair$2.fromPrivate=function t(e,n,a){return n instanceof KeyPair$2?n:new KeyPair$2(e,{priv:n,privEnc:a})},KeyPair$2.prototype.validate=function t(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair$2.prototype.getPublic=function t(e,n){return typeof e=="string"&&(n=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),n?this.pub.encode(n,e):this.pub},KeyPair$2.prototype.getPrivate=function t(e){return e==="hex"?this.priv.toString(16,2):this.priv},KeyPair$2.prototype._importPrivate=function t(e,n){this.priv=new BN$2(e,n||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair$2.prototype._importPublic=function t(e,n){if(e.x||e.y){this.ec.curve.type==="mont"?assert$4(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$4(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,n)},KeyPair$2.prototype.derive=function t(e){return e.validate()||assert$4(e.validate(),"public point not validated"),e.mul(this.priv).getX()},KeyPair$2.prototype.sign=function t(e,n,a){return this.ec.sign(e,this,n,a)},KeyPair$2.prototype.verify=function t(e,n){return this.ec.verify(e,n,this)},KeyPair$2.prototype.inspect=function t(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var BN$1=bnExports,utils$5=utils$o,assert$3=utils$5.assert;function Signature$2(t,e){if(t instanceof Signature$2)return t;this._importDER(t,e)||(assert$3(t.r&&t.s,"Signature without r or s"),this.r=new BN$1(t.r,16),this.s=new BN$1(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var signature$1=Signature$2;function Position(){this.place=0}function getLength(t,e){var n=t[e.place++];if(!(n&128))return n;var a=n&15;if(a===0||a>4||t[e.place]===0)return!1;for(var c=0,o=0,u=e.place;o<a;o++,u++)c<<=8,c|=t[u],c>>>=0;return c<=127?!1:(e.place=u,c)}function rmPadding(t){for(var e=0,n=t.length-1;!t[e]&&!(t[e+1]&128)&&e<n;)e++;return e===0?t:t.slice(e)}Signature$2.prototype._importDER=function t(e,n){e=utils$5.toArray(e,n);var a=new Position;if(e[a.place++]!==48)return!1;var c=getLength(e,a);if(c===!1||c+a.place!==e.length||e[a.place++]!==2)return!1;var o=getLength(e,a);if(o===!1||e[a.place]&128)return!1;var u=e.slice(a.place,o+a.place);if(a.place+=o,e[a.place++]!==2)return!1;var h=getLength(e,a);if(h===!1||e.length!==h+a.place||e[a.place]&128)return!1;var l=e.slice(a.place,h+a.place);if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;return this.r=new BN$1(u),this.s=new BN$1(l),this.recoveryParam=null,!0};function constructLength(t,e){if(e<128){t.push(e);return}var n=1+(Math.log(e)/Math.LN2>>>3);for(t.push(n|128);--n;)t.push(e>>>(n<<3)&255);t.push(e)}Signature$2.prototype.toDER=function t(e){var n=this.r.toArray(),a=this.s.toArray();for(n[0]&128&&(n=[0].concat(n)),a[0]&128&&(a=[0].concat(a)),n=rmPadding(n),a=rmPadding(a);!a[0]&&!(a[1]&128);)a=a.slice(1);var c=[2];constructLength(c,n.length),c=c.concat(n),c.push(2),constructLength(c,a.length);var o=c.concat(a),u=[48];return constructLength(u,o.length),u=u.concat(o),utils$5.encode(u,e)};var ec$1,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec$1;hasRequiredEc=1;var t=bnExports,e=hmacDrbg,n=utils$o,a=curves$1,c=requireBrorand(),o=n.assert,u=key$1,h=signature$1;function l(b){if(!(this instanceof l))return new l(b);typeof b=="string"&&(o(Object.prototype.hasOwnProperty.call(a,b),"Unknown curve "+b),b=a[b]),b instanceof a.PresetCurve&&(b={curve:b}),this.curve=b.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=b.curve.g,this.g.precompute(b.curve.n.bitLength()+1),this.hash=b.hash||b.curve.hash}return ec$1=l,l.prototype.keyPair=function(d){return new u(this,d)},l.prototype.keyFromPrivate=function(d,p){return u.fromPrivate(this,d,p)},l.prototype.keyFromPublic=function(d,p){return u.fromPublic(this,d,p)},l.prototype.genKeyPair=function(d){d||(d={});for(var p=new e({hash:this.hash,pers:d.pers,persEnc:d.persEnc||"utf8",entropy:d.entropy||c(this.hash.hmacStrength),entropyEnc:d.entropy&&d.entropyEnc||"utf8",nonce:this.n.toArray()}),x=this.n.byteLength(),m=this.n.sub(new t(2));;){var v=new t(p.generate(x));if(!(v.cmp(m)>0))return v.iaddn(1),this.keyFromPrivate(v)}},l.prototype._truncateToN=function(d,p){var x=d.byteLength()*8-this.n.bitLength();return x>0&&(d=d.ushrn(x)),!p&&d.cmp(this.n)>=0?d.sub(this.n):d},l.prototype.sign=function(d,p,x,m){typeof x=="object"&&(m=x,x=null),m||(m={}),p=this.keyFromPrivate(p,x),d=this._truncateToN(new t(d,16));for(var v=this.n.byteLength(),g=p.getPrivate().toArray("be",v),$=d.toArray("be",v),B=new e({hash:this.hash,entropy:g,nonce:$,pers:m.pers,persEnc:m.persEnc||"utf8"}),C=this.n.sub(new t(1)),F=0;;F++){var H=m.k?m.k(F):new t(B.generate(this.n.byteLength()));if(H=this._truncateToN(H,!0),!(H.cmpn(1)<=0||H.cmp(C)>=0)){var W=this.g.mul(H);if(!W.isInfinity()){var Z=W.getX(),ie=Z.umod(this.n);if(ie.cmpn(0)!==0){var te=H.invm(this.n).mul(ie.mul(p.getPrivate()).iadd(d));if(te=te.umod(this.n),te.cmpn(0)!==0){var ae=(W.getY().isOdd()?1:0)|(Z.cmp(ie)!==0?2:0);return m.canonical&&te.cmp(this.nh)>0&&(te=this.n.sub(te),ae^=1),new h({r:ie,s:te,recoveryParam:ae})}}}}}},l.prototype.verify=function(d,p,x,m){d=this._truncateToN(new t(d,16)),x=this.keyFromPublic(x,m),p=new h(p,"hex");var v=p.r,g=p.s;if(v.cmpn(1)<0||v.cmp(this.n)>=0||g.cmpn(1)<0||g.cmp(this.n)>=0)return!1;var $=g.invm(this.n),B=$.mul(d).umod(this.n),C=$.mul(v).umod(this.n),F;return this.curve._maxwellTrick?(F=this.g.jmulAdd(B,x.getPublic(),C),F.isInfinity()?!1:F.eqXToP(v)):(F=this.g.mulAdd(B,x.getPublic(),C),F.isInfinity()?!1:F.getX().umod(this.n).cmp(v)===0)},l.prototype.recoverPubKey=function(b,d,p,x){o((3&p)===p,"The recovery param is more than two bits"),d=new h(d,x);var m=this.n,v=new t(b),g=d.r,$=d.s,B=p&1,C=p>>1;if(g.cmp(this.curve.p.umod(this.curve.n))>=0&&C)throw new Error("Unable to find sencond key candinate");C?g=this.curve.pointFromX(g.add(this.curve.n),B):g=this.curve.pointFromX(g,B);var F=d.r.invm(m),H=m.sub(v).mul(F).umod(m),W=$.mul(F).umod(m);return this.g.mulAdd(H,g,W)},l.prototype.getKeyRecoveryParam=function(b,d,p,x){if(d=new h(d,x),d.recoveryParam!==null)return d.recoveryParam;for(var m=0;m<4;m++){var v;try{v=this.recoverPubKey(b,d,m)}catch{continue}if(v.eq(p))return m}throw new Error("Unable to find valid recovery factor")},ec$1}var utils$4=utils$o,assert$2=utils$4.assert,parseBytes$2=utils$4.parseBytes,cachedProperty$1=utils$4.cachedProperty;function KeyPair$1(t,e){this.eddsa=t,this._secret=parseBytes$2(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=parseBytes$2(e.pub)}KeyPair$1.fromPublic=function t(e,n){return n instanceof KeyPair$1?n:new KeyPair$1(e,{pub:n})},KeyPair$1.fromSecret=function t(e,n){return n instanceof KeyPair$1?n:new KeyPair$1(e,{secret:n})},KeyPair$1.prototype.secret=function t(){return this._secret},cachedProperty$1(KeyPair$1,"pubBytes",function t(){return this.eddsa.encodePoint(this.pub())}),cachedProperty$1(KeyPair$1,"pub",function t(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),cachedProperty$1(KeyPair$1,"privBytes",function t(){var e=this.eddsa,n=this.hash(),a=e.encodingLength-1,c=n.slice(0,e.encodingLength);return c[0]&=248,c[a]&=127,c[a]|=64,c}),cachedProperty$1(KeyPair$1,"priv",function t(){return this.eddsa.decodeInt(this.privBytes())}),cachedProperty$1(KeyPair$1,"hash",function t(){return this.eddsa.hash().update(this.secret()).digest()}),cachedProperty$1(KeyPair$1,"messagePrefix",function t(){return this.hash().slice(this.eddsa.encodingLength)}),KeyPair$1.prototype.sign=function t(e){return assert$2(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},KeyPair$1.prototype.verify=function t(e,n){return this.eddsa.verify(e,n,this)},KeyPair$1.prototype.getSecret=function t(e){return assert$2(this._secret,"KeyPair is public only"),utils$4.encode(this.secret(),e)},KeyPair$1.prototype.getPublic=function t(e){return utils$4.encode(this.pubBytes(),e)};var key=KeyPair$1,BN=bnExports,utils$3=utils$o,assert$1=utils$3.assert,cachedProperty=utils$3.cachedProperty,parseBytes$1=utils$3.parseBytes;function Signature$1(t,e){this.eddsa=t,typeof e!="object"&&(e=parseBytes$1(e)),Array.isArray(e)&&(assert$1(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),assert$1(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof BN&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}cachedProperty(Signature$1,"S",function t(){return this.eddsa.decodeInt(this.Sencoded())}),cachedProperty(Signature$1,"R",function t(){return this.eddsa.decodePoint(this.Rencoded())}),cachedProperty(Signature$1,"Rencoded",function t(){return this.eddsa.encodePoint(this.R())}),cachedProperty(Signature$1,"Sencoded",function t(){return this.eddsa.encodeInt(this.S())}),Signature$1.prototype.toBytes=function t(){return this.Rencoded().concat(this.Sencoded())},Signature$1.prototype.toHex=function t(){return utils$3.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$1,hash=hash$2,curves=curves$1,utils$2=utils$o,assert=utils$2.assert,parseBytes=utils$2.parseBytes,KeyPair=key,Signature=signature;function EDDSA(t){if(assert(t==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(t);t=curves[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=hash.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function t(e,n){e=parseBytes(e);var a=this.keyFromSecret(n),c=this.hashInt(a.messagePrefix(),e),o=this.g.mul(c),u=this.encodePoint(o),h=this.hashInt(u,a.pubBytes(),e).mul(a.priv()),l=c.add(h).umod(this.curve.n);return this.makeSignature({R:o,S:l,Rencoded:u})},EDDSA.prototype.verify=function t(e,n,a){if(e=parseBytes(e),n=this.makeSignature(n),n.S().gte(n.eddsa.curve.n)||n.S().isNeg())return!1;var c=this.keyFromPublic(a),o=this.hashInt(n.Rencoded(),c.pubBytes(),e),u=this.g.mul(n.S()),h=n.R().add(c.pub().mul(o));return h.eq(u)},EDDSA.prototype.hashInt=function t(){for(var e=this.hash(),n=0;n<arguments.length;n++)e.update(arguments[n]);return utils$2.intFromLE(e.digest()).umod(this.curve.n)},EDDSA.prototype.keyFromPublic=function t(e){return KeyPair.fromPublic(this,e)},EDDSA.prototype.keyFromSecret=function t(e){return KeyPair.fromSecret(this,e)},EDDSA.prototype.makeSignature=function t(e){return e instanceof Signature?e:new Signature(this,e)},EDDSA.prototype.encodePoint=function t(e){var n=e.getY().toArray("le",this.encodingLength);return n[this.encodingLength-1]|=e.getX().isOdd()?128:0,n},EDDSA.prototype.decodePoint=function t(e){e=utils$2.parseBytes(e);var n=e.length-1,a=e.slice(0,n).concat(e[n]&-129),c=(e[n]&128)!==0,o=utils$2.intFromLE(a);return this.curve.pointFromY(o,c)},EDDSA.prototype.encodeInt=function t(e){return e.toArray("le",this.encodingLength)},EDDSA.prototype.decodeInt=function t(e){return utils$2.intFromLE(e)},EDDSA.prototype.isPoint=function t(e){return e instanceof this.pointClass};var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,function(t){var e=t;e.version=require$$0.version,e.utils=utils$o,e.rand=requireBrorand(),e.curve=curve,e.curves=curves$1,e.ec=requireEc(),e.eddsa=eddsa}(elliptic)),elliptic}var ellipticExports=requireElliptic();const pkg=getDefaultExportFromCjs$1(ellipticExports),{ec}=pkg,UNCOMPRESSED_RECOVERY_ID=27,keccak256Hash=distExports.Utils.keccak256Hash;function getConsensualPrivateKey(t){return isBytes(t,32)?t:isHexString(t)&&t.length===64?hexToBytes(t):keccak256Hash(t)}function isPostageBatchId(t){return isHexString(t)&&t.length===64}function isPostageStamp(t){return isHexString(t)&&t.length===226}function publicKeyToAddress(t){return keccak256Hash(t.slice(1)).slice(12)}function hashWithEthereumPrefix(t){const e=`Ethereum Signed Message:
|
|
25
|
-
${t.length}`,n=new TextEncoder().encode(e);return keccak256Hash(n,t)}function defaultSign(t,e){const n=new ec("secp256k1"),a=n.keyFromPrivate(e),c=hashWithEthereumPrefix(t),o=n.sign(c,a,{canonical:!0,pers:void 0});if(o.recoveryParam===null)throw new Error("signDigest recovery param was null");return new Uint8Array([...o.r.toArray("be",32),...o.s.toArray("be",32),o.recoveryParam+UNCOMPRESSED_RECOVERY_ID])}function makePrivateKeySigner(t){const n=new ec("secp256k1").keyFromPrivate(t),a=publicKeyToAddress(n.getPublic().encode("array",!1));return{sign:c=>defaultSign(c,t),address:a}}function isObject$1(t){return t!==null&&typeof t=="object"}function isStrictlyObject(t){return isObject$1(t)&&!Array.isArray(t)}function assertSignerFn(t){if(!isStrictlyObject(t))throw new TypeError("Signer must be an object!");const e=t;if(!isBytes(e.address,20))throw new TypeError("Signer's address must be Uint8Array with 20 bytes!");if(typeof e.sign!="function")throw new TypeError("Signer sign property needs to be function!")}function makeSigner(t){if(typeof t=="string"){const e=makeHexString(t,64),n=hexToBytes(e);return makePrivateKeySigner(n)}else if(t instanceof Uint8Array)return assertBytes(t,32),makePrivateKeySigner(t);return assertSignerFn(t),t}function inProximity(t,e,n){if(t.length!==e.length||t.length!==32)throw new Error("Lengths are incorrect at proximity check");let a=0,c=n;for(;c>0;)if(c>=8){if(t[a]!==e[a])return!1;a++,c-=8}else{const o=t[a]>>>8-c,u=e[a]>>>8-c;return o===u}return!0}function isBytes(t,e){return t instanceof Uint8Array&&t.length===e}function assertBytes(t,e){if(!isBytes(t,e))throw new TypeError(`Parameter is not valid Bytes of length: ${e} !== ${t.length}`)}function serializeBytes(...t){const e=t.reduce((c,o)=>c+o.length,0),n=new Uint8Array(e);let a=0;return t.forEach(c=>{n.set(c,a),a+=c.length}),n}function bytesToHex(t,e){const n=c=>c.toString(16).padStart(2,"0"),a=Array.from(t,n).join("");if(e&&a.length!==e)throw new TypeError(`Resulting HexString does not have expected length ${e}: ${a}`);return a}function intToHex(t,e){if(!Number.isInteger(t))throw new TypeError("the value provided is not integer");if(t>Number.MAX_SAFE_INTEGER)throw new TypeError("the value provided exceeds safe integer");if(t<0)throw new TypeError("the value provided is a negative integer");const n=t.toString(16);if(e&&n.length!==e)throw new TypeError(`Resulting HexString does not have expected length ${e}: ${n}`);return n}function hexToBytes(t){assertHexString(t);const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const a=t.substr(n*2,2);e[n]=parseInt(a,16)}return e}function isHexString(t,e){return typeof t=="string"&&/^[0-9a-f]+$/i.test(t)&&(!e||t.length===e)}function isPrefixedHexString(t){return typeof t=="string"&&/^0x[0-9a-f]+$/i.test(t)}function serializePayload(t){return new TextEncoder().encode(JSON.stringify(t))}function assertHexString(t,e,n="value"){if(!isHexString(t,e)){if(isPrefixedHexString(t))throw new TypeError(`${n} not valid non prefixed hex string (has 0x prefix): ${t}`);const a=e?` of length ${e}`:"";throw new TypeError(`${n} not valid hex string${a}: ${t}`)}}function makeHexString(t,e){if(typeof t=="number")return intToHex(t,e);if(t instanceof Uint8Array)return bytesToHex(t,e);if(typeof t=="string")if(isPrefixedHexString(t)){const n=t.slice(2);if(e&&n.length!==e)throw new TypeError(`Length mismatch for valid hex string. Expecting length ${e}: ${n}`);return n}else return assertHexString(t,e),t;throw new TypeError("Not HexString compatible type!")}function wrapBytesWithHelpers(t){return Object.assign(t,{text:()=>new TextDecoder("utf-8").decode(t),json:()=>JSON.parse(new TextDecoder("utf-8").decode(t)),hex:()=>bytesToHex(t)})}async function makeSingleOwnerChunk(t,e,n){const a=t.address(),c=distExports.Utils.keccak256Hash(e,a),o=await sign(n,c),u=serializeBytes(e,o,t.span(),t.payload),h=makeSOCAddress(e,n.address);return{...t,data:()=>u,identifier:()=>e,signature:()=>o,address:()=>h,owner:()=>n.address}}function makeSOCAddress(t,e){return distExports.Utils.keccak256Hash(t,e)}async function sign(t,e){const n=await t.sign(e);if(typeof n=="string"){const a=makeHexString(n);return hexToBytes(a)}if(n instanceof Uint8Array)return n;throw new TypeError("Invalid output of sign function!")}function bind(t,e){return function(){return t.apply(e,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,kindOf=(t=>e=>{const n=toString.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=t=>(t=t.toLowerCase(),e=>kindOf(e)===t),typeOfTest=t=>e=>typeof e===t,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(t){return t!==null&&!isUndefined(t)&&t.constructor!==null&&!isUndefined(t.constructor)&&isFunction(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&isArrayBuffer(t.buffer),e}const isString=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=t=>t!==null&&typeof t=="object",isBoolean=t=>t===!0||t===!1,isPlainObject=t=>{if(kindOf(t)!=="object")return!1;const e=getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=t=>isObject(t)&&isFunction(t.pipe),isFormData=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||isFunction(t.append)&&((e=kindOf(t))==="formdata"||e==="object"&&isFunction(t.toString)&&t.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let a,c;if(typeof t!="object"&&(t=[t]),isArray(t))for(a=0,c=t.length;a<c;a++)e.call(null,t[a],a,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),u=o.length;let h;for(a=0;a<u;a++)h=o[a],e.call(null,t[h],h,t)}}function findKey(t,e){e=e.toLowerCase();const n=Object.keys(t);let a=n.length,c;for(;a-- >0;)if(c=n[a],e===c.toLowerCase())return c;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$1,isContextDefined=t=>!isUndefined(t)&&t!==_global;function merge(){const{caseless:t}=isContextDefined(this)&&this||{},e={},n=(a,c)=>{const o=t&&findKey(e,c)||c;isPlainObject(e[o])&&isPlainObject(a)?e[o]=merge(e[o],a):isPlainObject(a)?e[o]=merge({},a):isArray(a)?e[o]=a.slice():e[o]=a};for(let a=0,c=arguments.length;a<c;a++)arguments[a]&&forEach(arguments[a],n);return e}const extend=(t,e,n,{allOwnKeys:a}={})=>(forEach(e,(c,o)=>{n&&isFunction(c)?t[o]=bind(c,n):t[o]=c},{allOwnKeys:a}),t),stripBOM=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),inherits=(t,e,n,a)=>{t.prototype=Object.create(e.prototype,a),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject=(t,e,n,a)=>{let c,o,u;const h={};if(e=e||{},t==null)return e;do{for(c=Object.getOwnPropertyNames(t),o=c.length;o-- >0;)u=c[o],(!a||a(u,t,e))&&!h[u]&&(e[u]=t[u],h[u]=!0);t=n!==!1&&getPrototypeOf(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},endsWith=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const a=t.indexOf(e,n);return a!==-1&&a===n},toArray=t=>{if(!t)return null;if(isArray(t))return t;let e=t.length;if(!isNumber(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},isTypedArray=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(t,e)=>{const a=(t&&t[Symbol.iterator]).call(t);let c;for(;(c=a.next())&&!c.done;){const o=c.value;e.call(t,o[0],o[1])}},matchAll=(t,e)=>{let n;const a=[];for(;(n=t.exec(e))!==null;)a.push(n);return a},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,c){return a.toUpperCase()+c}),hasOwnProperty=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),a={};forEach(n,(c,o)=>{let u;(u=e(c,o,t))!==!1&&(a[o]=u||c)}),Object.defineProperties(t,a)},freezeMethods=t=>{reduceDescriptors(t,(e,n)=>{if(isFunction(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=t[n];if(isFunction(a)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet=(t,e)=>{const n={},a=c=>{c.forEach(o=>{n[o]=!0})};return isArray(t)?a(t):a(String(t).split(e)),n},noop=()=>{},toFiniteNumber=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(t=16,e=ALPHABET.ALPHA_DIGIT)=>{let n="";const{length:a}=e;for(;t--;)n+=e[Math.random()*a|0];return n};function isSpecCompliantForm(t){return!!(t&&isFunction(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const toJSONObject=t=>{const e=new Array(10),n=(a,c)=>{if(isObject(a)){if(e.indexOf(a)>=0)return;if(!("toJSON"in a)){e[c]=a;const o=isArray(a)?[]:{};return forEach(a,(u,h)=>{const l=n(u,c+1);!isUndefined(l)&&(o[h]=l)}),e[c]=void 0,o}}return a};return n(t,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=t=>t&&(isObject(t)||isFunction(t))&&isFunction(t.then)&&isFunction(t.catch),_setImmediate=((t,e)=>t?setImmediate:e?((n,a)=>(_global.addEventListener("message",({source:c,data:o})=>{c===_global&&o===n&&a.length&&a.shift()()},!1),c=>{a.push(c),_global.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",isFunction(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process$1<"u"&&process$1.nextTick||_setImmediate,utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject,isPlainObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap};function AxiosError$1(t,e,n,a,c){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),a&&(this.request=a),c&&(this.response=c,this.status=c.status?c.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function t(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{descriptors[t]={value:t}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(t,e,n,a,c,o)=>{const u=Object.create(prototype$1);return utils$1.toFlatObject(t,u,function(l){return l!==Error.prototype},h=>h!=="isAxiosError"),AxiosError$1.call(u,t.message,e,n,a,c),u.cause=t,u.name=t.name,o&&Object.assign(u,o),u};const httpAdapter=null;function isVisitable(t){return utils$1.isPlainObject(t)||utils$1.isArray(t)}function removeBrackets(t){return utils$1.endsWith(t,"[]")?t.slice(0,-2):t}function renderKey(t,e,n){return t?t.concat(e).map(function(c,o){return c=removeBrackets(c),!n&&o?"["+c+"]":c}).join(n?".":""):e}function isFlatArray(t){return utils$1.isArray(t)&&!t.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function t(e){return/^is[A-Z]/.test(e)});function toFormData$1(t,e,n){if(!utils$1.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=utils$1.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,$){return!utils$1.isUndefined($[g])});const a=n.metaTokens,c=n.visitor||d,o=n.dots,u=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(e);if(!utils$1.isFunction(c))throw new TypeError("visitor must be a function");function b(v){if(v===null)return"";if(utils$1.isDate(v))return v.toISOString();if(!l&&utils$1.isBlob(v))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(v)||utils$1.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function d(v,g,$){let B=v;if(v&&!$&&typeof v=="object"){if(utils$1.endsWith(g,"{}"))g=a?g:g.slice(0,-2),v=JSON.stringify(v);else if(utils$1.isArray(v)&&isFlatArray(v)||(utils$1.isFileList(v)||utils$1.endsWith(g,"[]"))&&(B=utils$1.toArray(v)))return g=removeBrackets(g),B.forEach(function(F,H){!(utils$1.isUndefined(F)||F===null)&&e.append(u===!0?renderKey([g],H,o):u===null?g:g+"[]",b(F))}),!1}return isVisitable(v)?!0:(e.append(renderKey($,g,o),b(v)),!1)}const p=[],x=Object.assign(predicates,{defaultVisitor:d,convertValue:b,isVisitable});function m(v,g){if(!utils$1.isUndefined(v)){if(p.indexOf(v)!==-1)throw Error("Circular reference detected in "+g.join("."));p.push(v),utils$1.forEach(v,function(B,C){(!(utils$1.isUndefined(B)||B===null)&&c.call(e,B,utils$1.isString(C)?C.trim():C,g,x))===!0&&m(B,g?g.concat(C):[C])}),p.pop()}}if(!utils$1.isObject(t))throw new TypeError("data must be an object");return m(t),e}function encode$1(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(a){return e[a]})}function AxiosURLSearchParams(t,e){this._pairs=[],t&&toFormData$1(t,this,e)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function t(e,n){this._pairs.push([e,n])},prototype.toString=function t(e){const n=e?function(a){return e.call(this,a,encode$1)}:encode$1;return this._pairs.map(function(c){return n(c[0])+"="+n(c[1])},"").join("&")};function encode(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(t,e,n){if(!e)return t;const a=n&&n.encode||encode;utils$1.isFunction(n)&&(n={serialize:n});const c=n&&n.serialize;let o;if(c?o=c(e,n):o=utils$1.isURLSearchParams(e)?e.toString():new AxiosURLSearchParams(e,n).toString(a),o){const u=t.indexOf("#");u!==-1&&(t=t.slice(0,u)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class InterceptorManager{constructor(){this.handlers=[]}use(e,n,a){return this.handlers.push({fulfilled:e,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){utils$1.forEach(this.handlers,function(a){a!==null&&e(a)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(t,e){return toFormData$1(t,new platform.classes.URLSearchParams,Object.assign({visitor:function(n,a,c,o){return platform.isNode&&utils$1.isBuffer(n)?(this.append(a,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function parsePropPath(t){return utils$1.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function arrayToObject(t){const e={},n=Object.keys(t);let a;const c=n.length;let o;for(a=0;a<c;a++)o=n[a],e[o]=t[o];return e}function formDataToJSON(t){function e(n,a,c,o){let u=n[o++];if(u==="__proto__")return!0;const h=Number.isFinite(+u),l=o>=n.length;return u=!u&&utils$1.isArray(c)?c.length:u,l?(utils$1.hasOwnProp(c,u)?c[u]=[c[u],a]:c[u]=a,!h):((!c[u]||!utils$1.isObject(c[u]))&&(c[u]=[]),e(n,a,c[u],o)&&utils$1.isArray(c[u])&&(c[u]=arrayToObject(c[u])),!h)}if(utils$1.isFormData(t)&&utils$1.isFunction(t.entries)){const n={};return utils$1.forEachEntry(t,(a,c)=>{e(parsePropPath(a),c,n,0)}),n}return null}function stringifySafely(t,e,n){if(utils$1.isString(t))try{return(e||JSON.parse)(t),utils$1.trim(t)}catch(a){if(a.name!=="SyntaxError")throw a}return(0,JSON.stringify)(t)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function t(e,n){const a=n.getContentType()||"",c=a.indexOf("application/json")>-1,o=utils$1.isObject(e);if(o&&utils$1.isHTMLForm(e)&&(e=new FormData(e)),utils$1.isFormData(e))return c?JSON.stringify(formDataToJSON(e)):e;if(utils$1.isArrayBuffer(e)||utils$1.isBuffer(e)||utils$1.isStream(e)||utils$1.isFile(e)||utils$1.isBlob(e)||utils$1.isReadableStream(e))return e;if(utils$1.isArrayBufferView(e))return e.buffer;if(utils$1.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let h;if(o){if(a.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((h=utils$1.isFileList(e))||a.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return toFormData$1(h?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||c?(n.setContentType("application/json",!1),stringifySafely(e)):e}],transformResponse:[function t(e){const n=this.transitional||defaults.transitional,a=n&&n.forcedJSONParsing,c=this.responseType==="json";if(utils$1.isResponse(e)||utils$1.isReadableStream(e))return e;if(e&&utils$1.isString(e)&&(a&&!this.responseType||c)){const u=!(n&&n.silentJSONParsing)&&c;try{return JSON.parse(e)}catch(h){if(u)throw h.name==="SyntaxError"?AxiosError$1.from(h,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):h}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],t=>{defaults.headers[t]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=t=>{const e={};let n,a,c;return t&&t.split(`
|
|
26
|
-
`).forEach(function(u){c=u.indexOf(":"),n=u.substring(0,c).trim().toLowerCase(),a=u.substring(c+1).trim(),!(!n||e[n]&&ignoreDuplicateOf[n])&&(n==="set-cookie"?e[n]?e[n].push(a):e[n]=[a]:e[n]=e[n]?e[n]+", "+a:a)}),e},$internals=Symbol("internals");function normalizeHeader(t){return t&&String(t).trim().toLowerCase()}function normalizeValue(t){return t===!1||t==null?t:utils$1.isArray(t)?t.map(normalizeValue):String(t)}function parseTokens(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(t);)e[a[1]]=a[2];return e}const isValidHeaderName=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function matchHeaderValue(t,e,n,a,c){if(utils$1.isFunction(a))return a.call(this,e,n);if(c&&(e=n),!!utils$1.isString(e)){if(utils$1.isString(a))return e.indexOf(a)!==-1;if(utils$1.isRegExp(a))return a.test(e)}}function formatHeader(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,a)=>n.toUpperCase()+a)}function buildAccessors(t,e){const n=utils$1.toCamelCase(" "+e);["get","set","has"].forEach(a=>{Object.defineProperty(t,a+n,{value:function(c,o,u){return this[a].call(this,e,c,o,u)},configurable:!0})})}let AxiosHeaders$1=class{constructor(e){e&&this.set(e)}set(e,n,a){const c=this;function o(h,l,b){const d=normalizeHeader(l);if(!d)throw new Error("header name must be a non-empty string");const p=utils$1.findKey(c,d);(!p||c[p]===void 0||b===!0||b===void 0&&c[p]!==!1)&&(c[p||l]=normalizeValue(h))}const u=(h,l)=>utils$1.forEach(h,(b,d)=>o(b,d,l));if(utils$1.isPlainObject(e)||e instanceof this.constructor)u(e,n);else if(utils$1.isString(e)&&(e=e.trim())&&!isValidHeaderName(e))u(parseHeaders(e),n);else if(utils$1.isHeaders(e))for(const[h,l]of e.entries())o(l,h,a);else e!=null&&o(n,e,a);return this}get(e,n){if(e=normalizeHeader(e),e){const a=utils$1.findKey(this,e);if(a){const c=this[a];if(!n)return c;if(n===!0)return parseTokens(c);if(utils$1.isFunction(n))return n.call(this,c,a);if(utils$1.isRegExp(n))return n.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=normalizeHeader(e),e){const a=utils$1.findKey(this,e);return!!(a&&this[a]!==void 0&&(!n||matchHeaderValue(this,this[a],a,n)))}return!1}delete(e,n){const a=this;let c=!1;function o(u){if(u=normalizeHeader(u),u){const h=utils$1.findKey(a,u);h&&(!n||matchHeaderValue(a,a[h],h,n))&&(delete a[h],c=!0)}}return utils$1.isArray(e)?e.forEach(o):o(e),c}clear(e){const n=Object.keys(this);let a=n.length,c=!1;for(;a--;){const o=n[a];(!e||matchHeaderValue(this,this[o],o,e,!0))&&(delete this[o],c=!0)}return c}normalize(e){const n=this,a={};return utils$1.forEach(this,(c,o)=>{const u=utils$1.findKey(a,o);if(u){n[u]=normalizeValue(c),delete n[o];return}const h=e?formatHeader(o):String(o).trim();h!==o&&delete n[o],n[h]=normalizeValue(c),a[h]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return utils$1.forEach(this,(a,c)=>{a!=null&&a!==!1&&(n[c]=e&&utils$1.isArray(a)?a.join(", "):a)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
27
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const a=new this(e);return n.forEach(c=>a.set(c)),a}static accessor(e){const a=(this[$internals]=this[$internals]={accessors:{}}).accessors,c=this.prototype;function o(u){const h=normalizeHeader(u);a[h]||(buildAccessors(c,u),a[h]=!0)}return utils$1.isArray(e)?e.forEach(o):o(e),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(a){this[n]=a}}}),utils$1.freezeMethods(AxiosHeaders$1);function transformData(t,e){const n=this||defaults,a=e||n,c=AxiosHeaders$1.from(a.headers);let o=a.data;return utils$1.forEach(t,function(h){o=h.call(n,o,c.normalize(),e?e.status:void 0)}),c.normalize(),o}function isCancel$1(t){return!!(t&&t.__CANCEL__)}function CanceledError$1(t,e,n){AxiosError$1.call(this,t??"canceled",AxiosError$1.ERR_CANCELED,e,n),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(t,e,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?t(n):e(new AxiosError$1("Request failed with status code "+n.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function parseProtocol(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function speedometer(t,e){t=t||10;const n=new Array(t),a=new Array(t);let c=0,o=0,u;return e=e!==void 0?e:1e3,function(l){const b=Date.now(),d=a[o];u||(u=b),n[c]=l,a[c]=b;let p=o,x=0;for(;p!==c;)x+=n[p++],p=p%t;if(c=(c+1)%t,c===o&&(o=(o+1)%t),b-u<e)return;const m=d&&b-d;return m?Math.round(x*1e3/m):void 0}}function throttle(t,e){let n=0,a=1e3/e,c,o;const u=(b,d=Date.now())=>{n=d,c=null,o&&(clearTimeout(o),o=null),t.apply(null,b)};return[(...b)=>{const d=Date.now(),p=d-n;p>=a?u(b,d):(c=b,o||(o=setTimeout(()=>{o=null,u(c)},a-p)))},()=>c&&u(c)]}const progressEventReducer=(t,e,n=3)=>{let a=0;const c=speedometer(50,250);return throttle(o=>{const u=o.loaded,h=o.lengthComputable?o.total:void 0,l=u-a,b=c(l),d=u<=h;a=u;const p={loaded:u,total:h,progress:h?u/h:void 0,bytes:l,rate:b||void 0,estimated:b&&h&&d?(h-u)/b:void 0,event:o,lengthComputable:h!=null,[e?"download":"upload"]:!0};t(p)},n)},progressEventDecorator=(t,e)=>{const n=t!=null;return[a=>e[0]({lengthComputable:n,total:t,loaded:a}),e[1]]},asyncDecorator=t=>(...e)=>utils$1.asap(()=>t(...e)),isURLSameOrigin=platform.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,platform.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(t,e,n,a,c,o){const u=[t+"="+encodeURIComponent(e)];utils$1.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),utils$1.isString(a)&&u.push("path="+a),utils$1.isString(c)&&u.push("domain="+c),o===!0&&u.push("secure"),document.cookie=u.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function combineURLs(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function buildFullPath(t,e){return t&&!isAbsoluteURL(e)?combineURLs(t,e):e}const headersToObject=t=>t instanceof AxiosHeaders$1?{...t}:t;function mergeConfig$1(t,e){e=e||{};const n={};function a(b,d,p,x){return utils$1.isPlainObject(b)&&utils$1.isPlainObject(d)?utils$1.merge.call({caseless:x},b,d):utils$1.isPlainObject(d)?utils$1.merge({},d):utils$1.isArray(d)?d.slice():d}function c(b,d,p,x){if(utils$1.isUndefined(d)){if(!utils$1.isUndefined(b))return a(void 0,b,p,x)}else return a(b,d,p,x)}function o(b,d){if(!utils$1.isUndefined(d))return a(void 0,d)}function u(b,d){if(utils$1.isUndefined(d)){if(!utils$1.isUndefined(b))return a(void 0,b)}else return a(void 0,d)}function h(b,d,p){if(p in e)return a(b,d);if(p in t)return a(void 0,b)}const l={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:h,headers:(b,d,p)=>c(headersToObject(b),headersToObject(d),p,!0)};return utils$1.forEach(Object.keys(Object.assign({},t,e)),function(d){const p=l[d]||c,x=p(t[d],e[d],d);utils$1.isUndefined(x)&&p!==h||(n[d]=x)}),n}const resolveConfig=t=>{const e=mergeConfig$1({},t);let{data:n,withXSRFToken:a,xsrfHeaderName:c,xsrfCookieName:o,headers:u,auth:h}=e;e.headers=u=AxiosHeaders$1.from(u),e.url=buildURL(buildFullPath(e.baseURL,e.url),t.params,t.paramsSerializer),h&&u.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):"")));let l;if(utils$1.isFormData(n)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((l=u.getContentType())!==!1){const[b,...d]=l?l.split(";").map(p=>p.trim()).filter(Boolean):[];u.setContentType([b||"multipart/form-data",...d].join("; "))}}if(platform.hasStandardBrowserEnv&&(a&&utils$1.isFunction(a)&&(a=a(e)),a||a!==!1&&isURLSameOrigin(e.url))){const b=c&&o&&cookies.read(o);b&&u.set(c,b)}return e},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(t){return new Promise(function(n,a){const c=resolveConfig(t);let o=c.data;const u=AxiosHeaders$1.from(c.headers).normalize();let{responseType:h,onUploadProgress:l,onDownloadProgress:b}=c,d,p,x,m,v;function g(){m&&m(),v&&v(),c.cancelToken&&c.cancelToken.unsubscribe(d),c.signal&&c.signal.removeEventListener("abort",d)}let $=new XMLHttpRequest;$.open(c.method.toUpperCase(),c.url,!0),$.timeout=c.timeout;function B(){if(!$)return;const F=AxiosHeaders$1.from("getAllResponseHeaders"in $&&$.getAllResponseHeaders()),W={data:!h||h==="text"||h==="json"?$.responseText:$.response,status:$.status,statusText:$.statusText,headers:F,config:t,request:$};settle(function(ie){n(ie),g()},function(ie){a(ie),g()},W),$=null}"onloadend"in $?$.onloadend=B:$.onreadystatechange=function(){!$||$.readyState!==4||$.status===0&&!($.responseURL&&$.responseURL.indexOf("file:")===0)||setTimeout(B)},$.onabort=function(){$&&(a(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,t,$)),$=null)},$.onerror=function(){a(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,t,$)),$=null},$.ontimeout=function(){let H=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded";const W=c.transitional||transitionalDefaults;c.timeoutErrorMessage&&(H=c.timeoutErrorMessage),a(new AxiosError$1(H,W.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,t,$)),$=null},o===void 0&&u.setContentType(null),"setRequestHeader"in $&&utils$1.forEach(u.toJSON(),function(H,W){$.setRequestHeader(W,H)}),utils$1.isUndefined(c.withCredentials)||($.withCredentials=!!c.withCredentials),h&&h!=="json"&&($.responseType=c.responseType),b&&([x,v]=progressEventReducer(b,!0),$.addEventListener("progress",x)),l&&$.upload&&([p,m]=progressEventReducer(l),$.upload.addEventListener("progress",p),$.upload.addEventListener("loadend",m)),(c.cancelToken||c.signal)&&(d=F=>{$&&(a(!F||F.type?new CanceledError$1(null,t,$):F),$.abort(),$=null)},c.cancelToken&&c.cancelToken.subscribe(d),c.signal&&(c.signal.aborted?d():c.signal.addEventListener("abort",d)));const C=parseProtocol(c.url);if(C&&platform.protocols.indexOf(C)===-1){a(new AxiosError$1("Unsupported protocol "+C+":",AxiosError$1.ERR_BAD_REQUEST,t));return}$.send(o||null)})},composeSignals=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let a=new AbortController,c;const o=function(b){if(!c){c=!0,h();const d=b instanceof Error?b:this.reason;a.abort(d instanceof AxiosError$1?d:new CanceledError$1(d instanceof Error?d.message:d))}};let u=e&&setTimeout(()=>{u=null,o(new AxiosError$1(`timeout ${e} of ms exceeded`,AxiosError$1.ETIMEDOUT))},e);const h=()=>{t&&(u&&clearTimeout(u),u=null,t.forEach(b=>{b.unsubscribe?b.unsubscribe(o):b.removeEventListener("abort",o)}),t=null)};t.forEach(b=>b.addEventListener("abort",o));const{signal:l}=a;return l.unsubscribe=()=>utils$1.asap(h),l}},streamChunk=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let a=0,c;for(;a<n;)c=a+e,yield t.slice(a,c),a=c},readBytes=async function*(t,e){for await(const n of readStream(t))yield*streamChunk(n,e)},readStream=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:a}=await e.read();if(n)break;yield a}}finally{await e.cancel()}},trackStream=(t,e,n,a)=>{const c=readBytes(t,e);let o=0,u,h=l=>{u||(u=!0,a&&a(l))};return new ReadableStream({async pull(l){try{const{done:b,value:d}=await c.next();if(b){h(),l.close();return}let p=d.byteLength;if(n){let x=o+=p;n(x)}l.enqueue(new Uint8Array(d))}catch(b){throw h(b),b}},cancel(l){return h(l),c.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),test=(t,...e)=>{try{return!!t(...e)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let t=!1;const e=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(t=>t.body)};isFetchSupported&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!resolvers[e]&&(resolvers[e]=utils$1.isFunction(t[e])?n=>n[e]():(n,a)=>{throw new AxiosError$1(`Response type '${e}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,a)})})})(new Response);const getBodyLength=async t=>{if(t==null)return 0;if(utils$1.isBlob(t))return t.size;if(utils$1.isSpecCompliantForm(t))return(await new Request(platform.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(t)||utils$1.isArrayBuffer(t))return t.byteLength;if(utils$1.isURLSearchParams(t)&&(t=t+""),utils$1.isString(t))return(await encodeText(t)).byteLength},resolveBodyLength=async(t,e)=>{const n=utils$1.toFiniteNumber(t.getContentLength());return n??getBodyLength(e)},fetchAdapter=isFetchSupported&&(async t=>{let{url:e,method:n,data:a,signal:c,cancelToken:o,timeout:u,onDownloadProgress:h,onUploadProgress:l,responseType:b,headers:d,withCredentials:p="same-origin",fetchOptions:x}=resolveConfig(t);b=b?(b+"").toLowerCase():"text";let m=composeSignals([c,o&&o.toAbortSignal()],u),v;const g=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let $;try{if(l&&supportsRequestStream&&n!=="get"&&n!=="head"&&($=await resolveBodyLength(d,a))!==0){let W=new Request(e,{method:"POST",body:a,duplex:"half"}),Z;if(utils$1.isFormData(a)&&(Z=W.headers.get("content-type"))&&d.setContentType(Z),W.body){const[ie,te]=progressEventDecorator($,progressEventReducer(asyncDecorator(l)));a=trackStream(W.body,DEFAULT_CHUNK_SIZE,ie,te)}}utils$1.isString(p)||(p=p?"include":"omit");const B="credentials"in Request.prototype;v=new Request(e,{...x,signal:m,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:a,duplex:"half",credentials:B?p:void 0});let C=await fetch(v);const F=supportsResponseStream&&(b==="stream"||b==="response");if(supportsResponseStream&&(h||F&&g)){const W={};["status","statusText","headers"].forEach(ae=>{W[ae]=C[ae]});const Z=utils$1.toFiniteNumber(C.headers.get("content-length")),[ie,te]=h&&progressEventDecorator(Z,progressEventReducer(asyncDecorator(h),!0))||[];C=new Response(trackStream(C.body,DEFAULT_CHUNK_SIZE,ie,()=>{te&&te(),g&&g()}),W)}b=b||"text";let H=await resolvers[utils$1.findKey(resolvers,b)||"text"](C,t);return!F&&g&&g(),await new Promise((W,Z)=>{settle(W,Z,{data:H,headers:AxiosHeaders$1.from(C.headers),status:C.status,statusText:C.statusText,config:t,request:v})})}catch(B){throw g&&g(),B&&B.name==="TypeError"&&/fetch/i.test(B.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,t,v),{cause:B.cause||B}):AxiosError$1.from(B,B&&B.code,t,v)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const renderReason=t=>`- ${t}`,isResolvedHandle=t=>utils$1.isFunction(t)||t===null||t===!1,adapters={getAdapter:t=>{t=utils$1.isArray(t)?t:[t];const{length:e}=t;let n,a;const c={};for(let o=0;o<e;o++){n=t[o];let u;if(a=n,!isResolvedHandle(n)&&(a=knownAdapters[(u=String(n)).toLowerCase()],a===void 0))throw new AxiosError$1(`Unknown adapter '${u}'`);if(a)break;c[u||"#"+o]=a}if(!a){const o=Object.entries(c).map(([h,l])=>`adapter ${h} `+(l===!1?"is not supported by the environment":"is not available in the build"));let u=e?o.length>1?`since :
|
|
28
|
-
`+o.map(renderReason).join(`
|
|
29
|
-
`):" "+renderReason(o[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a},adapters:knownAdapters};function throwIfCancellationRequested(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new CanceledError$1(null,t)}function dispatchRequest(t){return throwIfCancellationRequested(t),t.headers=AxiosHeaders$1.from(t.headers),t.data=transformData.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(t.adapter||defaults.adapter)(t).then(function(a){return throwIfCancellationRequested(t),a.data=transformData.call(t,t.transformResponse,a),a.headers=AxiosHeaders$1.from(a.headers),a},function(a){return isCancel$1(a)||(throwIfCancellationRequested(t),a&&a.response&&(a.response.data=transformData.call(t,t.transformResponse,a.response),a.response.headers=AxiosHeaders$1.from(a.response.headers))),Promise.reject(a)})}const VERSION$1="1.7.9",validators$1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{validators$1[t]=function(a){return typeof a===t||"a"+(e<1?"n ":" ")+t}});const deprecatedWarnings={};validators$1.transitional=function t(e,n,a){function c(o,u){return"[Axios v"+VERSION$1+"] Transitional option '"+o+"'"+u+(a?". "+a:"")}return(o,u,h)=>{if(e===!1)throw new AxiosError$1(c(u," has been removed"+(n?" in "+n:"")),AxiosError$1.ERR_DEPRECATED);return n&&!deprecatedWarnings[u]&&(deprecatedWarnings[u]=!0,console.warn(c(u," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,u,h):!0}},validators$1.spelling=function t(e){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${e}`),!0)};function assertOptions(t,e,n){if(typeof t!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const a=Object.keys(t);let c=a.length;for(;c-- >0;){const o=a[c],u=e[o];if(u){const h=t[o],l=h===void 0||u(h,o,t);if(l!==!0)throw new AxiosError$1("option "+o+" must be "+l,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new AxiosError$1("Unknown option "+o,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,n){try{return await this._request(e,n)}catch(a){if(a instanceof Error){let c={};Error.captureStackTrace?Error.captureStackTrace(c):c=new Error;const o=c.stack?c.stack.replace(/^.+\n/,""):"";try{a.stack?o&&!String(a.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
30
|
-
`+o):a.stack=o}catch{}}throw a}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=mergeConfig$1(this.defaults,n);const{transitional:a,paramsSerializer:c,headers:o}=n;a!==void 0&&validator.assertOptions(a,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),c!=null&&(utils$1.isFunction(c)?n.paramsSerializer={serialize:c}:validator.assertOptions(c,{encode:validators.function,serialize:validators.function},!0)),validator.assertOptions(n,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=o&&utils$1.merge(o.common,o[n.method]);o&&utils$1.forEach(["delete","get","head","post","put","patch","common"],v=>{delete o[v]}),n.headers=AxiosHeaders$1.concat(u,o);const h=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,h.unshift(g.fulfilled,g.rejected))});const b=[];this.interceptors.response.forEach(function(g){b.push(g.fulfilled,g.rejected)});let d,p=0,x;if(!l){const v=[dispatchRequest.bind(this),void 0];for(v.unshift.apply(v,h),v.push.apply(v,b),x=v.length,d=Promise.resolve(n);p<x;)d=d.then(v[p++],v[p++]);return d}x=h.length;let m=n;for(p=0;p<x;){const v=h[p++],g=h[p++];try{m=v(m)}catch($){g.call(this,$);break}}try{d=dispatchRequest.call(this,m)}catch(v){return Promise.reject(v)}for(p=0,x=b.length;p<x;)d=d.then(b[p++],b[p++]);return d}getUri(e){e=mergeConfig$1(this.defaults,e);const n=buildFullPath(e.baseURL,e.url);return buildURL(n,e.params,e.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function t(e){Axios$1.prototype[e]=function(n,a){return this.request(mergeConfig$1(a||{},{method:e,url:n,data:(a||{}).data}))}}),utils$1.forEach(["post","put","patch"],function t(e){function n(a){return function(o,u,h){return this.request(mergeConfig$1(h||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:u}))}}Axios$1.prototype[e]=n(),Axios$1.prototype[e+"Form"]=n(!0)});let CancelToken$1=class Sr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const a=this;this.promise.then(c=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](c);a._listeners=null}),this.promise.then=c=>{let o;const u=new Promise(h=>{a.subscribe(h),o=h}).then(c);return u.cancel=function(){a.unsubscribe(o)},u},e(function(o,u,h){a.reason||(a.reason=new CanceledError$1(o,u,h),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=a=>{e.abort(a)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Sr(function(c){e=c}),cancel:e}}};function spread$1(t){return function(n){return t.apply(null,n)}}function isAxiosError$1(t){return utils$1.isObject(t)&&t.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([t,e])=>{HttpStatusCode$1[e]=t});function createInstance(t){const e=new Axios$1(t),n=bind(Axios$1.prototype.request,e);return utils$1.extend(n,Axios$1.prototype,e,{allOwnKeys:!0}),utils$1.extend(n,e,null,{allOwnKeys:!0}),n.create=function(c){return createInstance(mergeConfig$1(t,c))},n}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function t(e){return Promise.all(e)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=t=>formDataToJSON(utils$1.isHTMLForm(t)?new FormData(t):t),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;async function uploadSingleOwnerChunkData(t,e,n,a,c,o){const u=distExports.makeChunk(c),h=await makeSingleOwnerChunk(u,a,n),l=bytesToHex(h.owner()),b=bytesToHex(a),d=bytesToHex(h.signature()),p=serializeBytes(h.span(),h.payload);return await uploadSoc(t,l,b,d,p,e),h}function gsocSubscribe(t,e,n){if(assertSubscriptionHandler(n),typeof e!="string"||e.length!==64)throw new TypeError("soc address has to be an string and 32 bytes!");const a=webSocket(t,`gsoc/subscribe/${e}`);let c=!1;const o=()=>{c===!1&&(c=!0,a.terminate?a.terminate():a.close())};return a.onmessage=async u=>{const h=await prepareWebsocketData(u.data);h.length>0&&n.onMessage(wrapBytesWithHelpers(h))},a.onerror=u=>{c||n.onError(new BeeError(u.message))},o}async function uploadSoc(t,e,n,a,c,o,u){return(await http({...t,method:"post",url:`soc/${e}/${n}`,data:c,headers:{"content-type":"application/octet-stream",...extractUploadHeaders(o)},responseType:"json",params:{sig:a}})).data.reference}function assertSubscriptionHandler(t){if(!isStrictlyObject(t))throw new TypeError("SubscriptionHandler has to be object!");const e=t;if(typeof e.onMessage!="function")throw new TypeError("onMessage property of SubscriptionHandler has to be function!");if(typeof e.onError!="function")throw new TypeError("onError property of SubscriptionHandler has to be function!")}async function prepareWebsocketData(t){if(typeof t=="string")return new TextEncoder().encode(t);if(t instanceof Buffer)return new Uint8Array(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(t instanceof Blob)return new Uint8Array(await t.arrayBuffer());throw new TypeError("unknown websocket data type")}function webSocket(t,e){const n=t.replace(/^http/i,"ws");return new WebSocket$1(`${n}/${e}`)}function extractUploadHeaders(t,e){const n={};if(isPostageBatchId(t))n["swarm-postage-batch-id"]=t;else if(isPostageStamp(t))n["swarm-postage-stamp"]=t;else throw Error("Postage is invalid. Define either a postage batch id or a postage stamp (coming from envelope)");return n}async function http(t){var e;try{return t.headers||(t.headers={}),t.headers={...DEFAULT_HTTP_CONFIG.headers,...t.headers},await axios(t)}catch(n){throw n instanceof AxiosError?new BeeResponseError(n.message,n.code,n.status,(e=n.response)==null?void 0:e.status,n.config,n.response):n}}const DEFAULT_HTTP_CONFIG={headers:{accept:"application/json, text/plain, */*"},maxBodyLength:1/0,maxContentLength:1/0};class BeeError extends Error{constructor(e){super(e)}}class BeeResponseError extends BeeError{constructor(n,a,c,o,u,h){super(n);Ue(this,"code");Ue(this,"axiosStatus");Ue(this,"status");Ue(this,"config");Ue(this,"response");this.code=a,this.axiosStatus=c,this.status=o,this.config=u,this.response=h}}const DEFAULT_RESOURCE_ID="any",DEFAULT_POSTAGE_BATCH_ID="0000000000000000000000000000000000000000000000000000000000000000",DEFAULT_CONSENSUS_ID="SimpleGraffiti:v1";class InformationSignal{constructor(e,n){Ue(this,"postage");Ue(this,"beeApiUrl");Ue(this,"consensusHash");Ue(this,"assertGraffitiRecord");var a,c;if(assertBeeUrl(e),this.beeApiUrl=e,this.postage=(n==null?void 0:n.postage)??DEFAULT_POSTAGE_BATCH_ID,this.assertGraffitiRecord=((a=n==null?void 0:n.consensus)==null?void 0:a.assertRecord)??assertInformationSignalRecord,this.consensusHash=keccak256Hash(((c=n==null?void 0:n.consensus)==null?void 0:c.id)??DEFAULT_CONSENSUS_ID),!isHexString(this.postage))throw new Error("Postage batch id or postage stamp has to be a hex string!")}subscribe(e,n=DEFAULT_RESOURCE_ID){const a=getConsensualPrivateKey(n),c=makeSigner(a),o=makeSOCAddress(this.consensusHash,c.address),u={onMessage:l=>{try{const b=l.json();this.assertGraffitiRecord(b),e.onMessage(b)}catch(b){e.onError(b)}},onError:e.onError};return{close:gsocSubscribe(this.beeApiUrl,bytesToHex(o),u),gsocAddress:o}}listen(e,n=DEFAULT_RESOURCE_ID){return this.subscribe(e,n)}async write(e,n=DEFAULT_RESOURCE_ID,a){this.assertGraffitiRecord(e);const c=getConsensualPrivateKey(n),o=makeSigner(c);return uploadSingleOwnerChunkData({baseURL:this.beeApiUrl,...a},this.postage,o,this.consensusHash,serializePayload(e))}async send(e,n=DEFAULT_RESOURCE_ID){return this.write(e,n)}mineResourceId(e,n){if(isHexString(e)&&(e=hexToBytes(e)),typeof n!="number")throw new Error("storageDepth argument must be a number");if(n>32)throw new Error("Storage depth cannot be greater than 32!");if(e.length!==32)throw new Error("Bee address has to be 32 bytes!");const a=new Uint8Array(32);let c,o;do{for(let u=0;u<a.length;u++)if(a[u]===255)a[u]=0;else{a[u]++;break}c=makeSigner(a),o=makeSOCAddress(this.consensusHash,c.address)}while(!inProximity(e,o,n));return{resourceId:a,gsocAddress:o}}mine(e,n){return this.mineResourceId(e,n)}}function assertBeeUrl(t){if(!isValidBeeUrl(t))throw new Error("URL is not valid!")}function isValidBeeUrl(t){try{if(typeof t!="string")return!1;const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch(e){if(e instanceof TypeError||e.code!==null&&e.code==="ERR_INVALID_URL")return!1;throw e}}function isInformationSignalRecord(t){return t!==null&&typeof t=="string"}function assertInformationSignalRecord(t){if(!isInformationSignalRecord(t))throw new Error("Value is not a valid Graffiti Feed Record")}class SwarmChatUtils{constructor(e){this.UPLOAD_GSOC_TIMEOUT=2e3,this.handleError=e}generateUsersFeedId(e){return`${e}_EthercastChat_Users`}generateUserOwnedFeedId(e,n){return`${e}_EthercastChat_${n}`}initBees(e){var u;if(!e.singleBee&&!e.multiBees)throw new Error("No bees provided");const n={},a=h=>({bee:new beeJs.Bee(h.url),stamp:h.stamp,main:h.main}),c=h=>{if(!h)throw new Error("No bee configurations provided");return h.map(l=>({bee:new beeJs.Bee(l.url),stamp:l.stamp,main:l.main}))};if(e.singleBee){if(!e.singleBee.stamp)throw new Error("No postage stamp provided for the single bee");return{single:a(e.singleBee)}}const o=["gsoc","reader","writer"];for(const h of o){const l=(u=e.multiBees)==null?void 0:u[h];l&&(l.singleBee?n[h]=a(l.singleBee):l.multiBees&&(n[h]=c(l.multiBees)))}return n}selectBee(e,n,a){const c=e[n];if(!c)throw new Error(`No ${n} bees available`);if(Array.isArray(c)){if(a){const u=c.find(h=>h.main);if(u)return u}const o=c.filter(u=>!u.main);if(o.length>0){const u=Math.floor(Math.random()*o.length);return o[u]}throw new Error(`No non-main ${n} bees available`)}if(c.bee)return c;throw new Error(`No ${n} bees available`)}validateUserObject(e){try{if(typeof e.username!="string")throw"username should be a string";if(typeof e.address!="string")throw"address should be a string";if(typeof e.timestamp!="number")throw"timestamp should be number";if(typeof e.signature!="string")throw"signature should be a string";const n=["username","address","timestamp","signature","index"],a=Object.keys(e).filter(u=>!n.includes(u));if(a.length>0)throw`Unexpected properties found: ${a.join(", ")}`;const c={username:e.username,address:e.address,timestamp:e.timestamp};if(verifyMessage(JSON.stringify(c),e.signature)!==e.address)throw"Signature verification failed!";return!0}catch(n){return this.handleError({error:n,context:"This User object is not correct",throw:!1}),!1}}orderMessages(e){return e.sort((n,a)=>n.timestamp-a.timestamp)}async retryAwaitableAsync(e,n=3,a=250){return new Promise((c,o)=>{e().then(c).catch(u=>{n>0?(console.info(`Retrying... Attempts left: ${n}. Error: ${u.message}`),setTimeout(()=>{this.retryAwaitableAsync(e,n-1,a).then(c).catch(o)},a)):(this.handleError({error:u,context:`Failed after ${n} initial attempts. Last error: ${u.message}`,throw:!1}),o(u))})})}async uploadObjectToBee(e,n,a){try{return await e.uploadData(a,this.serializeGraffitiRecord(n),{redundancyLevel:4})}catch(c){return this.handleError({error:c,context:"uploadObjectToBee",throw:!1}),null}}graffitiFeedWriterFromTopic(e,n,a){const{consensusHash:c,graffitiSigner:o}=this.generateGraffitiFeedMetadata(n);return e.makeFeedWriter("sequence",c,o,a)}graffitiFeedReaderFromTopic(e,n,a){const{consensusHash:c,graffitiSigner:o}=this.generateGraffitiFeedMetadata(n);return e.makeFeedReader("sequence",c,o.address,a)}async getLatestFeedIndex(e,n,a){try{const o=await e.makeFeedReader("sequence",n,a).download(),u=parseInt(o.feedIndex.toString(),HEX_RADIX),h=parseInt(o.feedIndexNext,HEX_RADIX);return{latestIndex:u,nextIndex:h}}catch(c){if(this.isNotFoundError(c))return{latestIndex:-1,nextIndex:0};throw c}}subscribeToGsoc(e,n,a,c){try{if(!a)throw"ResourceID was not provided!";return new InformationSignal(e,{consensus:{id:`SwarmDecentralizedChat::${n}`,assertRecord:h=>{const l=JSON.parse(h);return this.validateUserObject(l)}}}).subscribe({onMessage:c,onError:console.log},a)}catch(o){return this.handleError({error:o,context:"subscribeToGSOC",throw:!0}),null}}async sendMessageToGsoc(e,n,a,c,o){try{if(!c)throw"ResourceID was not provided!";return await new InformationSignal(e,{consensus:{id:`SwarmDecentralizedChat::${a}`,assertRecord:l=>!0},postage:n}).write(o,c,{timeout:this.UPLOAD_GSOC_TIMEOUT})}catch(u){this.handleError({error:u,context:"sendMessageToGSOC",throw:!1})}}getConsensualPrivateKey(e){return beeJs.Utils.isHexString(e)&&e.length===64?beeJs.Utils.hexToBytes(e):beeJs.Utils.keccak256Hash(e)}getGraffitiWallet(e){const n=hexlify(e);return new Wallet(n)}serializeGraffitiRecord(e){return new TextEncoder().encode(JSON.stringify(e))}generateGraffitiFeedMetadata(e){const n=this.generateUsersFeedId(e),a=this.getConsensualPrivateKey(n),c=this.getGraffitiWallet(a),o={address:beeJs.Utils.hexToBytes(c.address.slice(2)),sign:async h=>await c.signMessage(h)};return{consensusHash:beeJs.Utils.keccak256Hash(CONSENSUS_ID),graffitiSigner:o}}isNotFoundError(e){return e.stack.includes("404")||e.message.includes("Not Found")||e.message.includes("404")}}class SwarmChat{constructor(e){this.emitter=new EventEmitter,this.utils=new SwarmChatUtils(this.handleError.bind(this)),this.messagesQueue=new Queue({clearWaitTime:200},this.handleError.bind(this)),this.gsocListenerQueue=new Queue({clearWaitTime:200},this.handleError.bind(this)),this.fetchMessageTimer=null,this.keepUserAliveTimer=null,this.idleUserCleanupInterval=null,this.KEEP_ALIVE_INTERVAL_TIME=2500,this.FETCH_MESSAGE_INTERVAL_TIME=1e3,this.IDLE_USER_CLEANUP_INTERVAL_TIME=5e3,this.READ_MESSAGE_TIMEOUT=1500,this.users={},this.userIndexCache={},this.userPunishmentCache={},this.tempUser=null,this.gsocResourceId=null,this.gsocSubscribtion=null,this.ownIndex=null,this.ownAddress=e.ownAddress,this.privateKey=e.privateKey,this.topic=e.topic,this.nickname=e.nickname,this.gsocResourceId=e.gsocResourceId,this.bees=this.utils.initBees(e.bees),this.KEEP_ALIVE_INTERVAL_TIME=e.keepAliveIntervalTime||this.KEEP_ALIVE_INTERVAL_TIME,this.FETCH_MESSAGE_INTERVAL_TIME=e.fetchMessageIntervalTime||this.FETCH_MESSAGE_INTERVAL_TIME,this.IDLE_USER_CLEANUP_INTERVAL_TIME=e.idleUserCleanupIntervalTime||this.IDLE_USER_CLEANUP_INTERVAL_TIME,this.READ_MESSAGE_TIMEOUT=e.readMessageTimeout||this.READ_MESSAGE_TIMEOUT}start(){this.initSelfIndex(),this.listenToNewSubscribers(),this.startKeepMeAliveProcess(),this.startMessagesFetchProcess(),this.startIdleUserCleanup()}stop(){this.stopListenToNewSubscribers(),this.stopKeepMeAliveProcess(),this.stopMessagesFetchProcess(),this.stopIdleUserCleanup(),this.emitter.cleanAll()}isUserRegistered(e){return!!this.users[e]}getEmitter(){return this.emitter}async initSelfIndex(){try{const e=this.utils.generateUserOwnedFeedId(this.topic,this.ownAddress),n=this.getReaderBee(),a=n.makeFeedTopic(e),{latestIndex:c}=await this.utils.retryAwaitableAsync(()=>this.utils.getLatestFeedIndex(n,a,this.ownAddress));this.ownIndex=c}catch(e){this.handleError({error:e,context:"initSelfIndex",throw:!1})}}listenToNewSubscribers(){try{if(!this.gsocResourceId)throw new Error("GSOC Resource ID is not defined");this.emitter.emit(EVENTS.LOADING_INIT_USERS,!0);const e=this.getMainGsocBee();this.gsocSubscribtion=this.utils.subscribeToGsoc(e.url,this.topic,this.gsocResourceId,n=>this.gsocListenerQueue.enqueue(()=>this.userRegistrationOnGsoc(n)))}catch(e){this.handleError({error:e,context:"Could not listen to new subscribers",throw:!0})}}async sendMessage(e){const n={id:v4(),username:this.nickname,address:this.ownAddress,timestamp:Date.now(),message:e};try{if(this.ownIndex===null)throw new Error("Cannot send message with null index");this.emitter.emit(EVENTS.MESSAGE_REQUEST_SENT,n);const{bee:a,stamp:c}=this.getWriterBee(),o=await this.utils.retryAwaitableAsync(()=>this.utils.uploadObjectToBee(a,n,c));if(!o)throw"Could not upload message data to bee";const u=this.utils.generateUserOwnedFeedId(this.topic,this.ownAddress),h=a.makeFeedTopic(u),l=a.makeFeedWriter("sequence",h,this.privateKey),b=this.ownIndex===-1?0:this.ownIndex+1;for(await l.upload(c,o.reference,{index:b}),this.ownIndex=b;!this.isUserIndexRead(this.ownAddress,this.ownIndex);)await sleep(200)}catch(a){this.emitter.emit(EVENTS.MESSAGE_REQUEST_ERROR,n),this.handleError({error:a,context:"sendMessage",throw:!1})}}async keepUserAlive(){try{if(!this.gsocResourceId)throw new Error("GSOC Resource ID is not defined");const e=this.getOwnIndex();if(e===null)return;const n=new Wallet(this.privateKey),a=n.address;if(a.toLowerCase()!==this.ownAddress.toLowerCase())throw new Error("The provided address does not match the address derived from the private key");if(this.checkUserPunishment(a))return;const c=Date.now(),o=await n.signMessage(JSON.stringify({username:this.nickname,address:a,timestamp:c})),u={address:a,timestamp:c,signature:o,index:e,username:this.nickname};if(!this.utils.validateUserObject(u))throw new Error("User object validation failed");const{bee:h,stamp:l}=this.getGsocBee(),b=await this.utils.sendMessageToGsoc(h.url,l,this.topic,this.gsocResourceId,JSON.stringify(u));if(!(b!=null&&b.payload.length))throw"Error writing User object to GSOC!"}catch(e){this.handleError({error:e,context:"registerUser",throw:!1})}}orderMessages(e){return this.utils.orderMessages(e)}isUserIndexRead(e,n){return this.userIndexCache[e]===n}setUserIndexCache(e){this.userIndexCache[e.address]=e.index}getOwnIndex(){return this.ownIndex}removeIdleUsers(){const e=Date.now();for(const n of Object.values(this.users))e-n.timestamp>30*SECOND&&delete this.users[n.address]}setUser(e){this.users[e.address]=e}checkUserPunishment(e){return this.userPunishmentCache[e]>0?(this.userPunishmentCache[e]--,!0):!1}userRegistrationOnGsoc(e){var n;try{let a;try{a=JSON.parse(e)}catch{console.error("Invalid GSOC message format:",e);return}if(((n=this.tempUser)==null?void 0:n.address)===a.address&&this.userPunishmentCache[a.address]===0&&Object.keys(this.users).length>1){this.userPunishmentCache[a.address]=Object.keys(this.users).length;return}this.setUser(a),this.tempUser=a}catch(a){this.handleError({error:a,context:"userRegisteredThroughGsoc",throw:!1})}}async readMessagesForAll(){if(!await this.messagesQueue.waitForProcessing())for(const n of Object.values(this.users))this.messagesQueue.enqueue(()=>this.readMessage(n,this.topic))}async readMessage(e,n){try{if(e.index===-1||this.isUserIndexRead(e.address,e.index))return;const c=this.getReaderBee(),o=this.utils.generateUserOwnedFeedId(n,e.address),u=c.makeFeedTopic(o),l=await c.makeFeedReader("sequence",u,e.address,{timeout:this.READ_MESSAGE_TIMEOUT}).download({index:e.index}),b=await c.downloadData(l.reference,{headers:{"Swarm-Redundancy-Level":"0"}}),d=JSON.parse(new TextDecoder().decode(b));this.emitter.emit(EVENTS.MESSAGE_RECEIVED,d),this.setUserIndexCache(e)}catch(a){a instanceof Error&&this.handleError({error:a,context:"readMessage",throw:!1})}finally{this.ownAddress===e.address&&this.emitter.emit(EVENTS.LOADING_INIT_USERS,!1)}}stopListenToNewSubscribers(){this.gsocSubscribtion&&(this.gsocSubscribtion.close(),this.gsocSubscribtion=null)}startKeepMeAliveProcess(){if(this.keepUserAliveTimer){console.warn("Keep me alive process is already running.");return}this.keepUserAliveTimer=setInterval(this.keepUserAlive.bind(this),this.KEEP_ALIVE_INTERVAL_TIME)}stopKeepMeAliveProcess(){this.keepUserAliveTimer&&(clearInterval(this.keepUserAliveTimer),this.keepUserAliveTimer=null)}startMessagesFetchProcess(){if(this.fetchMessageTimer){console.warn("Messages fetch process is already running.");return}this.fetchMessageTimer=setInterval(this.readMessagesForAll.bind(this),this.FETCH_MESSAGE_INTERVAL_TIME)}stopMessagesFetchProcess(){this.fetchMessageTimer&&(clearInterval(this.fetchMessageTimer),this.fetchMessageTimer=null)}startIdleUserCleanup(){if(this.idleUserCleanupInterval){console.warn("Idle user cleanup is already running.");return}this.idleUserCleanupInterval=setInterval(this.removeIdleUsers.bind(this),this.IDLE_USER_CLEANUP_INTERVAL_TIME)}stopIdleUserCleanup(){this.idleUserCleanupInterval&&(clearInterval(this.idleUserCleanupInterval),this.idleUserCleanupInterval=null)}getMainGsocBee(){const{bee:e}=this.utils.selectBee(this.bees,BeeType.GSOC,!0);if(!e)throw new Error("Could not get main GSOC bee");return e}getGsocBee(){const{bee:e,stamp:n}=this.utils.selectBee(this.bees,BeeType.GSOC);if(!e)throw new Error("Could not get GSOC bee");if(!n)throw new Error("Could not get valid gsoc stamp");return{bee:e,stamp:n}}getReaderBee(){const{bee:e}=this.utils.selectBee(this.bees,BeeType.READER);if(!e)throw new Error("Could not get reader bee");return e}getWriterBee(){const{bee:e,stamp:n}=this.utils.selectBee(this.bees,BeeType.WRITER);if(!e)throw new Error("Could not get writer bee");if(!n)throw new Error("Could not get valid writer stamp");return{bee:e,stamp:n}}handleError(e){if(console.error(`Error in ${e.context}: ${e.error.message}`),this.emitter.emit(EVENTS.ERROR,e),e.throw)throw new Error(`Error in ${e.context}`)}}exports.EVENTS=EVENTS,exports.SwarmChat=SwarmChat,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|