PageSourceSearch

https://orbiter.finance/_next/static/chunks/vendors-a1c3e100-68cc26aee031052d.js

js orbiter.finance collected 2026-09-24 11:13:44 UTC 256,820 bytes, 15 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7575],{56845:function(t,e,r){"use strict";r.d(e,{lE:function(){return u},Dv:function(){return c},N:function(){return f}});let n=new(r(9357)).Logger("bytes/5.7.0");function i(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function o(t){return"number"==typeof t&&t==t&&t%1==0}function a(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!o(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!o(r)||r<0||r>=256)return!1}return!0}function u(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),s(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t)&&(t=t.toHexString()),l(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t<r.length;t+=2)i.push(parseInt(r.substring(t,t+2),16));return s(new Uint8Array(i))}return a(t)?s(new Uint8Array(t)):n.throwArgumentError("invalid arrayify value","value",t)}function l(t,e){return"string"==typeof t&&!!t.match(/^0x[0-9A-Fa-f]*$/)&&(!e||t.length===2+2*e)}let h="0123456789abcdef";function c(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=h[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t))return t.toHexString();if(l(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":n.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(a(t)){let e="0x";for(let r=0;r<t.length;r++){let n=t[r];e+=h[(240&n)>>4]+h[15&n]}return e}return n.throwArgumentError("invalid hexlify value","value",t)}function d(t,e){for("string"!=typeof t?t=c(t):l(t)||n.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&n.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function f(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(l(t)&&!(t.length%2)||a(t)){let r=u(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=c(r.slice(0,32)),e.s=c(r.slice(32,64))):65===r.length?(e.r=c(r.slice(0,32)),e.s=c(r.slice(32,64)),e.v=r[64]):n.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:n.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=c(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){let r=function(t,e){(t=u(t)).length>e&&n.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),s(r)}(u(e._vs),32);e._vs=c(r);let i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;let o=c(r);null==e.s?e.s=o:e.s!==o&&n.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?n.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{let r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&l(e.r)?e.r=d(e.r,32):n.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&l(e.s)?e.s=d(e.s,32):n.throwArgumentError("signature missing or invalid s","signature",t);let r=u(e.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let i=c(r);e._vs&&(l(e._vs)||n.throwArgumentError("signature invalid _vs","signature",t),e._vs=d(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}},89672:function(t,e,r){"use strict";r.d(e,{RG:function(){return tY}});var n=r(87376),i=r(26804),s=r(42306),o=r.n(s),a=r(94272),u=r.n(a),l=r(44207),h=r(70340),c=r(91214),d=r(23722),f=r(58769);r(49269);var p=r(48191);p.v,p.v;var g=r(80395),m=r(65952);
vendor: 26,593 bytes, lines 1-7
1i.UN.utils.randomPrivateKey;let y=()=>{let t=i.UN.utils.randomPrivateKey(),e=b(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),{publicKey:e,secretKey:r}},b=i.UN.getPublicKey;function w(t){try{return i.UN.ExtendedPoint.fromHex(t),!0}catch{return!1}}let v=(t,e)=>i.UN.sign(t,e.slice(0,32)),k=i.UN.verify,x=t=>n.Buffer.isBuffer(t)?t:t instanceof Uint8Array?n.Buffer.from(t.buffer,t.byteOffset,t.byteLength):n.Buffer.from(t);class I{constructor(t){Object.assign(this,t)}encode(){return n.Buffer.from((0,h.serialize)(S,this))}static decode(t){return(0,h.deserialize)(S,this,t)}static decodeUnchecked(t){return(0,h.deserializeUnchecked)(S,this,t)}}let S=new Map,M=1;class E extends I{constructor(t){if(super({}),this._bn=void 0,void 0!==t._bn)this._bn=t._bn;else{if("string"==typeof t){let e=u().decode(t);if(32!=e.length)throw Error("Invalid public key input");this._bn=new(o())(e)}else this._bn=new(o())(t);if(this._bn.byteLength()>32)throw Error("Invalid public key input")}}static unique(){let t=new E(M);return M+=1,new E(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return u().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(n.Buffer);if(32===t.length)return t;let e=n.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,r){let i=n.Buffer.concat([t.toBuffer(),n.Buffer.from(e),r.toBuffer()]);return new E((0,l.JQ)(i))}static createProgramAddressSync(t,e){let r=n.Buffer.alloc(0);t.forEach(function(t){if(t.length>32)throw TypeError("Max seed length exceeded");r=n.Buffer.concat([r,x(t)])}),r=n.Buffer.concat([r,e.toBuffer(),n.Buffer.from("ProgramDerivedAddress")]);let i=(0,l.JQ)(r);if(w(i))throw Error("Invalid seeds, address must fall off the curve");return new E(i)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let r,i=255;for(;0!=i;){try{let s=t.concat(n.Buffer.from([i]));r=this.createProgramAddressSync(s,e)}catch(t){if(t instanceof TypeError)throw t;i--;continue}return[r,i]}throw Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return w(new E(t).toBytes())}}E.default=new E("11111111111111111111111111111111"),S.set(E,{kind:"struct",fields:[["_bn","u256"]]}),new E("BPFLoader1111111111111111111111111111111111");class A extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(A.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class B extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(B.prototype,"name",{value:"TransactionExpiredTimeoutError"});class P extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}}Object.defineProperty(P.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class _{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments()){if(t<e.length)return e[t];t-=e.length}}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw Error("Account index overflow encountered during compilation");let e=new Map;this.keySegments().flat().forEach((t,r)=>{e.set(t.toBase58(),r)});let r=t=>{let r=e.get(t.toBase58());if(void 0===r)throw Error("Encountered an unknown instruction account key during compilation");return r};return t.map(t=>({programIdIndex:r(t.programId),accountKeyIndexes:t.keys.map(t=>r(t.pubkey)),data:t.data}))}}let O=(t="publicKey")=>c.Ik(32,t),T=(t="string")=>{let e=c.n_([c.Jq("length"),c.Jq("lengthPadding"),c.Ik(c.cv(c.Jq(),-8),"chars")],t),r=e.decode.bind(e),i=e.encode.bind(e);return e.decode=(t,e)=>r(t,e).chars.toString(),e.encode=(t,e,r)=>i({chars:n.Buffer.from(t,"utf8")},e,r),e.alloc=t=>c.Jq().span+c.Jq().span+n.Buffer.from(t,"utf8").length,e};function C(t){let e=0,r=0;for(;;){let n=t.shift();if(e|=(127&n)<<7*r,r+=1,(128&n)==0)break}return e}function L(t,e){let r=e;for(;;){let e=127&r;if(0==(r>>=7)){t.push(e);break}e|=128,t.push(e)}}function R(t,e){if(!t)throw Error(e||"Assertion failed")}class z{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let r=new Map,n=t=>{let e=t.toBase58(),n=r.get(e);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(e,n)),n},i=n(e);for(let e of(i.isSigner=!0,i.isWritable=!0,t))for(let t of(n(e.programId).isInvoked=!0,e.keys)){let e=n(t.pubkey);e.isSigner||=t.isSigner,e.isWritable||=t.isWritable}return new z(e,r)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];R(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,t])=>t.isSigner&&t.isWritable),r=t.filter(([,t])=>t.isSigner&&!t.isWritable),n=t.filter(([,t])=>!t.isSigner&&t.isWritable),i=t.filter(([,t])=>!t.isSigner&&!t.isWritable),s={numRequiredSignatures:e.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{R(e.length>0,"Expected at least one writable signer key");let[t]=e[0];R(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[s,[...e.map(([t])=>new E(t)),...r.map(([t])=>new E(t)),...n.map(([t])=>new E(t)),...i.map(([t])=>new E(t))]]}extractTableLookup(t){let[e,r]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&t.isWritable),[n,i]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&!t.isWritable);if(0!==e.length||0!==n.length)return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:n},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(t,e){let r=[],n=[];for(let[i,s]of this.keyMetaMap.entries())if(e(s)){let e=new E(i),s=t.findIndex(t=>t.equals(e));s>=0&&(R(s<256,"Max lookup table index exceeded"),r.push(s),n.push(e),this.keyMetaMap.delete(i))}return[r,n]}}let $="Reached end of buffer unexpectedly";function q(t){if(0===t.length)throw Error($);return t.shift()}function N(t,...e){let[r]=e;if(2===e.length?r+(e[1]??0)>t.length:r>=t.length)throw Error($);return t.splice(...e)}class U{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(t=>new E(t)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:u().decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new _(this.staticAccountKeys)}static compile(t){let[e,r]=z.compile(t.instructions,t.payerKey).getMessageComponents(),n=new _(r).compileInstructions(t.instructions).map(t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:u().encode(t.data)}));return new U({header:e,accountKeys:r,recentBlockhash:t.recentBlockhash,instructions:n})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures;if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let r=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return t-e<r}}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((t,e)=>!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];L(e,t);let r=this.instructions.map(t=>{let{accounts:e,programIdIndex:r}=t,i=Array.from(u().decode(t.data)),s=[];L(s,e.length);let o=[];return L(o,i.length),{programIdIndex:r,keyIndicesCount:n.Buffer.from(s),keyIndices:e,dataLength:n.Buffer.from(o),data:i}}),i=[];L(i,r.length);let s=n.Buffer.alloc(1232);n.Buffer.from(i).copy(s);let o=i.length;r.forEach(t=>{let e=c.n_([c.u8("programIdIndex"),c.Ik(t.keyIndicesCount.length,"keyIndicesCount"),c.A9(c.u8("keyIndex"),t.keyIndices.length,"keyIndices"),c.Ik(t.dataLength.length,"dataLength"),c.A9(c.u8("userdatum"),t.data.length,"data")]).encode(t,s,o);o+=e}),s=s.slice(0,o);let a=c.n_([c.Ik(1,"numRequiredSignatures"),c.Ik(1,"numReadonlySignedAccounts"),c.Ik(1,"numReadonlyUnsignedAccounts"),c.Ik(e.length,"keyCount"),c.A9(O("key"),t,"keys"),O("recentBlockhash")]),l={numRequiredSignatures:n.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:n.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:n.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:n.Buffer.from(e),keys:this.accountKeys.map(t=>x(t.toBytes())),recentBlockhash:u().decode(this.recentBlockhash)},h=n.Buffer.alloc(2048),d=a.encode(l,h);return s.copy(h,d),h.slice(0,d+s.length)}static from(t){let e=[...t],r=q(e);if(r!==(127&r))throw Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let i=q(e),s=q(e),o=C(e),a=[];for(let t=0;t<o;t++){let t=N(e,0,32);a.push(new E(n.Buffer.from(t)))}let l=N(e,0,32),h=C(e),c=[];for(let t=0;t<h;t++){let t=q(e),r=C(e),i=N(e,0,r),s=C(e),o=N(e,0,s),a=u().encode(n.Buffer.from(o));c.push({programIdIndex:t,accounts:i,data:a})}return new U({header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:s},recentBlockhash:u().encode(n.Buffer.from(l)),accountKeys:a,instructions:c})}}class W{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(let e of this.addressTableLookups)t+=e.readonlyIndexes.length+e.writableIndexes.length;return t}getAccountKeys(t){let e;if(t&&"accountKeysFromLookups"in t&&t.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");e=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t&&t.addressLookupTableAccounts)e=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw Error("Failed to get account keys because address table lookups were not resolved");return new _(this.staticAccountKeys,e)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(t>=r)return t-r<this.addressTableLookups.reduce((t,e)=>t+e.writableIndexes.length,0);if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let n=r-e-this.header.numReadonlyUnsignedAccounts;return t-e<n}}resolveAddressTableLookups(t){let e={writable:[],readonly:[]};for(let r of this.addressTableLookups){let n=t.find(t=>t.key.equals(r.accountKey));if(!n)throw Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(let t of r.writableIndexes)if(t<n.state.addresses.length)e.writable.push(n.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`);for(let t of r.readonlyIndexes)if(t<n.state.addresses.length)e.readonly.push(n.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`)}return e}static compile(t){let e=z.compile(t.instructions,t.payerKey),r=[],n={writable:[],readonly:[]};for(let i of t.addressLookupTableAccounts||[]){let t=e.extractTableLookup(i);if(void 0!==t){let[e,{writable:i,readonly:s}]=t;r.push(e),n.writable.push(...i),n.readonly.push(...s)}}let[i,s]=e.getMessageComponents(),o=new _(s,n).compileInstructions(t.instructions);return new W({header:i,staticAccountKeys:s,recentBlockhash:t.recentBlockhash,compiledInstructions:o,addressTableLookups:r})}serialize(){let t=[];L(t,this.staticAccountKeys.length);let e=this.serializeInstructions(),r=[];L(r,this.compiledInstructions.length);let n=this.serializeAddressTableLookups(),i=[];L(i,this.addressTableLookups.length);let s=c.n_([c.u8("prefix"),c.n_([c.u8("numRequiredSignatures"),c.u8("numReadonlySignedAccounts"),c.u8("numReadonlyUnsignedAccounts")],"header"),c.Ik(t.length,"staticAccountKeysLength"),c.A9(O(),this.staticAccountKeys.length,"staticAccountKeys"),O("recentBlockhash"),c.Ik(r.length,"instructionsLength"),c.Ik(e.length,"serializedInstructions"),c.Ik(i.length,"addressTableLookupsLength"),c.Ik(n.length,"serializedAddressTableLookups")]),o=new Uint8Array(1232),a=s.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map(t=>t.toBytes()),recentBlockhash:u().decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:n},o);return o.slice(0,a)}serializeInstructions(){let t=0,e=new Uint8Array(1232);for(let r of this.compiledInstructions){let n=[];L(n,r.accountKeyIndexes.length);let i=[];L(i,r.data.length);let s=c.n_([c.u8("programIdIndex"),c.Ik(n.length,"encodedAccountKeyIndexesLength"),c.A9(c.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),c.Ik(i.length,"encodedDataLength"),c.Ik(r.data.length,"data")]);t+=s.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0,e=new Uint8Array(1232);for(let r of this.addressTableLookups){let n=[];L(n,r.writableIndexes.length);let i=[];L(i,r.readonlyIndexes.length);let s=c.n_([O("accountKey"),c.Ik(n.length,"encodedWritableIndexesLength"),c.A9(c.u8(),r.writableIndexes.length,"writableIndexes"),c.Ik(i.length,"encodedReadonlyIndexesLength"),c.A9(c.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);t+=s.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t],r=q(e),n=127&r;R(r!==n,"Expected versioned message but received legacy message"),R(0===n,`Expected versioned message with version 0 but found version ${n}`);let i={numRequiredSignatures:q(e),numReadonlySignedAccounts:q(e),numReadonlyUnsignedAccounts:q(e)},s=[],o=C(e);for(let t=0;t<o;t++)s.push(new E(N(e,0,32)));let a=u().encode(N(e,0,32)),l=C(e),h=[];for(let t=0;t<l;t++){let t=q(e),r=C(e),n=N(e,0,r),i=C(e),s=new Uint8Array(N(e,0,i));h.push({programIdIndex:t,accountKeyIndexes:n,data:s})}let c=C(e),d=[];for(let t=0;t<c;t++){let t=new E(N(e,0,32)),r=C(e),n=N(e,0,r),i=C(e),s=N(e,0,i);d.push({accountKey:t,writableIndexes:n,readonlyIndexes:s})}return new W({header:i,staticAccountKeys:s,recentBlockhash:a,compiledInstructions:h,addressTableLookups:d})}}let j=n.Buffer.alloc(64).fill(0);class K{constructor(t){this.keys=void 0,this.programId=void 0,this.data=n.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:e,isWritable:r})=>({pubkey:t.toJSON(),isSigner:e,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class F{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!t)return;if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){let{minContextSlot:e,nonceInfo:r}=t;this.minNonceContextSlot=e,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){let{blockhash:e,lastValidBlockHeight:r}=t;this.recentBlockhash=e,this.lastValidBlockHeight=r}else{let{recentBlockhash:e,nonceInfo:r}=t;r&&(this.nonceInfo=r),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(0===t.length)throw Error("No instructions");return t.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new K(t))}),this}compileMessage(){let t,e,r;if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;if(this.nonceInfo?(t=this.nonceInfo.nonce,e=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw Error("Transaction recentBlockhash required");if(e.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw Error("Transaction fee payer required");for(let t=0;t<e.length;t++)if(void 0===e[t].programId)throw Error(`Transaction instruction index ${t} has undefined program id`);let n=[],i=[];e.forEach(t=>{t.keys.forEach(t=>{i.push({...t})});let e=t.programId.toString();n.includes(e)||n.push(e)}),n.forEach(t=>{i.push({pubkey:new E(t),isSigner:!1,isWritable:!1})});let s=[];i.forEach(t=>{let e=t.pubkey.toString(),r=s.findIndex(t=>t.pubkey.toString()===e);r>-1?(s[r].isWritable=s[r].isWritable||t.isWritable,s[r].isSigner=s[r].isSigner||t.isSigner):s.push(t)}),s.sort(function(t,e){return t.isSigner!==e.isSigner?t.isSigner?-1:1:t.isWritable!==e.isWritable?t.isWritable?-1:1:t.pubkey.toBase58().localeCompare(e.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})});let o=s.findIndex(t=>t.pubkey.equals(r));if(o>-1){let[t]=s.splice(o,1);t.isSigner=!0,t.isWritable=!0,s.unshift(t)}else s.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(let t of this.signatures){let e=s.findIndex(e=>e.pubkey.equals(t.publicKey));if(e>-1)s[e].isSigner||(s[e].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw Error(`unknown signer: ${t.publicKey.toString()}`)}let a=0,l=0,h=0,c=[],d=[];s.forEach(({pubkey:t,isSigner:e,isWritable:r})=>{e?(c.push(t.toString()),a+=1,r||(l+=1)):(d.push(t.toString()),r||(h+=1))});let f=c.concat(d),p=e.map(t=>{let{data:e,programId:r}=t;return{programIdIndex:f.indexOf(r.toString()),accounts:t.keys.map(t=>f.indexOf(t.pubkey.toString())),data:u().encode(e)}});return p.forEach(t=>{R(t.programIdIndex>=0),t.accounts.forEach(t=>R(t>=0))}),new U({header:{numRequiredSignatures:a,numReadonlySignedAccounts:l,numReadonlyUnsignedAccounts:h},accountKeys:f,recentBlockhash:t,instructions:p})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((t,r)=>e[r].equals(t.publicKey))||(this.signatures=e.map(t=>({signature:null,publicKey:t}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw Error("No signers");let e=new Set;this.signatures=t.filter(t=>{let r=t.toString();return!e.has(r)&&(e.add(r),!0)}).map(t=>({signature:null,publicKey:t}))}sign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let n of t){let t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}this.signatures=r.map(t=>({signature:null,publicKey:t.publicKey}));let n=this._compile();this._partialSign(n,...r)}partialSign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let n of t){let t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}let n=this._compile();this._partialSign(n,...r)}_partialSign(t,...e){let r=t.serialize();e.forEach(t=>{let e=v(r,t.secretKey);this._addSignature(t.publicKey,x(e))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){R(64===e.length);let r=this.signatures.findIndex(e=>t.equals(e.publicKey));if(r<0)throw Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=n.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let r={};for(let{signature:n,publicKey:i}of this.signatures)null===n?e&&(r.missing||=[]).push(i):k(n,t,i.toBytes())||(r.invalid||=[]).push(i);return r.invalid||r.missing?r:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),n=this.serializeMessage();if(r){let t=this._getMessageSignednessErrors(n,e);if(t){let e="Signature verification failed.";throw t.invalid&&(e+=`
2Invalid signature for public key${1===t.invalid.length?"":"(s)"} [\`${t.invalid.map(t=>t.toBase58()).join("`, `")}\`].`),t.missing&&(e+=`
3Missing signature for public key${1===t.missing.length?"":"(s)"} [\`${t.missing.map(t=>t.toBase58()).join("`, `")}\`].`),Error(e)}}return this._serialize(n)}_serialize(t){let{signatures:e}=this,r=[];L(r,e.length);let i=r.length+64*e.length+t.length,s=n.Buffer.alloc(i);return R(e.length<256),n.Buffer.from(r).copy(s,0),e.forEach(({signature:t},e)=>{null!==t&&(R(64===t.length,"signature has invalid length"),n.Buffer.from(t).copy(s,r.length+64*e))}),t.copy(s,r.length+64*e.length),R(s.length<=1232,`Transaction too large: ${s.length} > 1232`),s}get keys(){return R(1===this.instructions.length),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return R(1===this.instructions.length),this.instructions[0].programId}get data(){return R(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t],r=C(e),i=[];for(let t=0;t<r;t++){let t=N(e,0,64);i.push(u().encode(n.Buffer.from(t)))}return F.populate(U.from(e),i)}static populate(t,e=[]){let r=new F;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),e.forEach((e,n)=>{let i={signature:e==u().encode(j)?null:u().decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)}),t.instructions.forEach(e=>{let n=e.accounts.map(e=>{let n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some(t=>t.publicKey.toString()===n.toString())||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}});r.instructions.push(new K({keys:n,programId:t.accountKeys[e.programIdIndex],data:u().decode(e.data)}))}),r._message=t,r._json=r.toJSON(),r}}let D=new E("SysvarC1ock11111111111111111111111111111111");new E("SysvarEpochSchedu1e111111111111111111111111"),new E("Sysvar1nstructions1111111111111111111111111");let G=new E("SysvarRecentB1ockHashes11111111111111111111"),H=new E("SysvarRent111111111111111111111111111111111");new E("SysvarRewards111111111111111111111111111111"),new E("SysvarS1otHashes111111111111111111111111111"),new E("SysvarS1otHistory11111111111111111111111111");let J=new E("SysvarStakeHistory1111111111111111111111111");class V extends Error{constructor({action:t,signature:e,transactionMessage:r,logs:n}){let i;let s=n?`Logs: 
4${JSON.stringify(n.slice(-10),null,2)}. `:"",o="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";switch(t){case"send":i=`Transaction ${e} resulted in an error. 
5${r}. `+s+o;break;case"simulate":i=`Simulation failed. 
6Message: ${r}. 
7`+s+o;break;default:i=`Unknown action '${t}'`}super(i),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=r,this.transactionLogs=n||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(null==t||"object"!=typeof t||!("then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,r)=>{t.getTransaction(this.signature).then(t=>{if(t&&t.meta&&t.meta.logMessages){let r=t.meta.logMessages;this.transactionLogs=r,e(r)}else r(Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}async function Z(t,e,r,n){let i;let s=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},o=await t.sendTransaction(e,r,s);if(null!=e.recentBlockhash&&null!=e.lastValidBlockHeight)i=(await t.confirmTransaction({abortSignal:n?.abortSignal,signature:o,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},n&&n.commitment)).value;else if(null!=e.minNonceContextSlot&&null!=e.nonceInfo){let{nonceInstruction:r}=e.nonceInfo,s=r.keys[0].pubkey;i=(await t.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:s,nonceValue:e.nonceInfo.nonce,signature:o},n&&n.commitment)).value}else n?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastV
7alidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),i=(await t.confirmTransaction(o,n&&n.commitment)).value;if(i.err){if(null!=o)throw new V({action:"send",signature:o,transactionMessage:`Status: (${JSON.stringify(i)})`});throw Error(`Transaction ${o} failed (${JSON.stringify(i)})`)}return o}function Y(t,e){let r=t.layout.span>=0?t.layout.span:function t(e,r){let n=e=>{if(e.span>=0)return e.span;if("function"==typeof e.alloc)return e.alloc(r[e.property]);if("count"in e&&"elementLayout"in e){let t=r[e.property];if(Array.isArray(t))return t.length*n(e.elementLayout)}else if("fields"in e)return t({layout:e},r[e.property]);return 0},i=0;return e.layout.fields.forEach(t=>{i+=n(t)}),i}(t,e),i=n.Buffer.alloc(r),s=Object.assign({instruction:t.index},e);return t.layout.encode(s,i),i}let X=c._O("lamportsPerSignature"),Q=c.n_([c.Jq("version"),c.Jq("state"),O("authorizedPubkey"),O("nonce"),c.n_([X],"feeCalculator")]).span,tt=t=>({decode:t.decode.bind(t),encode:t.encode.bind(t)}),te=t=>{let e=(0,c.Ik)(8,t),{encode:r,decode:i}=tt(e);return e.decode=(t,e)=>{let r=i(t,e);return(0,d.oU)(n.Buffer.from(r))},e.encode=(t,e,n)=>r((0,d.k$)(t,8),e,n),e},tr=Object.freeze({Create:{index:0,layout:c.n_([c.Jq("instruction"),c.gM("lamports"),c.gM("space"),O("programId")])},Assign:{index:1,layout:c.n_([c.Jq("instruction"),O("programId")])},Transfer:{index:2,layout:c.n_([c.Jq("instruction"),te("lamports")])},CreateWithSeed:{index:3,layout:c.n_([c.Jq("instruction"),O("base"),T("seed"),c.gM("lamports"),c.gM("space"),O("programId")])},AdvanceNonceAccount:{index:4,layout:c.n_([c.Jq("instruction")])},WithdrawNonceAccount:{index:5,layout:c.n_([c.Jq("instruction"),c.gM("lamports")])},InitializeNonceAccount:{index:6,layout:c.n_([c.Jq("instruction"),O("authorized")])},AuthorizeNonceAccount:{index:7,layout:c.n_([c.Jq("instruction"),O("authorized")])},Allocate:{index:8,layout:c.n_([c.Jq("instruction"),c.gM("space")])},AllocateWithSeed:{index:9,layout:c.n_([c.Jq("instruction"),O("base"),T("seed"),c.gM("space"),O("programId")])},AssignWithSeed:{index:10,layout:c.n_([c.Jq("instruction"),O("base"),T("seed"),O("programId")])},TransferWithSeed:{index:11,layout:c.n_([c.Jq("instruction"),te("lamports"),T("seed"),O("programId")])},UpgradeNonceAccount:{index:12,layout:c.n_([c.Jq("instruction")])}});class tn{constructor(){}static createAccount(t){let e=Y(tr.Create,{lamports:t.lamports,space:t.space,programId:x(t.programId.toBuffer())});return new K({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:e})}static transfer(t){let e,r;return"basePubkey"in t?(e=Y(tr.TransferWithSeed,{lamports:BigInt(t.lamports),seed:t.seed,programId:x(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]):(e=Y(tr.Transfer,{lamports:BigInt(t.lamports)}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]),new K({keys:r,programId:this.programId,data:e})}static assign(t){let e,r;return"basePubkey"in t?(e=Y(tr.AssignWithSeed,{base:x(t.basePubkey.toBuffer()),seed:t.seed,programId:x(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=Y(tr.Assign,{programId:x(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new K({keys:r,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=Y(tr.CreateWithSeed,{base:x(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:x(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey!=t.fromPubkey&&r.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new K({keys:r,programId:this.programId,data:e})}static createNonceAccount(t){let e=new F;"basePubkey"in t&&"seed"in t?e.add(tn.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:Q,programId:this.programId})):e.add(tn.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:Q,programId:this.programId}));let r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(r)),e}static nonceInitialize(t){let e=Y(tr.InitializeNonceAccount,{authorized:x(t.authorizedPubkey.toBuffer())});return new K({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:G,isSigner:!1,isWritable:!1},{pubkey:H,isSigner:!1,isWritable:!1}],programId:this.programId,data:e})}static nonceAdvance(t){let e=Y(tr.AdvanceNonceAccount);return new K({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:G,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceWithdraw(t){let e=Y(tr.WithdrawNonceAccount,{lamports:t.lamports});return new K({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:G,isSigner:!1,isWritable:!1},{pubkey:H,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){let e=Y(tr.AuthorizeNonceAccount,{authorized:x(t.newAuthorizedPubkey.toBuffer())});return new K({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static allocate(t){let e,r;return"basePubkey"in t?(e=Y(tr.AllocateWithSeed,{base:x(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:x(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=Y(tr.Allocate,{space:t.space}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new K({keys:r,programId:this.programId,data:e})}}tn.programId=new E("11111111111111111111111111111111");class ti{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/ti.chunkSize)+1+1)}static async load(t,e,r,i,s){{let n=await t.getMinimumBalanceForRentExemption(s.length),o=await t.getAccountInfo(r.publicKey,"confirmed"),a=null;if(null!==o){if(o.executable)return console.error("Program load failed, account is already executable"),!1;o.data.length!==s.length&&(a=a||new F).add(tn.allocate({accountPubkey:r.publicKey,space:s.length})),o.owner.equals(i)||(a=a||new F).add(tn.assign({accountPubkey:r.publicKey,programId:i})),o.lamports<n&&(a=a||new F).add(tn.transfer({fromPubkey:e.publicKey,toPubkey:r.publicKey,lamports:n-o.lamports}))}else a=new F().add(tn.createAccount({fromPubkey:e.publicKey,newAccountPubkey:r.publicKey,lamports:n>0?n:1,space:s.length,programId:i}));null!==a&&await Z(t,a,[e,r],{commitment:"confirmed"})}let o=c.n_([c.Jq("instruction"),c.Jq("offset"),c.Jq("bytesLength"),
7c.Jq("bytesLengthPadding"),c.A9(c.u8("byte"),c.cv(c.Jq(),-8),"bytes")]),a=ti.chunkSize,u=0,l=s,h=[];for(;l.length>0;){let s=l.slice(0,a),c=n.Buffer.alloc(a+16);o.encode({instruction:0,offset:u,bytes:s,bytesLength:0,bytesLengthPadding:0},c);let d=new F().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:c});h.push(Z(t,d,[e,r],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await new Promise(t=>setTimeout(t,250)),u+=a,l=l.slice(a)}await Promise.all(h);{let s=c.n_([c.Jq("instruction")]),o=n.Buffer.alloc(s.span);s.encode({instruction:1},o);let a=new F().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:H,isSigner:!1,isWritable:!1}],programId:i,data:o}),u="processed",l=await t.sendTransaction(a,[e,r],{preflightCommitment:u}),{context:h,value:d}=await t.confirmTransaction({signature:l,lastValidBlockHeight:a.lastValidBlockHeight,blockhash:a.recentBlockhash},u);if(d.err)throw Error(`Transaction ${l} failed (${JSON.stringify(d)})`);for(;;){try{if(await t.getSlot({commitment:u})>h.slot)break}catch{}await new Promise(t=>setTimeout(t,Math.round(200)))}}return!0}}ti.chunkSize=932,new E("BPFLoader2111111111111111111111111111111111"),Object.prototype.toString,c.n_([c.Jq("typeIndex"),te("deactivationSlot"),c._O("lastExtendedSlot"),c.u8("lastExtendedStartIndex"),c.u8(),c.A9(O(),c.cv(c.u8(),-1),"authority")]);let ts=(0,f.coerce)((0,f.instance)(E),(0,f.string)(),t=>new E(t)),to=(0,f.tuple)([(0,f.string)(),(0,f.literal)("base64")]),ta=(0,f.coerce)((0,f.instance)(n.Buffer),to,t=>n.Buffer.from(t[0],"base64"));function tu(t){return(0,f.union)([(0,f.type)({jsonrpc:(0,f.literal)("2.0"),id:(0,f.string)(),result:t}),(0,f.type)({jsonrpc:(0,f.literal)("2.0"),id:(0,f.string)(),error:(0,f.type)({code:(0,f.unknown)(),message:(0,f.string)(),data:(0,f.optional)((0,f.any)())})})])}let tl=tu((0,f.unknown)());function th(t){return(0,f.coerce)(tu(t),tl,e=>"error"in e?e:{...e,result:(0,f.create)(e.result,t)})}function tc(t){return th((0,f.type)({context:(0,f.type)({slot:(0,f.number)()}),value:t}))}function td(t){return(0,f.type)({context:(0,f.type)({slot:(0,f.number)()}),value:t})}let tf=(0,f.type)({foundation:(0,f.number)(),foundationTerm:(0,f.number)(),initial:(0,f.number)(),taper:(0,f.number)(),terminal:(0,f.number)()});th((0,f.array)((0,f.nullable)((0,f.type)({epoch:(0,f.number)(),effectiveSlot:(0,f.number)(),amount:(0,f.number)(),postBalance:(0,f.number)(),commission:(0,f.optional)((0,f.nullable)((0,f.number)()))}))));let tp=(0,f.array)((0,f.type)({slot:(0,f.number)(),prioritizationFee:(0,f.number)()})),tg=(0,f.type)({total:(0,f.number)(),validator:(0,f.number)(),foundation:(0,f.number)(),epoch:(0,f.number)()}),tm=(0,f.type)({epoch:(0,f.number)(),slotIndex:(0,f.number)(),slotsInEpoch:(0,f.number)(),absoluteSlot:(0,f.number)(),blockHeight:(0,f.optional)((0,f.number)()),transactionCount:(0,f.optional)((0,f.number)())}),ty=(0,f.type)({slotsPerEpoch:(0,f.number)(),leaderScheduleSlotOffset:(0,f.number)(),warmup:(0,f.boolean)(),firstNormalEpoch:(0,f.number)(),firstNormalSlot:(0,f.number)()}),tb=(0,f.record)((0,f.string)(),(0,f.array)((0,f.number)())),tw=(0,f.nullable)((0,f.union)([(0,f.type)({}),(0,f.string)()])),tv=(0,f.type)({err:tw}),tk=(0,f.literal)("receivedSignature");(0,f.type)({"solana-core":(0,f.string)(),"feature-set":(0,f.optional)((0,f.number)())}),tc((0,f.type)({err:(0,f.nullable)((0,f.union)([(0,f.type)({}),(0,f.string)()])),logs:(0,f.nullable)((0,f.array)((0,f.string)())),accounts:(0,f.optional)((0,f.nullable)((0,f.array)((0,f.nullable)((0,f.type)({executable:(0,f.boolean)(),owner:(0,f.string)(),lamports:(0,f.number)(),data:(0,f.array)((0,f.string)()),rentEpoch:(0,f.optional)((0,f.number)())}))))),unitsConsumed:(0,f.optional)((0,f.number)()),returnData:(0,f.optional)((0,f.nullable)((0,f.type)({programId:(0,f.string)(),data:(0,f.tuple)([(0,f.string)(),(0,f.literal)("base64")])})))})),tc((0,f.type)({byIdentity:(0,f.record)((0,f.string)(),(0,f.array)((0,f.number)())),range:(0,f.type)({firstSlot:(0,f.number)(),lastSlot:(0,f.number)()})})),th(tf),th(tg),th(tp),th(tm),th(ty),th(tb),th((0,f.number)()),tc((0,f.type)({total:(0,f.number)(),circulating:(0,f.number)(),nonCirculating:(0,f.number)(),nonCirculatingAccounts:(0,f.array)(ts)}));let tx=(0,f.type)({amount:(0,f.string)(),uiAmount:(0,f.nullable)((0,f.number)()),decimals:(0,f.number)(),uiAmountString:(0,f.optional)((0,f.string)())});tc((0,f.array)((0,f.type)({address:ts,amount:(0,f.string)(),uiAmount:(0,f.nullable)((0,f.number)()),decimals:(0,f.number)(),uiAmountString:(0,f.optional)((0,f.string)())}))),tc((0,f.array)((0,f.type)({pubkey:ts,account:(0,f.type)({executable:(0,f.boolean)(),owner:ts,lamports:(0,f.number)(),data:ta,rentEpoch:(0,f.number)()})})));let tI=(0,f.type)({program:(0,f.string)(),parsed:(0,f.unknown)(),space:(0,f.number)()});tc((0,f.array)((0,f.type)({pubkey:ts,account:(0,f.type)({executable:(0,f.boolean)(),owner:ts,lamports:(0,f.number)(),data:tI,rentEpoch:(0,f.number)()})}))),tc((0,f.array)((0,f.type)({lamports:(0,f.number)(),address:ts})));let tS=(0,f.type)({executable:(0,f.boolean)(),owner:ts,lamports:(0,f.number)(),data:ta,rentEpoch:(0,f.number)()});(0,f.type)({pubkey:ts,account:tS});let tM=(0,f.coerce)((0,f.union)([(0,f.instance)(n.Buffer),tI]),(0,f.union)([to,tI]),t=>Array.isArray(t)?(0,f.create)(t,ta):t),tE=(0,f.type)({executable:(0,f.boolean)(),owner:ts,lamports:(0,f.number)(),data:tM,rentEpoch:(0,f.number)()});(0,f.type)({pubkey:ts,account:tE}),(0,f.type)({state:(0,f.union)([(0,f.literal)("active"),(0,f.literal)("inactive"),(0,f.literal)("activating"),(0,f.literal)("deactivating")]),active:(0,f.number)(),inactive:(0,f.number)()}),th((0,f.array)((0,f.type)({signature:(0,f.string)(),slot:(0,f.number)(),err:tw,memo:(0,f.nullable)((0,f.string)()),blockTime:(0,f.optional)((0,f.nullable)((0,f.number)()))}))),th((0,f.array)((0,f.type)({signature:(0,f.string)(),slot:(0,f.number)(),err:tw,memo:(0,f.nullable)((0,f.string)()),blockTime:(0,f.optional)((0,f.nullable)((0,f.number)()))}))),(0,f.type)({subscription:(0,f.number)(),result:td(tS)});let tA=(0,f.type)({pubkey:ts,account:tS});(0,f.type)({subscription:(0,f.number)(),result:td(tA)});let tB=(0,f.type)({parent:(0,f.number)(),slot:(0,f.number)(),root:(0,f.number)()});(0,f.type)({subscription:(0,f.number)(),result:tB});let tP=(0,f.union)([(0,f.type)({type:(0,f.union)([(0,f.literal)("firstShredReceived"),(0,f.literal)("completed"),(0,f.literal)("optimisticConfirmation"),(0,f.literal)("root")
7]),slot:(0,f.number)(),timestamp:(0,f.number)()}),(0,f.type)({type:(0,f.literal)("createdBank"),parent:(0,f.number)(),slot:(0,f.number)(),timestamp:(0,f.number)()}),(0,f.type)({type:(0,f.literal)("frozen"),slot:(0,f.number)(),timestamp:(0,f.number)(),stats:(0,f.type)({numTransactionEntries:(0,f.number)(),numSuccessfulTransactions:(0,f.number)(),numFailedTransactions:(0,f.number)(),maxTransactionsPerEntry:(0,f.number)()})}),(0,f.type)({type:(0,f.literal)("dead"),slot:(0,f.number)(),timestamp:(0,f.number)(),err:(0,f.string)()})]);(0,f.type)({subscription:(0,f.number)(),result:tP}),(0,f.type)({subscription:(0,f.number)(),result:td((0,f.union)([tv,tk]))}),(0,f.type)({subscription:(0,f.number)(),result:(0,f.number)()}),(0,f.type)({pubkey:(0,f.string)(),gossip:(0,f.nullable)((0,f.string)()),tpu:(0,f.nullable)((0,f.string)()),rpc:(0,f.nullable)((0,f.string)()),version:(0,f.nullable)((0,f.string)())});let t_=(0,f.type)({votePubkey:(0,f.string)(),nodePubkey:(0,f.string)(),activatedStake:(0,f.number)(),epochVoteAccount:(0,f.boolean)(),epochCredits:(0,f.array)((0,f.tuple)([(0,f.number)(),(0,f.number)(),(0,f.number)()])),commission:(0,f.number)(),lastVote:(0,f.number)(),rootSlot:(0,f.nullable)((0,f.number)())});th((0,f.type)({current:(0,f.array)(t_),delinquent:(0,f.array)(t_)}));let tO=(0,f.union)([(0,f.literal)("processed"),(0,f.literal)("confirmed"),(0,f.literal)("finalized")]),tT=(0,f.type)({slot:(0,f.number)(),confirmations:(0,f.nullable)((0,f.number)()),err:tw,confirmationStatus:(0,f.optional)(tO)});tc((0,f.array)((0,f.nullable)(tT))),th((0,f.number)());let tC=(0,f.type)({accountKey:ts,writableIndexes:(0,f.array)((0,f.number)()),readonlyIndexes:(0,f.array)((0,f.number)())}),tL=(0,f.type)({signatures:(0,f.array)((0,f.string)()),message:(0,f.type)({accountKeys:(0,f.array)((0,f.string)()),header:(0,f.type)({numRequiredSignatures:(0,f.number)(),numReadonlySignedAccounts:(0,f.number)(),numReadonlyUnsignedAccounts:(0,f.number)()}),instructions:(0,f.array)((0,f.type)({accounts:(0,f.array)((0,f.number)()),data:(0,f.string)(),programIdIndex:(0,f.number)()})),recentBlockhash:(0,f.string)(),addressTableLookups:(0,f.optional)((0,f.array)(tC))})}),tR=(0,f.type)({pubkey:ts,signer:(0,f.boolean)(),writable:(0,f.boolean)(),source:(0,f.optional)((0,f.union)([(0,f.literal)("transaction"),(0,f.literal)("lookupTable")]))}),tz=(0,f.type)({accountKeys:(0,f.array)(tR),signatures:(0,f.array)((0,f.string)())}),t$=(0,f.type)({parsed:(0,f.unknown)(),program:(0,f.string)(),programId:ts}),tq=(0,f.type)({accounts:(0,f.array)(ts),data:(0,f.string)(),programId:ts}),tN=(0,f.union)([tq,t$]),tU=(0,f.union)([(0,f.type)({parsed:(0,f.unknown)(),program:(0,f.string)(),programId:(0,f.string)()}),(0,f.type)({accounts:(0,f.array)((0,f.string)()),data:(0,f.string)(),programId:(0,f.string)()})]),tW=(0,f.coerce)(tN,tU,t=>"accounts"in t?(0,f.create)(t,tq):(0,f.create)(t,t$)),tj=(0,f.type)({signatures:(0,f.array)((0,f.string)()),message:(0,f.type)({accountKeys:(0,f.array)(tR),instructions:(0,f.array)(tW),recentBlockhash:(0,f.string)(),addressTableLookups:(0,f.optional)((0,f.nullable)((0,f.array)(tC)))})}),tK=(0,f.type)({accountIndex:(0,f.number)(),mint:(0,f.string)(),owner:(0,f.optional)((0,f.string)()),uiTokenAmount:tx}),tF=(0,f.type)({writable:(0,f.array)(ts),readonly:(0,f.array)(ts)}),tD=(0,f.type)({err:tw,fee:(0,f.number)(),innerInstructions:(0,f.optional)((0,f.nullable)((0,f.array)((0,f.type)({index:(0,f.number)(),instructions:(0,f.array)((0,f.type)({accounts:(0,f.array)((0,f.number)()),data:(0,f.string)(),programIdIndex:(0,f.number)()}))})))),preBalances:(0,f.array)((0,f.number)()),postBalances:(0,f.array)((0,f.number)()),logMessages:(0,f.optional)((0,f.nullable)((0,f.array)((0,f.string)()))),preTokenBalances:(0,f.optional)((0,f.nullable)((0,f.array)(tK))),postTokenBalances:(0,f.optional)((0,f.nullable)((0,f.array)(tK))),loadedAddresses:(0,f.optional)(tF),computeUnitsConsumed:(0,f.optional)((0,f.number)())}),tG=(0,f.type)({err:tw,fee:(0,f.number)(),innerInstructions:(0,f.optional)((0,f.nullable)((0,f.array)((0,f.type)({index:(0,f.number)(),instructions:(0,f.array)(tW)})))),preBalances:(0,f.array)((0,f.number)()),postBalances:(0,f.array)((0,f.number)()),logMessages:(0,f.optional)((0,f.nullable)((0,f.array)((0,f.string)()))),preTokenBalances:(0,f.optional)((0,f.nullable)((0,f.array)(tK))),postTokenBalances:(0,f.optional)((0,f.nullable)((0,f.array)(tK))),loadedAddresses:(0,f.optional)(tF),computeUnitsConsumed:(0,f.optional)((0,f.number)())}),tH=(0,f.union)([(0,f.literal)(0),(0,f.literal)("legacy")]),tJ=(0,f.type)({pubkey:(0,f.string)(),lamports:(0,f.number)(),postBalance:(0,f.nullable)((0,f.number)()),rewardType:(0,f.nullable)((0,f.string)()),commission:(0,f.optional)((0,f.nullable)((0,f.number)()))});th((0,f.nullable)((0,f.type)({blockhash:(0,f.string)(),previousBlockhash:(0,f.string)(),parentSlot:(0,f.number)(),transactions:(0,f.array)((0,f.type)({transaction:tL,meta:(0,f.nullable)(tD),version:(0,f.optional)(tH)})),rewards:(0,f.optional)((0,f.array)(tJ)),blockTime:(0,f.nullable)((0,f.number)()),blockHeight:(0,f.nullable)((0,f.number)())}))),th((0,f.nullable)((0,f.type)({blockhash:(0,f.string)(),previousBlockhash:(0,f.string)(),parentSlot:(0,f.number)(),rewards:(0,f.optional)((0,f.array)(tJ)),blockTime:(0,f.nullable)((0,f.number)()),blockHeight:(0,f.nullable)((0,f.number)())}))),th((0,f.nullable)((0,f.type)({blockhash:(0,f.string)(),previousBlockhash:(0,f.string)(),parentSlot:(0,f.number)(),transactions:(0,f.array)((0,f.type)({transaction:tz,meta:(0,f.nullable)(tD),version:(0,f.optional)(tH)})),rewards:(0,f.optional)((0,f.array)(tJ)),blockTime:(0,f.nullable)((0,f.number)()),blockHeight:(0,f.nullable)((0,f.number)())}))),th((0,f.nullable)((0,f.type)({blockhash:(0,f.string)(),previousBlockhash:(0,f.string)(),parentSlot:(0,f.number)(),transactions:(0,f.array)((0,f.type)({transaction:tj,meta:(0,f.nullable)(tG),version:(0,f.optional)(tH)})),rewards:(0,f.optional)((0,f.array)(tJ)),blockTime:(0,f.nullable)((0,f.number)()),blockHeight:(0,f.nullable)((0,f.number)())}))),th((0,f.nullable)((0,f.type)({blockhash:(0,f.string)(),previousBlockhash:(0,f.string)(),parentSlot:(0,f.number)(),transactions:(0,f.array)((0,f.type)({transaction:tz,meta:(0,f.nullable)(tG),version:(0,f.optional)(tH)})),rewards:(0,f.optional)((0,f.array)(tJ)),blockTime:(0,f.nullable)((0,f.number)()),blockHeight:(0,f.nullable)((0,f.number)())}))),th((0,f.nullable)((0,f.type)({blockhash:(0,f.string)(),previousBlockhash:(0,f.string)(),parentSlot:(0,f.number)(),rewards:(0,f.optional)((0,f.array)(tJ)),blockTime:(0,f.nullable)((0,f.number)()),blockHeight:(0,f.nullable)((0,f.number)())}))),th((0,f.nullable)((0,f.type)({blockhash:(0,f.string)(),previousBlockhash:(0,f.string)(),parentSlot:(0,f.number)(),transactions:(0,f.array)((0,f.type)({transaction:tL,meta:(0,f.nullable)(tD)})),rewards:(0,f.optional)((0,f.array)(tJ)),blockTime:(0,f.nullable)((0,f.number)())}))),th((0,f.nullable)((0,f.type)({blockhash:(0,f.string)(),previousBlockhash:(0,f.string)(),parentSlot:(0,f.number)(),signatures:(0,f.array)((0,f.string)()),blockTime:(0,f.nullable)((0,f.number)())}))),th((0,f.nullable)((0,f.type)({slot:(0,f.number)(),meta:(0,f.nullable)(tD),blockTime:(0,f.optional)((0,f.nullable)((0,f.number)())),transaction:tL,version:(0,f.optional)(tH)}))),th((0,f.nullable)((0,f.type)({slot:(0,f.number)(),transaction:tj,meta:(0,f.nullable)(tG),blockTime:(0,f.optional)((0,f.nullable)((0,f.number)())),version:(0,f.optional)(tH)}))),tc((0,f.type)({blockhash:(0,f.string)(),feeCalculator:(0,f.type)({lamportsPerSignature:(0,f.number)()})}
7)),tc((0,f.type)({blockhash:(0,f.string)(),lastValidBlockHeight:(0,f.number)()})),tc((0,f.boolean)());let tV=(0,f.type)({slot:(0,f.number)(),numTransactions:(0,f.number)(),numSlots:(0,f.number)(),samplePeriodSecs:(0,f.number)()});th((0,f.array)(tV)),tc((0,f.nullable)((0,f.type)({feeCalculator:(0,f.type)({lamportsPerSignature:(0,f.number)()})}))),th((0,f.string)()),th((0,f.string)());let tZ=(0,f.type)({err:tw,logs:(0,f.array)((0,f.string)()),signature:(0,f.string)()});(0,f.type)({result:td(tZ),subscription:(0,f.number)()});class tY{constructor(t){this._keypair=void 0,this._keypair=t??y()}static generate(){return new tY(y())}static fromSecretKey(t,e){if(64!==t.byteLength)throw Error("bad secret key size");let r=t.slice(32,64);if(!e||!e.skipValidation){let e=b(t.slice(0,32));for(let t=0;t<32;t++)if(r[t]!==e[t])throw Error("provided secretKey is invalid")}return new tY({publicKey:r,secretKey:t})}static fromSeed(t){let e=b(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),new tY({publicKey:e,secretKey:r})}get publicKey(){return new E(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}let tX=Object.freeze({CreateLookupTable:{index:0,layout:c.n_([c.Jq("instruction"),te("recentSlot"),c.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:c.n_([c.Jq("instruction")])},ExtendLookupTable:{index:2,layout:c.n_([c.Jq("instruction"),te(),c.A9(O(),c.cv(c.Jq(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:c.n_([c.Jq("instruction")])},CloseLookupTable:{index:4,layout:c.n_([c.Jq("instruction")])}});class tQ{constructor(){}static createLookupTable(t){let[e,r]=E.findProgramAddressSync([t.authority.toBuffer(),(0,d.k$)(BigInt(t.recentSlot),8)],this.programId),n=Y(tX.CreateLookupTable,{recentSlot:BigInt(t.recentSlot),bumpSeed:r}),i=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:tn.programId,isSigner:!1,isWritable:!1}];return[new K({programId:this.programId,keys:i,data:n}),e]}static freezeLookupTable(t){let e=Y(tX.FreezeLookupTable),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new K({programId:this.programId,keys:r,data:e})}static extendLookupTable(t){let e=Y(tX.ExtendLookupTable,{addresses:t.addresses.map(t=>t.toBytes())}),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return t.payer&&r.push({pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:tn.programId,isSigner:!1,isWritable:!1}),new K({programId:this.programId,keys:r,data:e})}static deactivateLookupTable(t){let e=Y(tX.DeactivateLookupTable),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new K({programId:this.programId,keys:r,data:e})}static closeLookupTable(t){let e=Y(tX.CloseLookupTable),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.recipient,isSigner:!1,isWritable:!0}];return new K({programId:this.programId,keys:r,data:e})}}tQ.programId=new E("AddressLookupTab1e1111111111111111111111111");let t0=Object.freeze({RequestUnits:{index:0,layout:c.n_([c.u8("instruction"),c.Jq("units"),c.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:c.n_([c.u8("instruction"),c.Jq("bytes")])},SetComputeUnitLimit:{index:2,layout:c.n_([c.u8("instruction"),c.Jq("units")])},SetComputeUnitPrice:{index:3,layout:c.n_([c.u8("instruction"),te("microLamports")])}});class t1{constructor(){}static requestUnits(t){let e=Y(t0.RequestUnits,t);return new K({keys:[],programId:this.programId,data:e})}static requestHeapFrame(t){let e=Y(t0.RequestHeapFrame,t);return new K({keys:[],programId:this.programId,data:e})}static setComputeUnitLimit(t){let e=Y(t0.SetComputeUnitLimit,t);return new K({keys:[],programId:this.programId,data:e})}static setComputeUnitPrice(t){let e=Y(t0.SetComputeUnitPrice,{microLamports:BigInt(t.microLamports)});return new K({keys:[],programId:this.programId,data:e})}}t1.programId=new E("ComputeBudget111111111111111111111111111111");let t2=c.n_([c.u8("numSignatures"),c.u8("padding"),c.KB("signatureOffset"),c.KB("signatureInstructionIndex"),c.KB("publicKeyOffset"),c.KB("publicKeyInstructionIndex"),c.KB("messageDataOffset"),c.KB("messageDataSize"),c.KB("messageInstructionIndex")]
vendor: 11,978 bytes, line 7
7);class t8{constructor(){}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:i,instructionIndex:s}=t;R(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),R(64===i.length,`Signature must be 64 bytes but received ${i.length} bytes`);let o=t2.span,a=o+e.length,u=a+i.length,l=n.Buffer.alloc(u+r.length),h=null==s?65535:s;return t2.encode({numSignatures:1,padding:0,signatureOffset:a,signatureInstructionIndex:h,publicKeyOffset:o,publicKeyInstructionIndex:h,messageDataOffset:u,messageDataSize:r.length,messageInstructionIndex:h},l),l.fill(e,o),l.fill(i,a),l.fill(r,u),new K({keys:[],programId:t8.programId,data:l})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:n}=t;R(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{let t=tY.fromSecretKey(e),i=t.publicKey.toBytes(),s=v(r,t.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:s,instructionIndex:n})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}t8.programId=new E("Ed25519SigVerify111111111111111111111111111");let t6=(t,e)=>{let r=m.kA.sign(t,e);return[r.toCompactRawBytes(),r.recovery]};m.kA.utils.isValidPrivateKey;let t3=m.kA.getPublicKey,t4=c.n_([c.u8("numSignatures"),c.KB("signatureOffset"),c.u8("signatureInstructionIndex"),c.KB("ethAddressOffset"),c.u8("ethAddressInstructionIndex"),c.KB("messageDataOffset"),c.KB("messageDataSize"),c.u8("messageInstructionIndex"),c.Ik(20,"ethAddress"),c.Ik(64,"signature"),c.u8("recoveryId")]);class t5{constructor(){}static publicKeyToEthAddress(t){R(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return n.Buffer.from((0,g.fr)(x(t))).slice(-20)}catch(t){throw Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:n,recoveryId:i,instructionIndex:s}=t;return t5.createInstructionWithEthAddress({ethAddress:t5.publicKeyToEthAddress(e),message:r,signature:n,recoveryId:i,instructionIndex:s})}static createInstructionWithEthAddress(t){let e;let{ethAddress:r,message:i,signature:s,recoveryId:o,instructionIndex:a=0}=t;R(20===(e="string"==typeof r?r.startsWith("0x")?n.Buffer.from(r.substr(2),"hex"):n.Buffer.from(r,"hex"):r).length,`Address must be 20 bytes but received ${e.length} bytes`);let u=12+e.length,l=u+s.length+1,h=n.Buffer.alloc(t4.span+i.length);return t4.encode({numSignatures:1,signatureOffset:u,signatureInstructionIndex:a,ethAddressOffset:12,ethAddressInstructionIndex:a,messageDataOffset:l,messageDataSize:i.length,messageInstructionIndex:a,signature:x(s),ethAddress:x(e),recoveryId:o},h),h.fill(x(i),t4.span),new K({keys:[],programId:t5.programId,data:h})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:i}=t;R(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{let t=x(e),s=t3(t,!1).slice(1),o=n.Buffer.from((0,g.fr)(x(r))),[a,u]=t6(o,t);return this.createInstructionWithPublicKey({publicKey:s,message:r,signature:a,recoveryId:u,instructionIndex:i})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}t5.programId=new E("KeccakSecp256k11111111111111111111111111111");let t7=new E("StakeConfig11111111111111111111111111111111");class t9{constructor(t,e,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=r}}t9.default=new t9(0,0,E.default);let et=Object.freeze({Initialize:{index:0,layout:c.n_([c.Jq("instruction"),((t="authorized")=>c.n_([O("staker"),O("withdrawer")],t))(),((t="lockup")=>c.n_([c.gM("unixTimestamp"),c.gM("epoch"),O("custodian")],t))()])},Authorize:{index:1,layout:c.n_([c.Jq("instruction"),O("newAuthorized"),c.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:c.n_([c.Jq("instruction")])},Split:{index:3,layout:c.n_([c.Jq("instruction"),c.gM("lamports")])},Withdraw:{index:4,layout:c.n_([c.Jq("instruction"),c.gM("lamports")])},Deactivate:{index:5,layout:c.n_([c.Jq("instruction")])},Merge:{index:7,layout:c.n_([c.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:c.n_([c.Jq("instruction"),O("newAuthorized"),c.Jq("stakeAuthorizationType"),T("authoritySeed"),O("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class ee{constructor(){}static initialize(t){let{stakePubkey:e,authorized:r,lockup:n}=t,i=n||t9.default,s=Y(et.Initialize,{authorized:{staker:x(r.staker.toBuffer()),withdrawer:x(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:x(i.custodian.toBuffer())}});return new K({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:H,isSigner:!1,isWritable:!1}],programId:this.programId,data:s})}static createAccountWithSeed(t){let e=new F;e.add(tn.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(t){let e=new F;e.add(tn.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:r,votePubkey:n}=t,i=Y(et.Delegate);return new F().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:J,isSigner:!1,isWritable:!1},{pubkey:t7,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(t){let{stakePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:s}=t,o=Y(et.Authorize,{newAuthorized:x(n.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:D,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return s&&a.push({pubkey:s,isSigner:!0,isWritable:!1}),new F().add({keys:a,programId:this.programId,data:o})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:s,stakeAuthorizationType:o,custodianPubkey:a}=t,u=Y(et.AuthorizeWithSeed,{newAuthorized:x(s.toBuffer()),stakeAuthorizationType:o.index,authoritySeed:n,authorityOwner:x(i.toBuffer())}),l=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:D,isSigner:!1,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!0,isWritable:!1}),new F().add({keys:l,programId:this.programId,data:u})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=t,s=Y(et.Split,{lamports:i});return new K({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static split(t,e){let r=new F;return r.add(tn.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),r.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,basePubkey:s,seed:o,lamports:a}=t,u=new F;return u.add(tn.allocate({accountPubkey:i,basePubkey:s,seed:o,space:this.space,programId:this.programId})),e&&e>0&&u.add(tn.transfer({fromPubkey:t.authorizedPubkey,toPubkey:i,lamports:e})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,lamports:a}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:r,authorizedPubkey:n}=t,i=Y(et.Merge);return new F().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:J,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:s}=t,o=Y(et.Withdraw,{lamports:i}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:J,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return s&&a.push({pubkey:s,isSigner:!0,isWritable:!1}),new F().add({keys:a,programId:this.programId,data:o})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:r}=t,n=Y(et.Deactivate);return new F().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}ee.programId=new E("Stake11111111111111111111111111111111111111"),ee.space=200;let er=Object.freeze({InitializeAccount:{index:0,layout:c.n_([c.Jq("instruction"),((t="voteInit")=>c.n_([O("nodePubkey"),O("authorizedVoter"),O("authorizedWithdrawer"),c.u8("commission")],t))()])},Authorize:{index:1,layout:c.n_([c.Jq("instruction"),O("newAuthorized"),c.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:c.n_([c.Jq("instruction"),c.gM("lamports")])},UpdateValidatorIdentity:{index:4,layout:c.n_([c.Jq("instruction")])},AuthorizeWithSeed:{index:10,layout:c.n_([c.Jq("instruction"),((t="voteAuthorizeWithSeedArgs")=>c.n_([c.Jq("voteAuthorizationType"),O("currentAuthorityDerivedKeyOwnerPubkey"),T("currentAuthorityDerivedKeySeed"),O("newAuthorized")],t))()])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class en{constructor(){}static initializeAccount(t){let{votePubkey:e,nodePubkey:r,voteInit:n}=t,i=Y(er.InitializeAccount,{voteInit:{nodePubkey:x(n.nodePubkey.toBuffer()),authorizedVoter:x(n.authorizedVoter.toBuffer()),authorizedWithdrawer:x(n.authorizedWithdrawer.toBuffer()),commission:n.commission}});return new K({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:H,isSigner:!1,isWritable:!1},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static createAccount(t){let e=new F;return e.add(tn.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=t,s=Y(er.Authorize,{newAuthorized:x(n.toBuffer()),voteAuthorizationType:i.index});return new F().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:i,voteAuthorizationType:s,votePubkey:o}=t,a=Y(er.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:x(r.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:x(i.toBuffer()),voteAuthorizationType:s.index}});return new F().add({keys:[{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=t,s=Y(er.Withdraw,{lamports:n});return new F().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static safeWithdraw(t,e,r){if(t.lamports>e-r)throw Error("Withdraw will leave vote account with insufficient funds.");return en.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,nodePubkey:n}=t,i=Y(er.UpdateValidatorIdentity);return new F().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}en.programId=new E("Vote111111111111111111111111111111111111111"),en.space
7=3762,new E("Va1idator1nfo111111111111111111111111111111"),(0,f.type)({name:(0,f.string)(),website:(0,f.optional)((0,f.string)()),details:(0,f.optional)((0,f.string)()),keybaseUsername:(0,f.optional)((0,f.string)())}),new E("Vote111111111111111111111111111111111111111"),c.n_([O("nodePubkey"),O("authorizedWithdrawer"),c.u8("commission"),c._O(),c.A9(c.n_([c._O("slot"),c.Jq("confirmationCount")]),c.cv(c.Jq(),-8),"votes"),c.u8("rootSlotValid"),c._O("rootSlot"),c._O(),c.A9(c.n_([c._O("epoch"),O("authorizedVoter")]),c.cv(c.Jq(),-8),"authorizedVoters"),c.n_([c.A9(c.n_([O("authorizedPubkey"),c._O("epochOfLastAuthorizedSwitch"),c._O("targetEpoch")]),32,"buf"),c._O("idx"),c.u8("isEmpty")],"priorVoters"),c._O(),c.A9(c.n_([c._O("epoch"),c._O("credits"),c._O("prevCredits")]),c.cv(c.Jq(),-8),"epochCredits"),c.n_([c._O("slot"),c._O("timestamp")],"lastTimestamp")])},42306:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}
vendor: 9,440 bytes, line 7
7"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{c="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(74043).Buffer}catch(t){}function o(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function a(t,e,r){var n=o(t,r);return r-1>=e&&(n|=o(t,r-1)<<4),n}function u(t,e,r,i){for(var s=0,o=0,a=Math.min(t.length,r),u=e;u<a;u++){var l=t.charCodeAt(u)-48;s*=i,o=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&o<i,"Invalid character"),s+=o}return s}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return 0>t.cmp(e)?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var i,s,o=0;o<this.length;o++)this.words[o]=0;var a=0;if("be"===r)for(o=t.length-1,i=0;o>=0;o-=3)s=t[o]|t[o-1]<<8|t[o-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(o=0,i=0;o<t.length;o+=3)s=t[o]|t[o+1]<<8|t[o+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var n,i=0;i<this.length;i++)this.words[i]=0;var s=0,o=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=a(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=a(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,o=s%n,a=Math.min(s,s-o)+r,l=0,h=r;h<a;h+=n)l=u(t,h,h+n,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var c=1;for(l=u(t,h,t.length,e),h=0;h<o;h++)c*=e;this.imuln(c),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},s.prototype.copy=function(t){t.words=Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype._move=function(t){l(t,this)},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){s.prototype.inspect=h}else s.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var c,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"],f=[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],p=[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];function g(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,u=o/67108864|0;r.words[0]=a;for(var l=1;l<n;l++){for(var h=u>>>26,c=67108863&u,d=Math.min(l,e.length-1),f=Math.max(0,l-t.length+1);f<=d;f++){var p=l-f|0;h+=(o=(i=0|t.words[p])*(s=0|e.words[f])+c)/67108864|0,c=67108863&o}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}s.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var r,i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],u=((a<<i|s)&16777215).toString(16);s=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==s||o!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],h=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var g=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?g+r:d[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},c&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(c,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0");var o=t.allocUnsafe?t.allocUnsafe(s):new t(s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,i),o},s.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|n;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===s?(r<t.length&&(t[r++]=o>>24&255),n=0,s=0):(n=o>>>24,s+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},s.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|n;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),n=0,s=0):(n=o>>>24,s+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},s.prototype.ior=function(t){return n((this.negative|t.negative)==0),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},s.prototype.iand=function(t){return n((this.negative|t.negative)==0),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},s.prototype.ixor=function(t){return n((this.negative|t.negative)==0),this.iuxor(t)}
vendor: 7,815 bytes, line 7
7,s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<<i:this.words[r]=this.words[r]&~(1<<i),this._strip()},s.prototype.iadd=function(t){if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var e,r,n,i=0,s=0;s<n.length;s++)e=(0|r.words[s])+(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<r.length;s++)e=(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(n=(0|e.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&n;for(;0!==s&&o<e.length;o++)s=(n=(0|e.words[o])+s)>>26,this.words[o]=67108863&n;if(0===s&&o<e.length&&e!==this)for(;o<e.length;o++)this.words[o]=e.words[o];return this.length=Math.max(this.length,o),e!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,r){var n,i,s,o=t.words,a=e.words,u=r.words,l=0,h=0|o[0],c=8191&h,d=h>>>13,f=0|o[1],p=8191&f,g=f>>>13,m=0|o[2],y=8191&m,b=m>>>13,w=0|o[3],v=8191&w,k=w>>>13,x=0|o[4],I=8191&x,S=x>>>13,M=0|o[5],E=8191&M,A=M>>>13,B=0|o[6],P=8191&B,_=B>>>13,O=0|o[7],T=8191&O,C=O>>>13,L=0|o[8],R=8191&L,z=L>>>13,$=0|o[9],q=8191&$,N=$>>>13,U=0|a[0],W=8191&U,j=U>>>13,K=0|a[1],F=8191&K,D=K>>>13,G=0|a[2],H=8191&G,J=G>>>13,V=0|a[3],Z=8191&V,Y=V>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,te=0|a[5],tr=8191&te,tn=te>>>13,ti=0|a[6],ts=8191&ti,to=ti>>>13,ta=0|a[7],tu=8191&ta,tl=ta>>>13,th=0|a[8],tc=8191&th,td=th>>>13,tf=0|a[9],tp=8191&tf,tg=tf>>>13;r.negative=t.negative^e.negative,r.length=19;var tm=(l+(n=Math.imul(c,W))|0)+((8191&(i=(i=Math.imul(c,j))+Math.imul(d,W)|0))<<13)|0;l=((s=Math.imul(d,j))+(i>>>13)|0)+(tm>>>26)|0,tm&=67108863,n=Math.imul(p,W),i=(i=Math.imul(p,j))+Math.imul(g,W)|0,s=Math.imul(g,j);var ty=(l+(n=n+Math.imul(c,F)|0)|0)+((8191&(i=(i=i+Math.imul(c,D)|0)+Math.imul(d,F)|0))<<13)|0;l=((s=s+Math.imul(d,D)|0)+(i>>>13)|0)+(ty>>>26)|0,ty&=67108863,n=Math.imul(y,W),i=(i=Math.imul(y,j))+Math.imul(b,W)|0,s=Math.imul(b,j),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,D)|0)+Math.imul(g,F)|0,s=s+Math.imul(g,D)|0;var tb=(l+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(d,H)|0))<<13)|0;l=((s=s+Math.imul(d,J)|0)+(i>>>13)|0)+(tb>>>26)|0,tb&=67108863,n=Math.imul(v,W),i=(i=Math.imul(v,j))+Math.imul(k,W)|0,s=Math.imul(k,j),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,D)|0)+Math.imul(b,F)|0,s=s+Math.imul(b,D)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,J)|0;var tw=(l+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,Z)|0))<<13)|0;l=((s=s+Math.imul(d,Y)|0)+(i>>>13)|0)+(tw>>>26)|0,tw&=67108863,n=Math.imul(I,W),i=(i=Math.imul(I,j))+Math.imul(S,W)|0,s=Math.imul(S,j),n=n+Math.imul(v,F)|0,i=(i=i+Math.imul(v,D)|0)+Math.imul(k,F)|0,s=s+Math.imul(k,D)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(b,H)|0,s=s+Math.imul(b,J)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,Y)|0;var tv=(l+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;l=((s=s+Math.imul(d,tt)|0)+(i>>>13)|0)+(tv>>>26)|0,tv&=67108863,n=Math.imul(E,W),i=(i=Math.imul(E,j))+Math.imul(A,W)|0,s=Math.imul(A,j),n=n+Math.imul(I,F)|0,i=(i=i+Math.imul(I,D)|0)+Math.imul(S,F)|0,s=s+Math.imul(S,D)|0,n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(k,H)|0,s=s+Math.imul(k,J)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,Z)|0,s=s+Math.imul(b,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,tt)|0;var tk=(l+(n=n+Math.imul(c,tr)|0)|0)+((8191&(i=(i=i+Math.imul(c,tn)|0)+Math.imul(d,tr)|0))<<13)|0;l=((s=s+Math.imul(d,tn)|0)+(i>>>13)|0)+(tk>>>26)|0,tk&=67108863,n=Math.imul(P,W),i=(i=Math.imul(P,j))+Math.imul(_,W)|0,s=Math.imul(_,j),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,D)|0)+Math.imul(A,F)|0,s=s+Math.imul(A,D)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(S,H)|0,s=s+Math.imul(S,J)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(k,Z)|0,s=s+Math.imul(k,Y)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,s=s+Math.imul(b,tt)|0,n=n+Math.imul(p,tr)|0,i=(i=i+Math.imul(p,tn)|0)+Math.imul(g,tr)|0,s=s+Math.imul(g,tn)|0;var tx=(l+(n=n+Math.imul(c,ts)|0)|0)+((8191&(i=(i=i+Math.imul(c,to)|0)+Math.imul(d,ts)|0))<<13)|0;l=((s=s+Math.imul(d,to)|0)+(i>>>13)|0)+(tx>>>26)|0,tx&=67108863,n=Math.imul(T,W),i=(i=Math.imul(T,j))+Math.imul(C,W)|0,s=Math.imul(C,j),n=n+Math.imul(P,F)|0,i=(i=i+Math.imul(P,D)|0)+Math.imul(_,F)|0,s=s+Math.imul(_,D)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(A,H)|0,s=s+Math.imul(A,J)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(S,Z)|0,s=s+Math.imul(S,Y)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,tt)|0,n=n+Math.imul(y,tr)|0,i=(i=i+Math.imul(y,tn)|0)+Math.imul(b,tr)|0,s=s+Math.imul(b,tn)|0,n=n+Math.imul(p,ts)|0,i=(i=i+Math.imul(p,to)|0)+Math.imul(g,ts)|0,s=s+Math.imul(g,to)|0;var tI=(l+(n=n+Math.imul(c,tu)|0)|0)+((8191&(i=(i=i+Math.imul(c,tl)|0)+Math.imul(d,tu)|0))<<13)|0;l=((s=s+Math.imul(d,tl)|0)+(i>>>13)|0)+(tI>>>26)|0,tI&=67108863,n=Math.imul(R,W),i=(i=Math.imul(R,j))+Math.imul(z,W)|0,s=Math.imul(z,j),n=n+Math.imul(T,F)|0,i=(i=i+Math.imul(T,D)|0)+Math.imul(C,F)|0,s=s+Math.imul(C,D)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,J)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,Z)|0,s=s+Math.imul(A,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,tt)|0,n=n+Math.imul(v,tr)|0,i=(i=i+Math.imul(v,tn)|0)+Math.imul(k,tr)|0,s=s+Math.imul(k,tn)|0,n=n+Math.imul(y,ts)|0,i=(i=i+Math.imul(y,to)|0)+Math.imul(b,ts)|0,s=s+Math.imul(b,to)|0,n=n+Math.imul(p,tu)|0,i=(i=i+Math.imul(p,tl)|0)+Math.imul(g,tu)|0,s=s+Math.imul(g,tl)|0;var tS=(l+(n=n+Math.imul(c,tc)|0)|0)+((8191&(i=(i=i+Math.imul(c,td)|0)+Math.imul(d,tc)|0))<<13)|0;l=((s=s+Math.imul(d,td)|0)+(i>>>13)|0)+(tS>>>26)|0,tS&=67108863,n=Math.imul(q,W),i=(i=Math.imul(q,j))+Math.imul(N,W)|0,s=Math.imul(N,j),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,D)|0)+Math.imul(z,F)|0,s=s+Math.imul(z,D)|0,n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(C,H)|0,s=s+Math.imul(C,J)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(_,Z)|0,s=s+Math.imul(_,Y)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,tt)|0,n=n+Math.imul(I,tr)|0,i=(i=i+Math.imul(I,tn
vendor: 5,284 bytes, line 7
7)|0)+Math.imul(S,tr)|0,s=s+Math.imul(S,tn)|0,n=n+Math.imul(v,ts)|0,i=(i=i+Math.imul(v,to)|0)+Math.imul(k,ts)|0,s=s+Math.imul(k,to)|0,n=n+Math.imul(y,tu)|0,i=(i=i+Math.imul(y,tl)|0)+Math.imul(b,tu)|0,s=s+Math.imul(b,tl)|0,n=n+Math.imul(p,tc)|0,i=(i=i+Math.imul(p,td)|0)+Math.imul(g,tc)|0,s=s+Math.imul(g,td)|0;var tM=(l+(n=n+Math.imul(c,tp)|0)|0)+((8191&(i=(i=i+Math.imul(c,tg)|0)+Math.imul(d,tp)|0))<<13)|0;l=((s=s+Math.imul(d,tg)|0)+(i>>>13)|0)+(tM>>>26)|0,tM&=67108863,n=Math.imul(q,F),i=(i=Math.imul(q,D))+Math.imul(N,F)|0,s=Math.imul(N,D),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(z,H)|0,s=s+Math.imul(z,J)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(C,Z)|0,s=s+Math.imul(C,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,n=n+Math.imul(E,tr)|0,i=(i=i+Math.imul(E,tn)|0)+Math.imul(A,tr)|0,s=s+Math.imul(A,tn)|0,n=n+Math.imul(I,ts)|0,i=(i=i+Math.imul(I,to)|0)+Math.imul(S,ts)|0,s=s+Math.imul(S,to)|0,n=n+Math.imul(v,tu)|0,i=(i=i+Math.imul(v,tl)|0)+Math.imul(k,tu)|0,s=s+Math.imul(k,tl)|0,n=n+Math.imul(y,tc)|0,i=(i=i+Math.imul(y,td)|0)+Math.imul(b,tc)|0,s=s+Math.imul(b,td)|0;var tE=(l+(n=n+Math.imul(p,tp)|0)|0)+((8191&(i=(i=i+Math.imul(p,tg)|0)+Math.imul(g,tp)|0))<<13)|0;l=((s=s+Math.imul(g,tg)|0)+(i>>>13)|0)+(tE>>>26)|0,tE&=67108863,n=Math.imul(q,H),i=(i=Math.imul(q,J))+Math.imul(N,H)|0,s=Math.imul(N,J),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(z,Z)|0,s=s+Math.imul(z,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,n=n+Math.imul(P,tr)|0,i=(i=i+Math.imul(P,tn)|0)+Math.imul(_,tr)|0,s=s+Math.imul(_,tn)|0,n=n+Math.imul(E,ts)|0,i=(i=i+Math.imul(E,to)|0)+Math.imul(A,ts)|0,s=s+Math.imul(A,to)|0,n=n+Math.imul(I,tu)|0,i=(i=i+Math.imul(I,tl)|0)+Math.imul(S,tu)|0,s=s+Math.imul(S,tl)|0,n=n+Math.imul(v,tc)|0,i=(i=i+Math.imul(v,td)|0)+Math.imul(k,tc)|0,s=s+Math.imul(k,td)|0;var tA=(l+(n=n+Math.imul(y,tp)|0)|0)+((8191&(i=(i=i+Math.imul(y,tg)|0)+Math.imul(b,tp)|0))<<13)|0;l=((s=s+Math.imul(b,tg)|0)+(i>>>13)|0)+(tA>>>26)|0,tA&=67108863,n=Math.imul(q,Z),i=(i=Math.imul(q,Y))+Math.imul(N,Z)|0,s=Math.imul(N,Y),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(z,Q)|0,s=s+Math.imul(z,tt)|0,n=n+Math.imul(T,tr)|0,i=(i=i+Math.imul(T,tn)|0)+Math.imul(C,tr)|0,s=s+Math.imul(C,tn)|0,n=n+Math.imul(P,ts)|0,i=(i=i+Math.imul(P,to)|0)+Math.imul(_,ts)|0,s=s+Math.imul(_,to)|0,n=n+Math.imul(E,tu)|0,i=(i=i+Math.imul(E,tl)|0)+Math.imul(A,tu)|0,s=s+Math.imul(A,tl)|0,n=n+Math.imul(I,tc)|0,i=(i=i+Math.imul(I,td)|0)+Math.imul(S,tc)|0,s=s+Math.imul(S,td)|0;var tB=(l+(n=n+Math.imul(v,tp)|0)|0)+((8191&(i=(i=i+Math.imul(v,tg)|0)+Math.imul(k,tp)|0))<<13)|0;l=((s=s+Math.imul(k,tg)|0)+(i>>>13)|0)+(tB>>>26)|0,tB&=67108863,n=Math.imul(q,Q),i=(i=Math.imul(q,tt))+Math.imul(N,Q)|0,s=Math.imul(N,tt),n=n+Math.imul(R,tr)|0,i=(i=i+Math.imul(R,tn)|0)+Math.imul(z,tr)|0,s=s+Math.imul(z,tn)|0,n=n+Math.imul(T,ts)|0,i=(i=i+Math.imul(T,to)|0)+Math.imul(C,ts)|0,s=s+Math.imul(C,to)|0,n=n+Math.imul(P,tu)|0,i=(i=i+Math.imul(P,tl)|0)+Math.imul(_,tu)|0,s=s+Math.imul(_,tl)|0,n=n+Math.imul(E,tc)|0,i=(i=i+Math.imul(E,td)|0)+Math.imul(A,tc)|0,s=s+Math.imul(A,td)|0;var tP=(l+(n=n+Math.imul(I,tp)|0)|0)+((8191&(i=(i=i+Math.imul(I,tg)|0)+Math.imul(S,tp)|0))<<13)|0;l=((s=s+Math.imul(S,tg)|0)+(i>>>13)|0)+(tP>>>26)|0,tP&=67108863,n=Math.imul(q,tr),i=(i=Math.imul(q,tn))+Math.imul(N,tr)|0,s=Math.imul(N,tn),n=n+Math.imul(R,ts)|0,i=(i=i+Math.imul(R,to)|0)+Math.imul(z,ts)|0,s=s+Math.imul(z,to)|0,n=n+Math.imul(T,tu)|0,i=(i=i+Math.imul(T,tl)|0)+Math.imul(C,tu)|0,s=s+Math.imul(C,tl)|0,n=n+Math.imul(P,tc)|0,i=(i=i+Math.imul(P,td)|0)+Math.imul(_,tc)|0,s=s+Math.imul(_,td)|0;var t_=(l+(n=n+Math.imul(E,tp)|0)|0)+((8191&(i=(i=i+Math.imul(E,tg)|0)+Math.imul(A,tp)|0))<<13)|0;l=((s=s+Math.imul(A,tg)|0)+(i>>>13)|0)+(t_>>>26)|0,t_&=67108863,n=Math.imul(q,ts),i=(i=Math.imul(q,to))+Math.imul(N,ts)|0,s=Math.imul(N,to),n=n+Math.imul(R,tu)|0,i=(i=i+Math.imul(R,tl)|0)+Math.imul(z,tu)|0,s=s+Math.imul(z,tl)|0,n=n+Math.imul(T,tc)|0,i=(i=i+Math.imul(T,td)|0)+Math.imul(C,tc)|0,s=s+Math.imul(C,td)|0;var tO=(l+(n=n+Math.imul(P,tp)|0)|0)+((8191&(i=(i=i+Math.imul(P,tg)|0)+Math.imul(_,tp)|0))<<13)|0;l=((s=s+Math.imul(_,tg)|0)+(i>>>13)|0)+(tO>>>26)|0,tO&=67108863,n=Math.imul(q,tu),i=(i=Math.imul(q,tl))+Math.imul(N,tu)|0,s=Math.imul(N,tl),n=n+Math.imul(R,tc)|0,i=(i=i+Math.imul(R,td)|0)+Math.imul(z,tc)|0,s=s+Math.imul(z,td)|0;var tT=(l+(n=n+Math.imul(T,tp)|0)|0)+((8191&(i=(i=i+Math.imul(T,tg)|0)+Math.imul(C,tp)|0))<<13)|0;l=((s=s+Math.imul(C,tg)|0)+(i>>>13)|0)+(tT>>>26)|0,tT&=67108863,n=Math.imul(q,tc),i=(i=Math.imul(q,td))+Math.imul(N,tc)|0,s=Math.imul(N,td);var tC=(l+(n=n+Math.imul(R,tp)|0)|0)+((8191&(i=(i=i+Math.imul(R,tg)|0)+Math.imul(z,tp)|0))<<13)|0;l=((s=s+Math.imul(z,tg)|0)+(i>>>13)|0)+(tC>>>26)|0,tC&=67108863;var tL=(l+(n=Math.imul(q,tp))|0)+((8191&(i=(i=Math.imul(q,tg))+Math.imul(N,tp)|0))<<13)|0;return l=((s=Math.imul(N,tg))+(i>>>13)|0)+(tL>>>26)|0,tL&=67108863,u[0]=tm,u[1]=ty,u[2]=tb,u[3]=tw,u[4]=tv,u[5]=tk,u[6]=tx,u[7]=tI,u[8]=tS,u[9]=tM,u[10]=tE,u[11]=tA,u[12]=tB,u[13]=tP,u[14]=t_,u[15]=tO,u[16]=tT,u[17]=tC,u[18]=tL,0!==l&&(u[19]=l,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,s=0;s<r.length-1;s++){var o=i;i=0;
vendor: 20,618 bytes, line 7
7for(var a=67108863&n,u=Math.min(s,e.length-1),l=Math.max(0,s-t.length+1);l<=u;l++){var h=s-l,c=(0|t.words[h])*(0|e.words[l]),d=67108863&c;o=o+(c/67108864|0)|0,a=67108863&(d=d+a|0),i+=(o=o+(d>>>26)|0)>>>26,o&=67108863}r.words[s]=a,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r._strip()}function b(t,e){this.x=t,this.y=e}Math.imul||(m=g),s.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):n<63?g(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,s){for(var o=0;o<s;o++)n[o]=e[t[o]],i[o]=r[t[o]]},b.prototype.transform=function(t,e,r,n,i,s){this.permute(s,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var a=o<<1,u=Math.cos(2*Math.PI/a),l=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,d=l,f=0;f<o;f++){var p=r[h+f],g=n[h+f],m=r[h+f+o],y=n[h+f+o],b=c*m-d*y;y=c*y+d*m,m=b,r[h+f]=p+m,n[h+f]=g+y,r[h+f+o]=p-m,n[h+f+o]=g-y,f!==a&&(b=u*c-l*d,d=u*d+l*c,c=b)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,i){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===s),n((-8192&s)==0)},b.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),s=this.stub(n),o=Array(n),a=Array(n),u=Array(n),l=Array(n),h=Array(n),c=Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,l,n),this.transform(o,s,a,u,n,i),this.transform(l,s,h,c,n,i);for(var f=0;f<n;f++){var p=a[f]*h[f]-u[f]*c[f];u[f]=a[f]*c[f]+u[f]*h[f],a[f]=p}return this.conjugate(a,u,n),this.transform(a,u,d,s,n,i),this.conjugate(d,s,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=Array(this.length+t.length),y(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var s=(0|this.words[i])*t,o=(67108863&s)+(67108863&r);r>>=26,r+=(s/67108864|0)+(o>>>26),this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),this.length=0===t?1:this.length,e?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,u=(0|this.words[e])-a<<r;this.words[e]=u|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},s.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var i,s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s;if(i-=o,i=Math.max(0,i),r){for(var u=0;u<o;u++)r.words[u]=this.words[u];r.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var h=0|this.words[u];this.words[u]=l<<26-s|h>>>s,l=h&a}return r&&0!==l&&(r.words[r.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return!(this.length<=r)&&!!(this.words[r]&1<<e)},s.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==e&&r++,this.length=Math.min(r,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<<e),this._strip())},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return(n("number"==typeof t),n(t<67108864),t<0)?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var i,s,o=t.length+r;this._expand(o);var a=0;for(i=0;i<t.length;i++){s=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;s-=67108863&u,a=(s>>26)-(u/67108864|0),this.words[i+r]=67108863&s}for(;i<this.length-r;i++)a=(s=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&s;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(s=-(0|this.words[i])+a)>>26,this.words[i]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var r,n=this.length-t.length,i=this.clone(),o=t,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),i.iushln(n),a=0|o.words[o.length-1]);var u=i.length-o.length;if("mod"!==e){(r=new s(null)).length=u+1,r.words=Array(r.length);for(var l=0;l<r.length;l++)r.words[l]=0}var h=i.clone()._ishlnsubmul(o,1,u);0===h.negative&&(i=h,r&&(r.words[u]=1));for(var c=u-1;c>=0;c--){var d=(0|i.words[o.length+c])*67108864+(0|i.words[o.length+c-1]);for(d=Math.min(d/a|0,67108863),i._ishlnsubmul(o,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(o,1,c),i.isZero()||(i.negative^=1);r&&(r.words[c]=d)}return r&&r._strip(),i._strip(),"div"!==e&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},s.prototype.divmod=function(t,e,r){var i,o,a;return(n(!t.isZero()),this.isZero())?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||0>this.cmp(t)?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e)},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),s=r.cmp(n);return s<0||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=67108864%t,i=0,s=this.length-1;s>=0;s--)i=(r*i+(0|this.words[s]))%t;return e?-i:i},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var s=(0|this.words[i])+67108864*r;this.words[i]=s/t|0,r=s%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new s(1),o=new s(0),a=new s(0),u=new s(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;(e.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(h),o.isub(c)),i.iushrn(1),o.iushrn(1);for(var p=0,g=1;(r.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),o.isub(u)):(r.isub(e),a.isub(i),u.isub(o))}return{a:a,b:u,gcd:r.iushln(l)}},s.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e,r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var o=new s(1),a=new s(0),u=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,h=1;(r.words[0]&h)==0&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var c=0,d=1;(i.words[0]&d)==0&&c<26;++c,d<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),o.isub(a)):(i.isub(r),a.isub(o))}return 0>(e=0===r.cmpn(1)?o:a).cmpn(0)&&e.iadd(t),e},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var s=e;e=r,r=s}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var s=i,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];a+=s,s=a>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return -1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return -1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return -1===this.cmpn(t)},s.prototype.lt=function(t){return -1===this.cmp(t)},s.prototype.lten=function(t){return 0>=this.cmpn(t)},s.prototype.lte=function(t){return 0>=this.cmp(t)},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new M(t)},s.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function I(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}v.prototype._tmp=function(){var t=new s(null);return t.words=Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(k,v),k.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9){t.words[0]=0,t.length=1;return}var i=t.words[9];for(n=10,e.words[e.length++]=4194303&i;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(4194303&s)<<4|i>>>22,i=s}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},k.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(x,v),i(I,v),i(S,v),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=(0|t.words[r])*19+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){var e;if(w[t])return w[t];if("k256"===t)e=new k;else if("p224"===t)e=new x;else if("p192"===t)e=new I;else if("p25519"===t)e=new S;else throw Error("Unknown prime "+t);return w[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n((t.negative|e.negative)==0,"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new s(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=o;0!==f.cmp(a);){for(var g=f,m=0;0!==g.cmp(a);m++)g=g.redSqr();n(m<p);var y=this.pow(c,new s(1).iushln(p-m-1));d=d.redMul(y),c=y.redSqr(),f=f.redMul(c),p=m}return d},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var l=e.words[n],h=u-1;h>=0;h--){var c=l>>h&1;if(i!==r[0]&&(i=this.sqr(i)),0===c&&0===o){a=0;continue}o<<=1,o|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[o]),a=0,o=0)}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new E(t)},i(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>
7i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},94272:function(t,e,r){var n=r(54655);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},9622:function(t,e,r){"use strict";r.d(e,{Js:function(){return $},jW:function(){return q},VE:function(){return N},nr:function(){return I},NJ:function(){return z}});var n,i,s,o,a,u,l=r(37957),h=r(13250);function c(t){let e=t;if("string"!=typeof e)throw Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}let d=function(t){if(!(t instanceof Uint8Array))throw Error(`This method only supports Uint8Array but input was: ${t}`)},f=BigInt(0),p={},g={};for(let t=0;t<16;t++){let e=t,r=16*t,n=t.toString(16).toLowerCase();g[n]=e,g[n.toUpperCase()]=e,p[n]=r,p[n.toUpperCase()]=r}function m(t){let e=t.length,r=new Uint8Array(e/2);for(let n=0;n<e;n+=2)r[n/2]=p[t[n]]+g[t[n+1]];return r}let y=t=>{if("0x"!==t.slice(0,2))return m(c(t));throw Error("hex string is prefixed with 0x, should be unprefixed")},b=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0")),w=t=>{let e="0x";if(void 0===t||0===t.length)return e;for(let r of t)e+=b[r];return e},v=[];for(let t=0;t<=65535;t++)v[t]=BigInt(t);let k=(t,e=!1)=>{e&&t.reverse();let r=w(t);return"0x"===r?f:4===r.length?v[t[0]]:6===r.length?v[256*t[0]+t[1]]:BigInt(r)},x=t=>{let e=Number(k(t));if(!Number.isSafeInteger(e))throw Error("Number exceeds 53 bits");return e},I=t=>{if("string"!=typeof t)throw Error(`hex argument type ${typeof t} must be of type string`);if(!/^0x[0-9a-fA-F]*$/.test(t))throw Error(`Input must be a 0x-prefixed hexadecimal string, got ${t}`);return(t=t.slice(2)).length%2!=0&&(t=c(t)),m(t)},S=t=>{if(!Number.isSafeInteger(t)||t<0)throw Error(`Received an invalid integer type: ${t}`);return`0x${t.toString(16)}`},M=t=>I(S(t)),E=t=>new Uint8Array(t),A=(t,e,r)=>r?t.length<e?new Uint8Array([...t,...E(e-t.length)]):t.subarray(0,e):t.length<e?new Uint8Array([...E(e-t.length),...t]):t.subarray(-e),B=(t,e)=>(d(t),A(t,e,!1)),P=t=>{if(null==t)return new Uint8Array;
7if(Array.isArray(t)||t instanceof Uint8Array)return Uint8Array.from(t);if("string"==typeof t){if(!("string"==typeof t&&t.match(/^0x[0-9A-Fa-f]*$/)))throw Error(`Cannot convert string to Uint8Array. toBytes only supports 0x-prefixed hex strings and this string was given: ${t}`);return I(t)}if("number"==typeof t)return M(t);if("bigint"==typeof t){if(t<f)throw Error(`Cannot convert negative bigint to Uint8Array. Given: ${t}`);let e=t.toString(16);return e.length%2&&(e="0"+e),y(e)}if(void 0!==t.toBytes)return t.toBytes();throw Error("invalid type")},_=(...t)=>{if(1===t.length)return t[0];let e=new Uint8Array(t.reduce((t,e)=>t+e.length,0));for(let r=0,n=0;r<t.length;r++){let i=t[r];e.set(i,n),n+=i.length}return e};BigInt("0xffffffffffffffff"),BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),l.kA.CURVE.n,l.kA.CURVE.n,BigInt(2),BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),I("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"),I("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"),I("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"),Uint8Array.from([128]),BigInt(-1);let O=BigInt(0),T=BigInt(1),C=BigInt(2);BigInt(3),BigInt(7),BigInt(8);let L=BigInt(27);BigInt(28),BigInt(31),BigInt(32),BigInt(64),BigInt(128),BigInt(255),BigInt(256),BigInt(96),BigInt(100),BigInt(160),BigInt(224),BigInt(7922816251426434e13),BigInt(1461501637330903e33),BigInt(2695994666715064e52),BigInt(1e9),Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));var R=r(22156);let z=function(t,e=!1){if(d(t),e&&64!==t.length&&(t=l.kA.ProjectivePoint.fromHex(t).toRawBytes(!1).slice(1)),64!==t.length)throw Error("Expected pubKey to be of length 64");return(0,R.wn)(t).subarray(-20)};new Uint8Array(0),(n=o||(o={})).String="string",n.Bytes="view",n.Number="number",(i=a||(a={})).String="string",i.Bytes="view",i.JSON="json",(s=u||(u={}))[s.Number=0]="Number",s[s.BigInt=1]="BigInt",s[s.Uint8Array=2]="Uint8Array",s[s.PrefixedHexString=3]="PrefixedHexString";let $=function(t,e,r,n,i){let s=_(B(r,32),B(n,32)),o=e===O||e===T?e:void 0===i?e-L:e-(i*C+BigInt(35));if(!(o===O||o===T))throw Error("Invalid signature v value");return l.kA.Signature.fromCompact(s).addRecoveryBit(Number(o)).recoverPublicKey(t).toRawBytes(!1).slice(1)},q=function(t){let e,r,n;let i=P(t);if(i.length>=65)e=i.subarray(0,32),r=i.subarray(32,64),n=k(i.subarray(64));else if(64===i.length)e=i.subarray(0,32),r=i.subarray(32,64),n=BigInt(x(i.subarray(32,33))>>7),r[0]&=127;else throw Error("Invalid signature length");return n<27&&(n+=L),{v:n,r:e,s:r}},N=function(t){d(t);let e=(0,h.iY)(`\u0019Ethereum Signed Message:
8${t.length}`);return(0,R.wn)(_(e,t))};r(89558),r(77329)},75698:function(t,e,r){"use strict";async function n(t,e={}){let r;if(e.connector)r=e.connector;else{let{connections:e,current:n}=t.state,i=e.get(n);r=i?.connector}let n=t.state.connections;r&&(await r.disconnect(),r.emitter.off("change",t._internal.events.change),r.emitter.off("disconnect",t._internal.events.disconnect),r.emitter.on("connect",t._internal.events.connect),n.delete(r.uid)),t.setState(t=>{if(0===n.size)return{...t,connections:new Map,current:null,status:"disconnected"};let e=n.values().next().value;return{...t,connections:new Map(n),current:e.connector.uid}});{let e=t.state.current;if(!e)return;let r=t.state.connections.get(e)?.connector;if(!r)return;await t.storage?.setItem("recentConnectorId",r.id)}}r.d(e,{z:function(){return n}})},4053:function(t,e,r){"use strict";function n(t){let e=t.state.current,r=t.state.connections.get(e),n=r?.accounts,i=n?.[0],s=t.chains.find(t=>t.id===r?.chainId),o=t.state.status;switch(o){case"connected":return{address:i,addresses:n,chain:s,chainId:r?.chainId,connector:r?.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:i,addresses:n,chain:s,chainId:r?.chainId,connector:r?.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:i,addresses:n,chain:s,chainId:r?.chainId,connector:r?.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}r.d(e,{D:function(){return n}})},4370:function(t,e,r){"use strict";r.d(e,{e:function(){return s}});var n=r(96244);let i=[];function s(t){let e=t.chains;
8return(0,n.v)(i,e)?i:(i=e,e)}},48855:function(t,e,r){"use strict";r.d(e,{G:function(){return i}});let n=!1;async function i(t,e={}){let r;if(n)return[];n=!0,t.setState(t=>({...t,status:t.current?"reconnecting":"connecting"}));let i=[];if(e.connectors?.length)for(let r of e.connectors){let e;e="function"==typeof r?t._internal.connectors.setup(r):r,i.push(e)}else i.push(...t.connectors);try{r=await t.storage?.getItem("recentConnectorId")}catch{}let s={};for(let[,e]of t.state.connections)s[e.connector.id]=1;r&&(s[r]=0);let o=Object.keys(s).length>0?[...i].sort((t,e)=>(s[t.id]??10)-(s[e.id]??10)):i,a=!1,u=[],l=[];for(let e of o){let r=await e.getProvider().catch(()=>void 0);if(!r||l.some(t=>t===r)||!await e.isAuthorized())continue;let n=await e.connect({isReconnecting:!0}).catch(()=>null);n&&(e.emitter.off("connect",t._internal.events.connect),e.emitter.on("change",t._internal.events.change),e.emitter.on("disconnect",t._internal.events.disconnect),t.setState(t=>{let r=new Map(a?t.connections:new Map).set(e.uid,{accounts:n.accounts,chainId:n.chainId,connector:e});return{...t,current:a?t.current:e.uid,connections:r}}),u.push({accounts:n.accounts,chainId:n.chainId,connector:e}),l.push(r),a=!0)}return("reconnecting"===t.state.status||"connecting"===t.state.status)&&(a?t.setState(t=>({...t,status:"connected"})):t.setState(t=>({...t,connections:new Map,current:null,status:"disconnected"}))),n=!1,u}},37449:function(t,e,r){"use strict";r.d(e,{c:function(){return s}});var n=r(45223),i=r(9814);async function s(t,e){let{addEthereumChainParameter:r,chainId:s}=e,o=t.state.connections.get(e.connector?.uid??t.state.current);if(o){let t=o.connector;if(!t.switchChain)throw new i.O({connector:t});return await t.switchChain({addEthereumChainParameter:r,chainId:s})}let a=t.chains.find(t=>t.id===s);if(!a)throw new n.X4;return t.setState(t=>({...t,chainId:s})),a}},34609:function(t,e,r){"use strict";r.d(e,{u:function(){return s}});var n=r(96244),i=r(4053);function s(t,e){let{onChange:r}=e;return t.subscribe(()=>(0,i.D)(t),r,{equalityFn(t,e){let{connector:r,...i}=t,{connector:s,...o}=e;return(0,n.v)(i,o)&&r?.id===s?.id&&r?.uid===s?.uid}})}},63831:function(t,e,r){"use strict";r.d(e,{L:function(){return d}});var n=r(29583),i=r(21352),s=r(20340),o=r(46855),a=r(87524),u=r(45223),l=r(9814);let h=/(rabby|trustwallet)/,c={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider:t=>t?.coinbaseWalletExtension?t.coinbaseWalletExtension:f(t,"isCoinbaseWallet")},metaMask:{id:"metaMask",name:"MetaMask",provider:t=>f(t,t=>{if(!t.isMetaMask||t.isBraveWallet&&!t._events&&!t._state)return!1;for(let e of["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"])if(t[e])return!1;return!0})},phantom:{id:"phantom",name:"Phantom",provider:t=>t?.phantom?.ethereum?t.phantom?.ethereum:f(t,"isPhantom")}};function d(t={}){let e,r,p,g;let{shimDisconnect:m=!0,unstable_shimAsyncInject:y}=t;function b(){let e=t.target;if("function"==typeof e){let t=e();if(t)return t}return"object"==typeof e?e:"string"==typeof e?{...c[e]??{id:e,name:`${e[0].toUpperCase()}${e.slice(1)}`,provider:`is${e[0].toUpperCase()}${e.slice(1)}`}}:{id:"injected",name:"Injected",provider:t=>t?.ethereum}}return c=>({get icon(){return b().icon},get id(){return b().id},get name(){return b().name},get supportsSimulation(){return h.test(this.id.toLowerCase())},type:d.type,async setup(){let r=await this.getProvider();r&&t.target&&(p||(p=this.onConnect.bind(this),r.on("connect",p)),e||(e=this.onAccountsChanged.bind(this),r.on("accountsChanged",e)))},async connect({chainId:s,isReconnecting:o}={}){let a=await this.getProvider();if(!a)throw new l.M;let u=[];if(o)u=await this.getAccounts().catch(()=>[]);else if(m)try{let t=await a.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});(u=t[0]?.caveats?.[0]?.value?.map(t=>n.K(t))).length>0&&(u=await this.getAccounts())}catch(t){if(t.code===i.ab.code)throw new i.ab(t);if(t.code===i.pT.code)throw t}try{u?.length||o||(u=(await a.request({method:"eth_requestAccounts"})).map(t=>(0,n.K)(t))),p&&(a.removeListener("connect",p),p=void 0),e||(e=this.onAccountsChanged.bind(this),a.on("accountsChanged",e)),r||(r=this.onChainChanged.bind(this),a.on("chainChanged",r)),g||(g=this.onDisconnect.bind(this),a.on("disconnect",g));let l=await this.getChainId();if(s&&l!==s){let t=await this.switchChain({chainId:s}).catch(t=>{if(t.code===i.ab.code)throw t;return{id:l}});l=t?.id??l}return m&&await c.storage?.removeItem(`${this.id}.disconnected`),t.target||await c.storage?.setItem("injected.connected",!0),{accounts:u,chainId:l}}catch(t){if(t.code===i.ab.code)throw new i.ab(t);if(t.code===i.pT.code)throw new i.pT(t);throw t}},async disconnect(){let e=await this.getProvider();if(!e)throw new l.M;r&&(e.removeListener("chainChanged",r),r=void 0),g&&(e.removeListener("disconnect",g),g=void 0),p||(p=this.onConnect.bind(this),e.on("connect",p));try{await (0,s.F)(()=>e.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}m&&await c.storage?.setItem(`${this.id}.disconnected`,!0),t.target||await c.storage?.removeItem("injected.connected")},async getAccounts(){let t=await this.getProvider();if(!t)throw new l.M;return(await t.request({method:"eth_accounts"})).map(t=>(0,n.K)(t))},async getChainId(){let t=await this.getProvider();if(!t)throw new l.M;return Number(await t.request({method:"eth_chainId"}))},async getProvider(){let t;if("undefined"==typeof window)return;let e=b();return(t="function"==typeof e.provider?e.provider(window):"string"==typeof e.provider?f(window,e.provider):e.provider)&&!t.removeListener&&("off"in t&&"function"==typeof t.off?t.removeListener=t.off:t.removeListener=()=>{}),t}
8,async isAuthorized(){try{if(m&&await c.storage?.getItem(`${this.id}.disconnected`)||!t.target&&!await c.storage?.getItem("injected.connected"))return!1;if(!await this.getProvider()){if(void 0!==y&&!1!==y){let t=async()=>("undefined"!=typeof window&&window.removeEventListener("ethereum#initialized",t),!!await this.getProvider()),e="number"==typeof y?y:1e3;if(await Promise.race([..."undefined"!=typeof window?[new Promise(e=>window.addEventListener("ethereum#initialized",()=>e(t()),{once:!0}))]:[],new Promise(r=>setTimeout(()=>r(t()),e))]))return!0}throw new l.M}return!!(await (0,o.J)(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:t,chainId:e}){let r=await this.getProvider();if(!r)throw new l.M;let n=c.chains.find(t=>t.id===e);if(!n)throw new i.x3(new u.X4);try{return await Promise.all([r.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,a.eC)(e)}]}).then(async()=>{await this.getChainId()===e&&c.emitter.emit("change",{chainId:e})}),new Promise(t=>c.emitter.once("change",({chainId:r})=>{r===e&&t()}))]),n}catch(s){if(4902===s.code||s?.data?.originalError?.code===4902)try{let s,o;let{default:u,...l}=n.blockExplorers??{};t?.blockExplorerUrls?s=t.blockExplorerUrls:u&&(s=[u.url,...Object.values(l).map(t=>t.url)]),o=t?.rpcUrls?.length?t.rpcUrls:[n.rpcUrls.default?.http[0]??""];let h={blockExplorerUrls:s,chainId:(0,a.eC)(e),chainName:t?.chainName??n.name,iconUrls:t?.iconUrls,nativeCurrency:t?.nativeCurrency??n.nativeCurrency,rpcUrls:o};if(await r.request({method:"wallet_addEthereumChain",params:[h]}),await this.getChainId()!==e)throw new i.ab(Error("User rejected switch after adding network."));return n}catch(t){throw new i.ab(t)}if(s.code===i.ab.code)throw new i.ab(s);throw new i.x3(s)}},async onAccountsChanged(t){if(0===t.length)this.onDisconnect();else if(c.emitter.listenerCount("connect")){let t=(await this.getChainId()).toString();this.onConnect({chainId:t}),m&&await c.storage?.removeItem(`${this.id}.disconnected`)}else c.emitter.emit("change",{accounts:t.map(t=>(0,n.K)(t))})},onChainChanged(t){let e=Number(t);c.emitter.emit("change",{chainId:e})},async onConnect(t){let n=await this.getAccounts();if(0===n.length)return;let i=Number(t.chainId);c.emitter.emit("connect",{accounts:n,chainId:i});let s=await this.getProvider();s&&(p&&(s.removeListener("connect",p),p=void 0),e||(e=this.onAccountsChanged.bind(this),s.on("accountsChanged",e)),r||(r=this.onChainChanged.bind(this),s.on("chainChanged",r)),g||(g=this.onDisconnect.bind(this),s.on("disconnect",g)))},async onDisconnect(t){let e=await this.getProvider();t&&1013===t.code&&e&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),e&&(r&&(e.removeListener("chainChanged",r),r=void 0),g&&(e.removeListener("disconnect",g),g=void 0),p||(p=this.onConnect.bind(this),e.on("connect",p))))}})}function f(t,e){function r(t){return"function"==typeof e?e(t):"string"!=typeof e||t[e]}let n=t.ethereum;return n?.providers?n.providers.find(t=>r(t)):n&&r(n)?n:void 0}d.type="injected"},63252:function(t,e,r){"use strict";let n;r.d(e,{_:function(){return S}});var i=r(426),s=r(38908);let o=t=>(e,r,n)=>{let i=n.subscribe;return n.subscribe=(t,e,r)=>{let s=t;if(e){let i=(null==r?void 0:r.equalityFn)||Object.is,o=t(n.getState());s=r=>{let n=t(r);if(!i(o,n)){let t=o;e(o=n,t)}},(null==r?void 0:r.fireImmediately)&&e(o,o)}return i(s)},t(e,r,n)},a=t=>e=>{try{let r=t(e);if(r instanceof Promise)return r;return{then:t=>a(t)(r),catch(t){return this}}}catch(t){return{then(t){return this},catch:e=>a(e)(t)}}},u=(t,e)=>(r,n,i)=>{let s,o,u={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},l=!1,h=new Set,c=new Set;try{s=u.getStorage()}catch(t){}if(!s)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),r(...t)},n,i);let d=a(u.serialize),f=()=>{let t;let e=d({state:u.partialize({...n()}),version:u.version}).then(t=>s.setItem(u.name,t)).catch(e=>{t=e});if(t)throw t;return e},p=i.setState;i.setState=(t,e)=>{p(t,e),f()};let g=t((...t)=>{r(...t),f()},n,i),m=()=>{var t;if(!s)return;l=!1,h.forEach(t=>t(n()));let e=(null==(t=u.onRehydrateStorage)?void 0:t.call(u,n()))||void 0;return a(s.getItem.bind(s))(u.name).then(t=>{if(t)return u.deserialize(t)}).then(t=>{if(t){if("number"!=typeof t.version||t.version===u.version)return t.state;if(u.migrate)return u.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(t=>{var e;return r(o=u.merge(t,null!=(e=n())?e:g),!0),f()}).then(()=>
8{null==e||e(o,void 0),l=!0,c.forEach(t=>t(o))}).catch(t=>{null==e||e(void 0,t)})};return i.persist={setOptions:t=>{u={...u,...t},t.getStorage&&(s=t.getStorage())},clearStorage:()=>{null==s||s.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>m(),hasHydrated:()=>l,onHydrate:t=>(h.add(t),()=>{h.delete(t)}),onFinishHydration:t=>(c.add(t),()=>{c.delete(t)})},m(),o||g},l=(t,e)=>(r,n,i)=>{let s,o={storage:function(t,e){let r;try{r=t()}catch(t){return}return{getItem:t=>{var e;let n=t=>null===t?null:JSON.parse(t,void 0),i=null!=(e=r.getItem(t))?e:null;return i instanceof Promise?i.then(n):n(i)},setItem:(t,e)=>r.setItem(t,JSON.stringify(e,void 0)),removeItem:t=>r.removeItem(t)}}(()=>localStorage),partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},u=!1,l=new Set,h=new Set,c=o.storage;if(!c)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...t)},n,i);let d=()=>{let t=o.partialize({...n()});return c.setItem(o.name,{state:t,version:o.version})},f=i.setState;i.setState=(t,e)=>{f(t,e),d()};let p=t((...t)=>{r(...t),d()},n,i),g=()=>{var t,e;if(!c)return;u=!1,l.forEach(t=>{var e;return t(null!=(e=n())?e:p)});let i=(null==(e=o.onRehydrateStorage)?void 0:e.call(o,null!=(t=n())?t:p))||void 0;return a(c.getItem.bind(c))(o.name).then(t=>{if(t){if("number"!=typeof t.version||t.version===o.version)return t.state;if(o.migrate)return o.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(t=>{var e;return r(s=o.merge(t,null!=(e=n())?e:p),!0),d()}).then(()=>{null==i||i(s,void 0),s=n(),u=!0,h.forEach(t=>t(s))}).catch(t=>{null==i||i(void 0,t)})};return i.persist={setOptions:t=>{o={...o,...t},t.storage&&(c=t.storage)},clearStorage:()=>{null==c||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>g(),hasHydrated:()=>u,onHydrate:t=>(l.add(t),()=>{l.delete(t)}),onFinishHydration:t=>(h.add(t),()=>{h.delete(t)})},o.skipHydration||g(),s||p},h=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),u(t,e)):l(t,e),c=t=>{let e;let r=new Set,n=(t,n)=>{let i="function"==typeof t?t(e):t;if(!Object.is(i,e)){let t=e;e=(null!=n?n:"object"!=typeof i)?i:Object.assign({},e,i),r.forEach(r=>r(e,t))}},i=()=>e,s={setState:n,getState:i,subscribe:t=>(r.add(t),()=>r.delete(t)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,s),s},d=t=>t?c(t):c;var f=r(63831),p=r(48191);class g{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new p.v})}on(t,e){this._emitter.on(t,e)}once(t,e){this._emitter.once(t,e)}off(t,e){this._emitter.off(t,e)}emit(t,...e){let r=e[0];this._emitter.emit(t,{uid:this.uid,...r})}listenerCount(t){return this._emitter.listenerCount(t)}}function m(t,e){return JSON.parse(t,(t,r)=>{let n=r;return n?.__type==="bigint"&&(n=BigInt(n.value)),n?.__type==="Map"&&(n=new Map(n.value)),e?.(t,n)??n})}function y(t,e){return t.slice(0,e).join(".")||"."}function b(t,e){let{length:r}=t;for(let n=0;n<r;++n)if(t[n]===e)return n+1;return 0}function w(t,e,r,n){return JSON.stringify(t,function(t,e){let r="function"==typeof t,n="function"==typeof e,i=[],s=[];return function(o,a){if("object"==typeof a){if(i.length){let t=b(i,this);0===t?i[i.length]=this:(i.splice(t),s.splice(t)),s[s.length]=o;let r=b(i,a);if(0!==r)return n?e.call(this,o,a,y(s,r)):`[ref=${y(s,r)}]`}else i[0]=a,s[0]=o}return r?t.call(this,o,a):a}}((t,r)=>{let n=r;return"bigint"==typeof n&&(n={__type:"bigint",value:r.toString()}),n instanceof Map&&(n={__type:"Map",value:Array.from(r.entries())}),e?.(t,n)??n},n),r??void 0)}let v={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};var k=r(45223);let x=256;var I=r(62982);function S(t){let e;let{multiInjectedProviderDiscovery:r=!0,storage:a=function(t){let{deserialize:e=m,key:r="wagmi",serialize:n=w,storage:i=v}=t;function s(t){return t instanceof Promise?t.then(t=>t).catch(()=>null):t}return{...i,key:r,async getItem(t,n){let o=i.getItem(`${r}.${t}`),a=await s(o);return a?e(a)??null:n??null},async setItem(t,e){let o=`${r}.${t}`;null===e?await s(i.removeItem(o)):await s(i.setItem(o,n(e)))},async removeItem(t){await s(i.removeItem(`${r}.${t}`))}}}({storage:"undefined"!=typeof window&&window.localStorage?window.localStorage:v}),syncConnectedChain:u=!0,ssr:l=!1,...c}=t,p="undefined"!=typeof window&&r?(0,i.M)():void 0,y=d(()=>c.chains),b=d(()=>
8[...c.connectors??[],...l?[]:p?.getProviders().map(M)??[]].map(S));function S(t){let e=new g(function(t=11){if(!n||x+t>512){n="",x=0;for(let t=0;t<256;t++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(x,x+++t)}()),r={...t({emitter:e,chains:y.getState(),storage:a,transports:c.transports}),emitter:e,uid:e.uid};return e.on("connect",T),r.setup?.(),r}function M(t){let{info:e}=t,r=t.provider;return(0,f.L)({target:{...e,id:e.rdns,provider:r}})}let E=new Map;function A(){return{chainId:y.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let B="0.0.0-canary-";e=I.i.startsWith(B)?Number.parseInt(I.i.replace(B,"")):Number.parseInt(I.i.split(".")[0]??"0");let P=d(o(a?h(A,{migrate(t,r){if(r===e)return t;let n=A(),i=_(t,n.chainId);return{...n,chainId:i}},name:"store",partialize:t=>({connections:{__type:"Map",value:Array.from(t.connections.entries()).map(([t,e])=>{let{id:r,name:n,type:i,uid:s}=e.connector;return[t,{...e,connector:{id:r,name:n,type:i,uid:s}}]})},chainId:t.chainId,current:t.current}),merge(t,e){"object"==typeof t&&t&&"status"in t&&delete t.status;let r=_(t,e.chainId);return{...e,...t,chainId:r}},skipHydration:l,storage:a,version:e}):A));function _(t,e){return t&&"object"==typeof t&&"chainId"in t&&"number"==typeof t.chainId&&y.getState().some(e=>e.id===t.chainId)?t.chainId:e}function O(t){P.setState(e=>{let r=e.connections.get(t.uid);return r?{...e,connections:new Map(e.connections).set(t.uid,{accounts:t.accounts??r.accounts,chainId:t.chainId??r.chainId,connector:r.connector})}:e})}function T(t){"connecting"!==P.getState().status&&"reconnecting"!==P.getState().status&&P.setState(e=>{let r=b.getState().find(e=>e.uid===t.uid);return r?(r.emitter.listenerCount("connect")&&r.emitter.off("connect",O),r.emitter.listenerCount("change")||r.emitter.on("change",O),r.emitter.listenerCount("disconnect")||r.emitter.on("disconnect",C),{...e,connections:new Map(e.connections).set(t.uid,{accounts:t.accounts,chainId:t.chainId,connector:r}),current:t.uid,status:"connected"}):e})}function C(t){P.setState(e=>{let r=e.connections.get(t.uid);if(r){let t=r.connector;t.emitter.listenerCount("change")&&r.connector.emitter.off("change",O),t.emitter.listenerCount("disconnect")&&r.connector.emitter.off("disconnect",C),t.emitter.listenerCount("connect")||r.connector.emitter.on("connect",T)}if(e.connections.delete(t.uid),0===e.connections.size)return{...e,connections:new Map,current:null,status:"disconnected"};let n=e.connections.values().next().value;return{...e,connections:new Map(e.connections),current:n.connector.uid}})}return u&&P.subscribe(({connections:t,current:e})=>e?t.get(e)?.chainId:void 0,t=>{if(y.getState().some(e=>e.id===t))return P.setState(e=>({...e,chainId:t??e.chainId}))}),p?.subscribe(t=>{let e=new Map;for(let t of b.getState())e.set(t.id,!0);let r=[];for(let n of t){let t=S(M(n));e.has(t.id)||r.push(t)}(!a||P.persist.hasHydrated())&&b.setState(t=>[...t,...r],!0)}),{get chains(){return y.getState()},get connectors(){return b.getState()},storage:a,getClient:function(t={}){let e;let r=t.chainId??P.getState().chainId,n=y.getState().find(t=>t.id===r);if(t.chainId&&!n)throw new k.X4;{let t=E.get(P.getState().chainId);if(t&&!n)return t;if(!n)throw new k.X4}{let t=E.get(r);if(t)return t}if(c.client)e=c.client({chain:n});else{let t=n.id,r=y.getState().map(t=>t.id),i={};for(let[e,n]of Object.entries(c))if("chains"!==e&&"client"!==e&&"connectors"!==e&&"transports"!==e){if("object"==typeof n){if(t in n)i[e]=n[t];else{if(r.some(t=>t in n))continue;i[e]=n}}else i[e]=n}e=function(t){var e;let{batch:r,cacheTime:n=t.pollingInterval??4e3,ccipRead:i,key:o="base",name:a="Base Client",pollingInterval:u=4e3,type:l="base"}=t,h=t.chain,c=t.account?"string"==typeof(e=t.account)?{address:e,type:"json-rpc"}:e:void 0,{config:d,request:f,value:p}=t.transport({chain:h,pollingInterval:u}),g={account:c,batch:r,cacheTime:n,ccipRead:i,chain:h,key:o,name:a,pollingInterval:u,request:f,transport:{...d,...p},type:l,uid:(0,s.h)()};return Object.assign(g,{extend:function t(e){return r=>{let n=r(e);for(let t in g)delete n[t];let i={...e,...n};return Object.assign(i,{extend:t(i)})}}(g)})}({...i,chain:n,batch:i.batch??{multicall:!0},transport:e=>c.transports[t]({...e,connectors:b})})}return E.set(r,e),e},get state(){return P.getState()},setState(t){let e;e="function"==typeof t?t(P.getState()):t;let r=A();"object"!=typeof e&&(e=r),Object.keys(r).some(t=>!(t in e))&&(e=r),P.setState(e,!0)},subscribe:(t,e,r)=>P.subscribe(t,e,r?{...r,fireImmediately:r.emitImmediately}:void 0),_internal:{mipd:p,store:P,ssr:!!l,syncConnectedChain:u,transports:c.transports,chains:{setState(t){let e="function"==typeof t?t(y.getState()):t;if(0!==e.length)return y.setState(e,!0)},subscribe:t=>y.subscribe(t)},connectors:{providerDetailToConnector:M,setup:S,setState:t=>b.setState("function"==typeof t?t(b.getState()):t,!0),subscribe:t=>b.subscribe(t)},events:{change:O,connect:T,disconnect:C}}}}},34318:function(t,e,r){"use strict";r.d(e,{G:function(){return u}});var n,i,s=r(62982);let o=()=>`@wagmi/core@${s.i}`;var a=function(t,e,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");
8return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class u extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return o()}constructor(t,e={}){super(),n.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});let r=e.cause instanceof u?e.cause.details:e.cause?.message?e.cause.message:e.details,i=e.cause instanceof u&&e.cause.docsPath||e.docsPath;this.message=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${e.docsSlug?`#${e.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join("\n"),e.cause&&(this.cause=e.cause),this.details=r,this.docsPath=i,this.metaMessages=e.metaMessages,this.shortMessage=t}walk(t){return a(this,n,"m",i).call(this,this,t)}}n=new WeakSet,i=function t(e,r){return r?.(e)?e:e.cause?a(this,n,"m",t).call(this,e.cause,r):e}},45223:function(t,e,r){"use strict";r.d(e,{X4:function(){return i}});var n=r(34318);class i extends n.G{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}},9814:function(t,e,r){"use strict";r.d(e,{M:function(){return i},O:function(){return s}});var n=r(34318);class i extends n.G{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class s extends n.G{constructor({connector:t}){super(`"${t.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}},96244:function(t,e,r){"use strict";r.d(e,{v:function(){return function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){let n,i;if(e.constructor!==r.constructor)return!1;if(Array.isArray(e)&&Array.isArray(r)){if((n=e.length)!==r.length)return!1;for(i=n;0!=i--;)if(!t(e[i],r[i]))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();let s=Object.keys(e);if((n=s.length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;0!=i--;){let n=s[i];if(n&&!t(e[n],r[n]))return!1}return!0}return e!=e&&r!=r}}})},62982:function(t,e,r){"use strict";r.d(e,{i:function(){return n}});let n="2.13.4"},1381:function(t,e,r){"use strict";r.d(e,{io:function(){return F}});var n=r(96979),i=r(32962);let s="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function o(t,...e){return e.reduce((e,r)=>(t.hasOwnProperty(r)&&(e[r]=t[r]),e),{})}let a=s.setTimeout,u=s.clearTimeout;function l(t,e){e.useNativeTimers?(t.setTimeoutFn=a.bind(s),t.clearTimeoutFn=u.bind(s)):(t.setTimeoutFn=s.setTimeout.bind(s),t.clearTimeoutFn=s.clearTimeout.bind(s))}
8class h extends Error{constructor(t,e,r){super(t),this.description=e,this.context=r,this.type="TransportError"}}class c extends i.Q{constructor(t){super(),this.writable=!1,l(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,r){return super.emitReserved("error",new h(t,e,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let e=(0,n.Yi)(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){let t=this.opts.hostname;return -1===t.indexOf(":")?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(t){let e=function(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}(t);return e.length?"?"+e:""}}let d="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),f={},p=0,g=0,m;function y(t){let e="";do e=d[t%64]+e,t=Math.floor(t/64);while(t>0);return e}function b(){let t=y(+new Date);return t!==m?(p=0,m=t):t+"."+y(p++)}for(;g<64;g++)f[d[g]]=g;let w=!1;try{w="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}let v=w;function k(t){let e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||v))return new XMLHttpRequest}catch(t){}if(!e)try{return new s[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}function x(){}let I=null!=new k({xdomain:!1}).responseType;class S extends c{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){let e="https:"===location.protocol,r=location.port;r||(r=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||r!==t.port}let e=t&&t.forceBase64;this.supportsBinary=I&&!e,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";let e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){(0,n.pH)(t,this.socket.binaryType).forEach(t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){let t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,(0,n.V1)(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=b()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new M(this.uri(),t)}doWrite(t,e){let r=this.request({method:"POST",data:t});r.on("success",e),r.on("error",(t,e)=>{this.onError("xhr post error",t,e)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(t,e)=>{this.onError("xhr poll error",t,e)}),this.pollXhr=t}}class M extends i.Q{constructor(t,e){super(),l(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.data=void 0!==e.data?e.data:null,this.create()}create(){var t;let e=o(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;let r=this.xhr=new k(e);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders)for(let t in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&r.setRequestHeader(t,this.opts.extraHeaders[t])}catch(t){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{r.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var t;3===r.readyState&&(null===(t=this.opts.cookieJar)||void 0===t||t.parseCookies(r)),4===r.readyState&&(200===r.
8status||1223===r.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"==typeof r.status?r.status:0)},0))},r.send(this.data)}catch(t){this.setTimeoutFn(()=>{this.onError(t)},0);return}"undefined"!=typeof document&&(this.index=M.requestsCount++,M.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=x,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete M.requests[this.index],this.xhr=null}}onLoad(){let t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}function E(){for(let t in M.requests)M.requests.hasOwnProperty(t)&&M.requests[t].abort()}M.requestsCount=0,M.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",E):"function"==typeof addEventListener&&addEventListener("onpagehide"in s?"pagehide":"unload",E,!1));let A="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),B=s.WebSocket||s.MozWebSocket;r(87376).Buffer;let P="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class _ extends c{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;let t=this.uri(),e=this.opts.protocols,r=P?{}:o(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=P?new B(t,e,r):e?new B(t,e):new B(t)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let r=t[e],i=e===t.length-1;(0,n.I4)(r,this.supportsBinary,t=>{try{this.ws.send(t)}catch(t){}i&&A(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=b()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}check(){return!!B}}class O extends c{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{let e=(0,n.p4)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(e).getReader(),i=(0,n._s)();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();let s=()=>{r.read().then(({done:t,value:e})=>{t||(this.onPacket(e),s())}).catch(t=>{})};s();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let r=t[e],n=e===t.length-1;this.writer.write(r).then(()=>{n&&A(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;null===(t=this.transport)||void 0===t||t.close()}}let T={websocket:_,webtransport:O,polling:S},C=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,L=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function R(t){if(t.length>2e3)throw"URI too long";let e=t,r=t.indexOf("["),n=t.indexOf("]");
8-1!=r&&-1!=n&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let i=C.exec(t||""),s={},o=14;for(;o--;)s[L[o]]=i[o]||"";return -1!=r&&-1!=n&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=function(t,e){let r=e.replace(/\/{2,9}/g,"/").split("/");return("/"==e.slice(0,1)||0===e.length)&&r.splice(0,1),"/"==e.slice(-1)&&r.splice(r.length-1,1),r}(0,s.path),s.queryKey=function(t,e){let r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,n){e&&(r[e]=n)}),r}(0,s.query),s}class z extends i.Q{constructor(t,e={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=R(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=R(e.host).host),l(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},r=t.split("&");for(let t=0,n=r.length;t<n;t++){let n=r[t].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){let e=Object.assign({},this.opts.query);e.EIO=n.TF,e.transport=t,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new T[t](r)}open(){let t;if(this.opts.rememberUpgrade&&z.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else if(0===this.transports.length){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(t){this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(t){let e=this.createTransport(t),r=!1;z.priorWebsocketSuccess=!1;let n=()=>{r||(e.send([{type:"ping",data:"probe"}]),e.once("packet",t=>{if(!r){if("pong"===t.type&&"probe"===t.data)this.upgrading=!0,this.emitReserved("upgrading",e),e&&(z.priorWebsocketSuccess="websocket"===e.name,this.transport.pause(()=>{r||"closed"===this.readyState||(l(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())}));else{let t=Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}}}))};function i(){r||(r=!0,l(),e.close(),e=null)}let s=t=>{let r=Error("probe error: "+t);r.transport=e.name,i(),this.emitReserved("upgradeError",r)};function o(){s("transport closed")}function a(){s("socket closed")}function u(t){e&&t.name!==e.name&&i()}let l=()=>{e.removeListener("open",n),e.removeListener("error",s),e.removeListener("close",o),this.off("close",a),this.off("upgrading",u)};e.once("open",n),e.once("error",s),e.once("close",o),this.once("close",a),this.once("upgrading",u),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn(()=>{r||e.open()},200):e.open()}onOpen(){if(this.readyState="open",z.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let t=0,e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":let e=Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let e=0;e<this.writeBuffer.length;e++){let r=this.writeBuffer[e].data;if(r&&(t+="string"==typeof r?function(t){let e=0,r=0;for(let n=0,i=t.length;n<i;n++)(e=t.charCodeAt(n))<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),e>0&&t>this.maxPayload)return this.writeBuffer.slice(0,e);t+=2}return this.writeBuffer}write(t,e,r){return this.sendPacket("message",t,e,r),this}send(t,e,r){return this.sendPacket("message",t,e,r),this}sendPacket(t,e,r,n){if("function"==typeof e&&(n=e,e=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let i={type:t,data:e,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){z.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){let e=[],r=0,n=t.length;for(;r<n;r++)~this.transports.indexOf(t[r])&&e.push(t[r]);return e}}z.protocol=n.TF,z.protocol;var $=r(93509);function q(t,e,r){return t.on(e,r),function(){t.off(e,r)}}let N=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class U extends i.Q{constructor(t,e,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[q(t,"open",this.onopen.bind(this)),q(t,"packet",this.onpacket.b
8ind(this)),q(t,"error",this.onerror.bind(this)),q(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(N.hasOwnProperty(t))throw Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;let r={type:$.PacketType.EVENT,data:e};if(r.options={},r.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){let t=this.ids++,n=e.pop();this._registerAckCallback(t,n),r.id=t}let n=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return(!this.flags.volatile||n&&this.connected)&&(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,e){var r;let n=null!==(r=this.flags.timeout)&&void 0!==r?r:this._opts.ackTimeout;if(void 0===n){this.acks[t]=e;return}let i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,Error("operation has timed out"))},n);this.acks[t]=(...t)=>{this.io.clearTimeoutFn(i),e.apply(this,[null,...t])}}emitWithAck(t,...e){let r=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise((n,i)=>{e.push((t,e)=>r?t?i(t):n(e):n(t)),this.emit(t,...e)})}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((t,...n)=>{if(r===this._queue[0])return null!==t?r.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...n)),r.pending=!1,this._drainQueue()}),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;let e=this._queue[0];(!e.pending||t)&&(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:$.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e)}onpacket(t){if(!(t.nsp!==this.nsp))switch(t.type){case $.PacketType.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case $.PacketType.EVENT:case $.PacketType.BINARY_EVENT:this.onevent(t);break;case $.PacketType.ACK:case $.PacketType.BINARY_ACK:this.onack(t);break;case $.PacketType.DISCONNECT:this.ondisconnect();break;case $.PacketType.CONNECT_ERROR:this.destroy();let e=Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){let e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length)for(let e of this._anyListeners.slice())e.apply(this,t);super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){let e=this,r=!1;return function(...n){r||(r=!0,e.packet({type:$.PacketType.ACK,id:t,data:n}))}}onack(t){let e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}
vendor: 5,122 bytes, line 8
8destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:$.PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let e=this._anyListeners;for(let r=0;r<e.length;r++)if(t===e[r]){e.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let e=this._anyOutgoingListeners;for(let r=0;r<e.length;r++)if(t===e[r]){e.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let e of this._anyOutgoingListeners.slice())e.apply(this,t.data)}}function W(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}W.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(1&Math.floor(10*e))==0?t-r:t+r}return 0|Math.min(t,this.max)},W.prototype.reset=function(){this.attempts=0},W.prototype.setMin=function(t){this.ms=t},W.prototype.setMax=function(t){this.max=t},W.prototype.setJitter=function(t){this.jitter=t};class j extends i.Q{constructor(t,e){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,l(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=e.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new W({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;let n=e.parser||$;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new z(this.uri,this.opts);let e=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=q(e,"open",function(){r.onopen(),t&&t()}),i=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},s=q(e,"error",i);if(!1!==this._timeout){let t=this._timeout,r=this.setTimeoutFn(()=>{n(),i(Error("timeout")),e.close()},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(q(t,"ping",this.onping.bind(this)),q(t,"data",this.ondata.bind(this)),q(t,"error",this.onerror.bind(this)),q(t,"close",this.onclose.bind(this)),q(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){A(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new U(this,t,e),this.nsps[t]=r),r}_destroy(t){for(let t of Object.keys(this.nsps))if(this.nsps[t].active)return;this._close()}_packet(t){let e=this.encoder.encode(t);for(let r=0;r<e.length;r++)this.engine.write(e[r],t.options)}
8cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let e=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{!t.skipReconnect&&(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}let K={};function F(t,e){let r;"object"==typeof t&&(e=t,t=void 0);let n=function(t,e="",r){let n=t;r=r||"undefined"!=typeof location&&location,null==t&&(t=r.protocol+"//"+r.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==r?r.protocol+"//"+t:"https://"+t),n=R(t)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let i=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port+e,n.href=n.protocol+"://"+i+(r&&r.port===n.port?"":":"+n.port),n}(t,(e=e||{}).path||"/socket.io"),i=n.source,s=n.id,o=n.path,a=K[s]&&o in K[s].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||a?r=new j(i,e):(K[s]||(K[s]=new j(i,e)),r=K[s]),n.query&&!e.query&&(e.query=n.queryKey),r.socket(n.path,e)}Object.assign(F,{Manager:j,Socket:U,io:F,connect:F})},71416:function(t,e,r){"use strict";r.d(e,{L:function(){return eb}});var n={};r.r(n),r.d(n,{gk:function(){return y},dQ:function(){return _},ci:function(){return w},bytesToNumberBE:function(){return S},ty:function(){return M},eV:function(){return P},n$:function(){return C},ql:function(){return B},hexToBytes:function(){return I},_t:function(){return m},tL:function(){return E},S5:function(){return A},FF:function(){return R}});var i=r(55805),s=r(83326);let o=(t,e,r)=>t&e^~t&r,a=(t,e,r)=>t&e^t&r^e&r;class u extends s.kb{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,s.GL)(this.buffer)}update(t){(0,i.Gg)(this);let{view:e,buffer:r,blockLen:n}=this,o=(t=(0,s.O0)(t)).length;for(let i=0;i<o;){let a=Math.min(n-this.pos,o-i);if(a===n){let e=(0,s.GL)(t);for(;n<=o-i;i+=n)this.process(e,i);continue}r.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,i.Gg)(this),(0,i.J8)(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:n,isLE:o}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>n-a&&(this.process(r,0),a=0);for(let t=a;t<n;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),u=n?4:0,l=n?0:4;t.setUint32(e+u,o,n),t.setUint32(e+l,a,n)}(r,n-8,BigInt(8*this.length),o),this.process(r,0);let u=(0,s.GL)(t),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let h=l/4,c=this.get();if(h>c.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<h;t++)u.setUint32(4*t,c[t],o)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return t.length=n,t.pos=o,t.finished=i,t.destroyed=s,n%e&&t.buffer.set(r),t}}let l=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,2756
8734187,3204031479,3329325298]),h=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class d extends u{constructor(){super(64,32,8,!1),this.A=0|h[0],this.B=0|h[1],this.C=0|h[2],this.D=0|h[3],this.E=0|h[4],this.F=0|h[5],this.G=0|h[6],this.H=0|h[7]}get(){let{A:t,B:e,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[t,e,r,n,i,s,o,a]}set(t,e,r,n,i,s,o,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)c[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=c[t-15],r=c[t-2],n=(0,s.np)(e,7)^(0,s.np)(e,18)^e>>>3,i=(0,s.np)(r,17)^(0,s.np)(r,19)^r>>>10;c[t]=i+c[t-7]+n+c[t-16]|0}let{A:r,B:n,C:i,D:u,E:h,F:d,G:f,H:p}=this;for(let t=0;t<64;t++){let e=p+((0,s.np)(h,6)^(0,s.np)(h,11)^(0,s.np)(h,25))+o(h,d,f)+l[t]+c[t]|0,g=((0,s.np)(r,2)^(0,s.np)(r,13)^(0,s.np)(r,22))+a(r,n,i)|0;p=f,f=d,d=h,h=u+e|0,u=i,i=n,n=r,r=e+g|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,u=u+this.D|0,h=h+this.E|0,d=d+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(r,n,i,u,h,d,f,p)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let f=(0,s.hE)(()=>new d);BigInt(0);let p=BigInt(1),g=BigInt(2);function m(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function y(t){if(!m(t))throw Error("Uint8Array expected")}let b=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function w(t){y(t);let e="";for(let r=0;r<t.length;r++)e+=b[t[r]];return e}function v(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":`0x${t}`)}let k={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function x(t){return t>=k._0&&t<=k._9?t-k._0:t>=k._A&&t<=k._F?t-(k._A-10):t>=k._a&&t<=k._f?t-(k._a-10):void 0}function I(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let e=0,i=0;e<r;e++,i+=2){let r=x(t.charCodeAt(i)),s=x(t.charCodeAt(i+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(t[i]+t[i+1])+'" at index '+i);n[e]=16*r+s}return n}function S(t){return v(w(t))}function M(t){return y(t),v(w(Uint8Array.from(t).reverse()))}function E(t,e){return I(t.toString(16).padStart(2*e,"0"))}function A(t,e){return E(t,e).reverse()}function B(t,e,r){let n;if("string"==typeof e)try{n=I(e)}catch(r){throw Error(`${t} must be valid hex string, got "${e}". Cause: ${r}`)}else if(m(e))n=Uint8Array.from(e);else throw Error(`${t} must be hex string or Uint8Array`);let i=n.length;if("number"==typeof r&&i!==r)throw Error(`${t} expected ${r} bytes, got ${i}`);return n}function P(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];y(n),e+=n.length}let r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){let i=t[e];r.set(i,n),n+=i.length}return r}let _=t=>(g<<BigInt(t-1))-p,O=t=>new Uint8Array(t),T=t=>Uint8Array.from(t);function C(t,e,r){if("number"!=typeof t||t<2)throw Error("hashLen must be a number");if("number"!=typeof e||e<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=O(t),i=O(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...t)=>r(i,n,...t),u=(t=O())=>{i=a(T([0]),t),n=a(),0!==t.length&&(i=a(T([1]),t),n=a())},l=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(n=a()).slice();r.push(e),t+=n.length}return P(...r)};return(t,e)=>{let r;for(o(),u(t);!(r=e(l()));)u();return o(),r}}let L={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||m(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function R(t,e,r={}){let n=(e,r,n)=>{let i=L[r];if("function"!=typeof i)throw Error(`Invalid validator "${r}", expected function`);let s=t[e];if((!n||void 0!==s)&&!i(s,t))throw Error(`Invalid param ${String(e)}=${s} (${typeof s}), expected ${r}`)};for(let[t,r]of Object.entries(e))n(t,r,!1);for(let[t,e]of Object.entries(r))n(t,e,!0);return t}let z=BigInt(0),$=BigInt(1),q=BigInt(2),N=BigInt(3),U=BigInt(4),W=BigInt(5),j=BigInt(8);function K(t,e){let r=t%e;return r>=z?r:e+r}function F(t,e,r){let n=t;for(;e-- >z;)n*=n,n%=r;return n}function D(t,e){if(t===z||e<=z)throw Error(`invert: expected positive integers, got n=${t} mod=${e}`);
8let r=K(t,e),n=e,i=z,s=$,o=$,a=z;for(;r!==z;){let t=n/r,e=n%r,u=i-o*t,l=s-a*t;n=r,r=e,i=o,s=a,o=u,a=l}if(n!==$)throw Error("invert: does not exist");return K(i,e)}BigInt(9),BigInt(16);let G=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function H(t,e){let r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function J(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function V(t){let e=J(t);return e+Math.ceil(e/2)}class Z extends s.kb{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,i.vp)(t);let r=(0,s.O0)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?t.create().update(r).digest():r);for(let t=0;t<o.length;t++)o[t]^=54;this.iHash.update(o),this.oHash=t.create();for(let t=0;t<o.length;t++)o[t]^=106;this.oHash.update(o),o.fill(0)}update(t){return(0,i.Gg)(this),this.iHash.update(t),this}digestInto(t){(0,i.Gg)(this),(0,i.aI)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:o}=this;return t.finished=n,t.destroyed=i,t.blockLen=s,t.outputLen=o,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let Y=(t,e,r)=>new Z(t,e).update(r).digest();Y.create=(t,e)=>new Z(t,e);let X=BigInt(0),Q=BigInt(1);function tt(t){return R(t.Fp,G.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),R(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...H(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}let{bytesToNumberBE:te,hexToBytes:tr}=n,tn={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(t){let{Err:e}=tn;if(t.length<2||2!==t[0])throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(128&n[0])throw new e("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new e("Invalid signature integer: unnecessary leading zero");return{d:te(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=tn,r="string"==typeof t?tr(t):t;y(r);let n=r.length;if(n<2||48!=r[0])throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=tn._parseInt(r.subarray(2)),{d:o,l:a}=tn._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=t=>8&Number.parseInt(t[0],16)?"00"+t:t,r=t=>{let e=t.toString(16);return 1&e.length?`0${e}`:e},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),u=r(o);return`30${r(o+s+4)}02${u}${i}02${a}${n}`}},ti=BigInt(0),ts=BigInt(1),to=(BigInt(2),BigInt(3));BigInt(4);let ta=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),tu=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),tl=BigInt(1),th=BigInt(2),tc=(t,e)=>(t+e/th)/e,td=function(t,e,r=!1,n={}){if(t<=z)throw Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=H(t,e);if(s>2048)throw Error("Field lengths over 2048 bytes are not supported");let o=function(t){if(t%U===N){let e=(t+$)/U;return function(t,r){let n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw Error("Cannot find square root");return n}}if(t%j===W){let e=(t-W)/j;return function(t,r){let n=t.mul(r,q),i=t.pow(n,e),s=t.mul(r,i),o=t.mul(t.mul(s,q),i),a=t.mul(s,t.sub(o,t.ONE));if(!t.eql(t.sqr(a),r))throw Error("Cannot find square root");return a}}return function(t){let e,r,n;let i=(t-$)/q;for(e=t-$,r=0;e%q===z;e/=q,r++);for(n=q;n<t&&function(t,e,r){if(r<=z||e<z)throw Error("Expected power/modulo > 0");if(r===$)return z;let n=$;for(;e>z;)e&$&&(n=n*t%r),t=t*t%r,e>>=$;return n}(n,i,t)!==t-$;n++);if(1===r){let e=(t+$)/U;return function(t,r){let n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw Error("Cannot find square root");return n}}let s=(e+$)/q;return function(t,o){if(t.pow(o,i)===t.neg(t.ONE))throw Error("Cannot find square root");let a=r,u=t.pow(t.mul(t.ONE,n),e),l=t.pow(o,s),h=t.pow(o,e);for(;!t.eql(h,t.ONE);){if(t.eql(h,t.ZERO))return t.ZERO;let e=1;for(let r=t.sqr(h);e<a&&!t.eql(r,t.ONE);e++)r=t.sqr(r);let r=t.pow(u,$<<BigInt(a-e-1));u=t.sqr(r),l=t.mul(l,r),h=t.mul(h,u),a=e}return l}}(t)}
vendor: 4,302 bytes, line 8
8(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:_(i),ZERO:z,ONE:$,create:e=>K(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error(`Invalid field element: expected bigint, got ${typeof e}`);return z<=e&&e<t},is0:t=>t===z,isOdd:t=>(t&$)===$,neg:e=>K(-e,t),eql:(t,e)=>t===e,sqr:e=>K(e*e,t),add:(e,r)=>K(e+r,t),sub:(e,r)=>K(e-r,t),mul:(e,r)=>K(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<z)throw Error("Expected power > 0");if(r===z)return t.ONE;if(r===$)return e;let n=t.ONE,i=e;for(;r>z;)r&$&&(n=t.mul(n,i)),i=t.sqr(i),r>>=$;return n})(a,t,e),div:(e,r)=>K(e*D(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>D(e,t),sqrt:n.sqrt||(t=>o(a,t)),invertBatch:t=>(function(t,e){let r=Array(e.length),n=e.reduce((e,n,i)=>t.is0(n)?e:(r[i]=e,t.mul(e,n)),t.ONE),i=t.inv(n);return e.reduceRight((e,n,i)=>t.is0(n)?e:(r[i]=t.mul(e,r[i]),t.mul(e,n)),i),r})(a,t),cmov:(t,e,r)=>r?e:t,toBytes:t=>r?A(t,s):E(t,s),fromBytes:t=>{if(t.length!==s)throw Error(`Fp.fromBytes: expected ${s}, got ${t.length}`);return r?M(t):S(t)}});return Object.freeze(a)}(ta,void 0,void 0,{sqrt:function(t){let e=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),s=BigInt(23),o=BigInt(44),a=BigInt(88),u=t*t*t%ta,l=u*u*t%ta,h=F(l,e,ta)*l%ta,c=F(h,e,ta)*l%ta,d=F(c,th,ta)*u%ta,f=F(d,n,ta)*d%ta,p=F(f,i,ta)*f%ta,g=F(p,o,ta)*p%ta,m=F(g,a,ta)*g%ta,y=F(m,o,ta)*p%ta,b=F(y,e,ta)*l%ta,w=F(b,s,ta)*f%ta,v=F(w,r,ta)*u%ta,k=F(v,th,ta);if(!td.eql(td.sqr(k),t))throw Error("Cannot find square root");return k}}),tf=function(t,e){let r=e=>(function(t){let e=function(t){let e=tt(t);return R(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:r,n:n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(t){return K(t,n)}let{ProjectivePoint:a,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:h}=function(t){let e=function(t){let e=tt(t);R(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:r}=e,n=e.toBytes||((t,e,n)=>{let i=e.toAffine();return P(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),i=e.fromBytes||(t=>{let e=t.subarray(1);return{x:r.fromBytes(e.subarray(0,r.BYTES)),y:r.fromBytes(e.subarray(r.BYTES,2*r.BYTES))}});function s(t){let{a:n,b:i}=e,s=r.sqr(t),o=r.mul(s,t);return r.add(r.add(o,r.mul(t,n)),i)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw Error("bad generator point: equation left != right");function o(t){return"bigint"==typeof t&&ti<t&&t<e.n}function a(t){if(!o(t))throw Error("Expected valid bigint: 0 < bigint < curve.n")}function u(t){let r;let{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:s,n:o}=e;if(n&&"bigint"!=typeof t){if(m(t)&&(t=w(t)),"string"!=typeof t||!n.includes(t.length))throw Error("Invalid key");t=t.padStart(2*i,"0")}try{r="bigint"==typeof t?t:S(B("private key",t,i))}catch(e){throw Error(`private key must be ${i} bytes, hex or bigint, not ${typeof t}`)}return s&&(r=K(r,o)),a(r),r}let l=new Map;function h(t){if(!(t instanceof c))throw Error("ProjectivePoint expected")}class c{constructor(t,e,n){if(this.px=t,this.py=e,this.pz=n,null==t||!r.isValid(t))throw Error("x required");if(null==e||!r.isValid(e))throw Error("y required");if(null==n||!r.isValid(n))throw Error("z required")}static fromAffine(t){let{x:e,y:n}=t||{};if(!t||!r.isValid(e)||!r.isValid(n))throw Error("invalid affine point");if(t instanceof c)throw Error("projective point not allowed");let i=t=>r.eql(t,r.ZERO);return i(e)&&i(n)?c.ZERO:new c(e,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){let e=r.invertBatch(t.map(t=>t.pz));return t.map((t,r)=>t.toAffine(e[r])).map(c.fromAffine)}static fromHex(t){let e=c.fromAffine(i(B("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return c.BASE.multiply(u(t))}_setWindowSize(t){this._WINDOW_SIZE=t,l.delete(this)}
8assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw Error("bad point: ZERO")}let{x:t,y:n}=this.toAffine();if(!r.isValid(t)||!r.isValid(n))throw Error("bad point: x or y not FE");let i=r.sqr(n),o=s(t);if(!r.eql(i,o))throw Error("bad point: equation left != right");if(!this.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:t}=this.toAffine();if(r.isOdd)return!r.isOdd(t);throw Error("Field doesn't support isOdd")}equals(t){h(t);let{px:e,py:n,pz:i}=this,{px:s,py:o,pz:a}=t,u=r.eql(r.mul(e,a),r.mul(s,i)),l=r.eql(r.mul(n,a),r.mul(o,i));return u&&l}negate(){return new c(this.px,r.neg(this.py),this.pz)}double(){let{a:t,b:n}=e,i=r.mul(n,to),{px:s,py:o,pz:a}=this,u=r.ZERO,l=r.ZERO,h=r.ZERO,d=r.mul(s,s),f=r.mul(o,o),p=r.mul(a,a),g=r.mul(s,o);return g=r.add(g,g),h=r.mul(s,a),h=r.add(h,h),u=r.mul(t,h),l=r.mul(i,p),l=r.add(u,l),u=r.sub(f,l),l=r.add(f,l),l=r.mul(u,l),u=r.mul(g,u),h=r.mul(i,h),p=r.mul(t,p),g=r.sub(d,p),g=r.mul(t,g),g=r.add(g,h),h=r.add(d,d),d=r.add(h,d),d=r.add(d,p),d=r.mul(d,g),l=r.add(l,d),p=r.mul(o,a),p=r.add(p,p),d=r.mul(p,g),u=r.sub(u,d),h=r.mul(p,f),h=r.add(h,h),new c(u,l,h=r.add(h,h))}add(t){h(t);let{px:n,py:i,pz:s}=this,{px:o,py:a,pz:u}=t,l=r.ZERO,d=r.ZERO,f=r.ZERO,p=e.a,g=r.mul(e.b,to),m=r.mul(n,o),y=r.mul(i,a),b=r.mul(s,u),w=r.add(n,i),v=r.add(o,a);w=r.mul(w,v),v=r.add(m,y),w=r.sub(w,v),v=r.add(n,s);let k=r.add(o,u);return v=r.mul(v,k),k=r.add(m,b),v=r.sub(v,k),k=r.add(i,s),l=r.add(a,u),k=r.mul(k,l),l=r.add(y,b),k=r.sub(k,l),f=r.mul(p,v),l=r.mul(g,b),f=r.add(l,f),l=r.sub(y,f),f=r.add(y,f),d=r.mul(l,f),y=r.add(m,m),y=r.add(y,m),b=r.mul(p,b),v=r.mul(g,v),y=r.add(y,b),b=r.sub(m,b),b=r.mul(p,b),v=r.add(v,b),m=r.mul(y,v),d=r.add(d,m),m=r.mul(k,v),l=r.mul(w,l),l=r.sub(l,m),m=r.mul(w,y),f=r.mul(k,f),new c(l,d,f=r.add(f,m))}subtract(t){return this.add(t.negate())}is0(){return this.equals(c.ZERO)}wNAF(t){return f.wNAFCached(this,l,t,t=>{let e=r.invertBatch(t.map(t=>t.pz));return t.map((t,r)=>t.toAffine(e[r])).map(c.fromAffine)})}multiplyUnsafe(t){let n=c.ZERO;if(t===ti)return n;if(a(t),t===ts)return this;let{endo:i}=e;if(!i)return f.unsafeLadder(this,t);let{k1neg:s,k1:o,k2neg:u,k2:l}=i.splitScalar(t),h=n,d=n,p=this;for(;o>ti||l>ti;)o&ts&&(h=h.add(p)),l&ts&&(d=d.add(p)),p=p.double(),o>>=ts,l>>=ts;return s&&(h=h.negate()),u&&(d=d.negate()),d=new c(r.mul(d.px,i.beta),d.py,d.pz),h.add(d)}multiply(t){let n,i;a(t);let{endo:s}=e;if(s){let{k1neg:e,k1:o,k2neg:a,k2:u}=s.splitScalar(t),{p:l,f:h}=this.wNAF(o),{p:d,f:p}=this.wNAF(u);l=f.constTimeNegate(e,l),d=f.constTimeNegate(a,d),d=new c(r.mul(d.px,s.beta),d.py,d.pz),n=l.add(d),i=h.add(p)}else{let{p:e,f:r}=this.wNAF(t);n=e,i=r}return c.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(t,e,r){let n=c.BASE,i=(t,e)=>e!==ti&&e!==ts&&t.equals(n)?t.multiply(e):t.multiplyUnsafe(e),s=i(this,e).add(i(t,r));return s.is0()?void 0:s}toAffine(t){let{px:e,py:n,pz:i}=this,s=this.is0();null==t&&(t=s?r.ONE:r.inv(i));let o=r.mul(e,t),a=r.mul(n,t),u=r.mul(i,t);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){let{h:t,isTorsionFree:r}=e;if(t===ts)return!0;if(r)return r(c,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:t,clearCofactor:r}=e;return t===ts?this:r?r(c,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return this.assertValidity(),n(c,this,t)}toHex(t=!0){return w(this.toRawBytes(t))}}c.BASE=new c(e.Gx,e.Gy,r.ONE),c.ZERO=new c(r.ZERO,r.ONE,r.ZERO);let d=e.nBitLength,f=function(t,e){let r=(t,e)=>{let r=e.negate();return t?r:e},n=t=>({windows:Math.ceil(e/t)+1,windowSize:2**(t-1)});return{constTimeNegate:r,unsafeLadder(e,r){let n=t.ZERO,i=e;for(;r>X;)r&Q&&(n=n.add(i)),i=i.double(),r>>=Q;return n},precomputeWindow(t,e){let{windows:r,windowSize:i}=n(e),s=[],o=t,a=o;for(let t=0;t<r;t++){a=o,s.push(a);for(let t=1;t<i;t++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(e,i,s){let{windows:o,windowSize:a}=n(e),u=t.ZERO,l=t.BASE,h=BigInt(2**e-1),c=2**e,d=BigInt(e);for(let t=0;t<o;t++){let e=t*a,n=Number(s&h);s>>=d,n>a&&(n-=c,s+=Q);let o=e+Math.abs(n)-1,f=t%2!=0,p=n<0;
80===n?l=l.add(r(f,i[e])):u=u.add(r(p,i[o]))}return{p:u,f:l}},wNAFCached(t,e,r,n){let i=t._WINDOW_SIZE||1,s=e.get(t);return s||(s=this.precomputeWindow(t,i),1!==i&&e.set(t,n(s))),this.wNAF(i,s,r)}}}(c,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:s,isWithinCurveOrder:o}}({...e,toBytes(t,e,n){let i=e.toAffine(),s=r.toBytes(i.x),o=P;return n?o(Uint8Array.from([e.hasEvenY()?2:3]),s):o(Uint8Array.from([4]),s,r.toBytes(i.y))},fromBytes(t){let e=t.length,n=t[0],o=t.subarray(1);if(e===i&&(2===n||3===n)){let t;let e=S(o);if(!(ti<e&&e<r.ORDER))throw Error("Point is not on curve");let i=l(e);try{t=r.sqrt(i)}catch(t){throw Error("Point is not on curve"+(t instanceof Error?": "+t.message:""))}return(1&n)==1!=((t&ts)===ts)&&(t=r.neg(t)),{x:e,y:t}}if(e===s&&4===n)return{x:r.fromBytes(o.subarray(0,r.BYTES)),y:r.fromBytes(o.subarray(r.BYTES,2*r.BYTES))};throw Error(`Point of length ${e} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),c=t=>w(E(t,e.nByteLength)),d=(t,e,r)=>S(t.slice(e,r));class f{constructor(t,e,r){this.r=t,this.s=e,this.recovery=r,this.assertValidity()}static fromCompact(t){let r=e.nByteLength;return new f(d(t=B("compactSignature",t,2*r),0,r),d(t,r,2*r))}static fromDER(t){let{r:e,s:r}=tn.toSig(B("DER",t));return new f(e,r)}assertValidity(){if(!h(this.r))throw Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw Error("s must be 0 < s < CURVE.n")}addRecoveryBit(t){return new f(this.r,this.s,t)}recoverPublicKey(t){let{r:i,s,recovery:u}=this,l=y(B("msgHash",t));if(null==u||![0,1,2,3].includes(u))throw Error("recovery id invalid");let h=2===u||3===u?i+e.n:i;if(h>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let d=(1&u)==0?"02":"03",f=a.fromHex(d+c(h)),p=D(h,n),g=o(-l*p),m=o(s*p),b=a.BASE.multiplyAndAddUnsafe(f,g,m);if(!b)throw Error("point at infinify");return b.assertValidity(),b}hasHighS(){return this.s>n>>ts}normalizeS(){return this.hasHighS()?new f(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return I(this.toDERHex())}toDERHex(){return tn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return I(this.toCompactHex())}toCompactHex(){return c(this.r)+c(this.s)}}function p(t){let e=m(t),r="string"==typeof t,n=(e||r)&&t.length;return e?n===i||n===s:r?n===2*i||n===2*s:t instanceof a}let g=e.bits2int||function(t){let r=S(t),n=8*t.length-e.nBitLength;return n>0?r>>BigInt(n):r},y=e.bits2int_modN||function(t){return o(g(t))},b=_(e.nBitLength);function v(t){if("bigint"!=typeof t)throw Error("bigint expected");if(!(ti<=t&&t<b))throw Error(`bigint expected < 2^${e.nBitLength}`);return E(t,e.nByteLength)}let k={lowS:e.lowS,prehash:!1},x={lowS:e.lowS,prehash:!1};return a.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return a.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(p(t))throw Error("first arg must be private key");if(!p(e))throw Error("second arg must be public key");return a.fromHex(e).multiply(u(t)).toRawBytes(r)},sign:function(t,i,s=k){let{seed:l,k2sig:c}=function(t,i,s=k){if(["recovered","canonical"].some(t=>t in s))throw Error("sign() legacy options not supported");let{hash:l,randomBytes:c}=e,{lowS:d,prehash:p,extraEntropy:m}=s;null==d&&(d=!0),t=B("msgHash",t),p&&(t=B("prehashed msgHash",l(t)));let b=y(t),w=u(i),x=[v(w),v(b)];if(null!=m&&!1!==m){let t=!0===m?c(r.BYTES):m;x.push(B("extraEntropy",t))}return{seed:P(...x),k2sig:function(t){let e=g(t);if(!h(e))return;let r=D(e,n),i=a.BASE.multiply(e).toAffine(),s=o(i.x);if(s===ti)return;let u=o(r*o(b+s*w));if(u===ti)return;let l=(i.x===s?0:2)|Number(i.y&ts),c=u;if(d&&u>n>>ts)c=u>n>>ts?o(-u):u,l^=1;return new f(s,c,l)}}}(t,i,s);return C(e.hash.outputLen,e.nByteLength,e.hmac)(l,c)},verify:function(t,r,i,s=x){let u,l;if(r=B("msgHash",r),i=B("publicKey",i),"strict"in s)throw Error("options.strict was renamed to lowS");let{lowS:h,prehash:c}=s;try{if("string"==typeof t||m(t))try{l=f.fromDER(t)}catch(e){if(!(e instanceof tn.Err))throw e;l=f.fromCompact(t)}else if("object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s){let{r:e,s:r}=t;l=new f(e,r)}else throw Error("PARSE");u=a.fromHex(i)}catch(t){if("PARSE"===t.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(h&&l.hasHighS())return!1;c&&(r=e.hash(r));let{r:d,s:p}=l,g=y(r),b=D(p,n),w=o(g*b),v=o(d*b),k=a.BASE.multiplyAndAddUnsafe(u,w,v)?.toAffine();return!!k&&o(k.x)===d},ProjectivePoint:a,Signature:f,utils:{isValidPrivateKey(t){try{return u(t),!0}catch(t){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let t=V(e.n);return function(t,e,r=!1){let n=t.length,i=J(e),s=V(e);if(n<16||n<s||n>1024)throw Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=K(r?S(t):M(t),e-$)+$;return r?A(o,i):E(o,i)}(e.randomBytes(t),e.n)},precompute:(t=8,e=a.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}})({...t,hash:e,hmac:(t,...r)=>Y(e,t,(0,s.eV)(...r)),randomBytes:s.O6});return Object.freeze({...r(e),create:r})}({a:BigInt(0),b:BigInt(7),Fp:td,n:tu,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-tl*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),s=tc(e*t,tu),o=tc(-r*t,tu),a=K(t-s*e-o*n,tu),u=K(-s*r-o*e,tu),l=a>i,h=u>i;
vendor: 4,937 bytes, line 8
8if(l&&(a=tu-a),h&&(u=tu-u),a>i||u>i)throw Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:a,k2neg:h,k2:u}}}},f);BigInt(0),tf.ProjectivePoint;var tp=r(87524),tg=r(27373),tm=r(77272),ty=r(29583),tb=r(20068),tw=r(95455),tv=r(9365);async function tk({hash:t,privateKey:e,to:r="object"}){let{r:n,s:i,recovery:s}=tf.sign(t.slice(2),e.slice(2)),o={r:(0,tp.eC)(n,{size:32}),s:(0,tp.eC)(i,{size:32}),v:s?28n:27n,yParity:s};return"bytes"===r||"hex"===r?function({r:t,s:e,to:r="hex",v:n,yParity:i}){let s=(()=>{if(0===i||1===i)return i;if(n&&(27n===n||28n===n||n>=35n))return n%2n===0n?1:0;throw Error("Invalid `v` or `yParity` value")})(),o=`0x${new tf.Signature((0,tw.y_)(t),(0,tw.y_)(e)).toCompactHex()}${0===s?"1b":"1c"}`;return"hex"===r?o:(0,tv.nr)(o)}({...o,to:r}):o}function tx(t){return"string"==typeof t[0]?tI(t):function(t){let e=0;for(let r of t)e+=r.length;let r=new Uint8Array(e),n=0;for(let e of t)r.set(e,n),n+=e.length;return r}(t)}function tI(t){return`0x${t.reduce((t,e)=>t+e.replace("0x",""),"")}`}var tS=r(45688);class tM extends tS.G{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class tE extends tS.G{constructor({length:t,position:e}){super(`Position \`${e}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class tA extends tS.G{constructor({count:t,limit:e}){super(`Recursive read limit of \`${e}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}let tB={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new tA({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new tE({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new tM({offset:t});let e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new tM({offset:t});let e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){let e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){let r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){let e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){let e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){let e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){let e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,255&t),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();let r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();let t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();let t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();let t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();let t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){let e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function tP(t,{recursiveReadLimit:e=8192}={}){let r=Object.create(tB);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function t_(t,e="hex"){let r=function t(e){return Array.isArray(e)?function(t){let e=t.reduce((t,e)=>t+e.length,0),r=tO(e);return{length:e<=55?1+e:1+r+e,encode(n){for(let{encode:i}of(e<=55?n.pushByte(192+e):(n.pushByte(247+r),1===r?n.pushUint8(e):2===r?n.pushUint16(e):3
8===r?n.pushUint24(e):n.pushUint32(e)),t))i(n)}}}(e.map(e=>t(e))):function(t){let e="string"==typeof t?(0,tv.nr)(t):t,r=tO(e.length);return{length:1===e.length&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(t){1===e.length&&e[0]<128||(e.length<=55?t.pushByte(128+e.length):(t.pushByte(183+r),1===r?t.pushUint8(e.length):2===r?t.pushUint16(e.length):3===r?t.pushUint24(e.length):t.pushUint32(e.length))),t.pushBytes(e)}}}(e)}(t),n=tP(new Uint8Array(r.length));return(r.encode(n),"hex"===e)?(0,tp.ci)(n.bytes):n.bytes}function tO(t){if(t<256)return 1;if(t<65536)return 2;if(t<16777216)return 3;if(t<4294967296)return 4;throw new tS.G("Length is too large.")}async function tT(t){let{contractAddress:e,chainId:r,nonce:n,privateKey:i,to:s="object"}=t,o=await tk({hash:function(t){let{chainId:e,contractAddress:r,nonce:n,to:i}=t,s=(0,tb.w)(tI(["0x05",t_([(0,tp.eC)(e),r,(0,tp.eC)(n)])]));return"bytes"===i?(0,tv.nr)(s):s}({contractAddress:e,chainId:r,nonce:n}),privateKey:i,to:s});return"object"===s?{contractAddress:e,chainId:r,nonce:n,...o}:o}var tC=r(86340);async function tL({message:t,privateKey:e}){return await tk({hash:(0,tb.w)(function(t){let e="string"==typeof t?(0,tp.$G)(t):"string"==typeof t.raw?t.raw:(0,tp.ci)(t.raw);return tx([(0,tp.$G)(`\x19Ethereum Signed Message:
9${(0,tC.d)(e)}`),e])}(t),void 0),privateKey:e,to:"hex"})}let tR={ether:-9,wei:9};function tz(t,e="wei"){return function(t,e){let r=t.toString(),n=r.startsWith("-");n&&(r=r.slice(1));let[i,s]=[(r=r.padStart(e,"0")).slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}(t,tR[e])}class t$ extends tS.G{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class tq extends tS.G{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",function(t){let e=Object.entries(t).map(([t,e])=>void 0===e||!1===e?null:[t,e]).filter(Boolean),r=e.reduce((t,[e])=>Math.max(t,e.length),0);return e.map(([t,e])=>`  ${`${t}:`.padEnd(r+1)}  ${e}`).join("\n")}(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class tN extends tS.G{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}function tU(t){let{kzg:e}=t,r=t.to??("string"==typeof t.blobs[0]?"hex":"bytes"),n="string"==typeof t.blobs[0]?t.blobs.map(t=>(0,tv.nr)(t)):t.blobs,i=[];for(let t of n)i.push(Uint8Array.from(e.blobToKzgCommitment(t)));return"bytes"===r?i:i.map(t=>(0,tp.ci)(t))}function tW(t){let{kzg:e}=t,r=t.to??("string"==typeof t.blobs[0]?"hex":"bytes"),n="string"==typeof t.blobs[0]?t.blobs.map(t=>(0,tv.nr)(t)):t.blobs,i="string"==typeof t.commitments[0]?t.commitments.map(t=>(0,tv.nr)(t)):t.commitments,s=[];for(let t=0;t<n.length;t++){let r=n[t],o=i[t];s.push(Uint8Array.from(e.computeBlobKzgProof(r,o)))}return"bytes"===r?s:s.map(t=>(0,tp.ci)(t))}var tj=r(54959);class tK extends tS.G{constructor({maxSize:t,size:e}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${e} bytes`],name:"BlobSizeTooLargeError"})}}class tF extends tS.G{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class tD extends tS.G{constructor({hash:t,size:e}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${e}`],name:"InvalidVersionedHashSizeError"})}}class tG extends tS.G{constructor({hash:t,version:e}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:["Expected: 1",`Received: ${e}`],name:"InvalidVersionedHashVersionError"})}}function tH(t,{dir:e="left"}={}){let r="string"==typeof t?t.replace("0x",""):t,n=0;for(let t=0;t<r.length-1&&"0"===r["left"===e?t:r.length-t-1].toString();t++)n++;
9return(r="left"===e?r.slice(n):r.slice(0,r.length-n),"string"==typeof t)?(1===r.length&&"right"===e&&(r=`${r}0`),`0x${r.length%2==1?`0${r}`:r}`):r}class tJ extends tS.G{constructor({chainId:t}){super("number"==typeof t?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class tV extends tS.G{constructor({cause:t,message:e}={}){let r=e?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(tV,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(tV,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class tZ extends tS.G{constructor({cause:t,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${tz(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(tZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class tY extends tS.G{constructor({cause:t,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${tz(e)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(tY,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class tX extends tS.G{constructor({cause:t,nonce:e}={}){super(`Nonce provided for the transaction ${e?`(${e}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(tX,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class tQ extends tS.G{constructor({cause:t,nonce:e}={}){super(`Nonce provided for the transaction ${e?`(${e}) `:""}is lower than the current nonce of the account.
10Try increasing the nonce or find the latest nonce with \`getTransactionCount\`.`,{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(tQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class t0 extends tS.G{constructor({cause:t,nonce:e}={}){super(`Nonce provided for the transaction ${e?`(${e}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(t0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class t1 extends tS.G{constructor({cause:t}={}){super("The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.",{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(t1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class t2 extends tS.G{constructor({cause:t,gas:e}={}){super(`The amount of gas ${e?`(${e}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(t2,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class t8 extends tS.G{constructor({cause:t,gas:e}={}){super(`The amount of gas ${e?`(${e}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(t8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class t6 extends tS.G{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(t6,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class t3 extends tS.G{constructor({cause:t,maxPriorityFeePerGas:e,maxFeePerGas:r}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${tz(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${tz(r)} gwei`:""}).`,{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(t3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});var t4=r(86359);function t5(t,e,r,{strict:n}={}){return(0,tj.v)(t,{strict:!1})?function(t,e,r,{strict:n}={}){t7(t,e);let i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&t9(i,e,r),i}(t,e,r,{strict:n}):function(t,e,r,{strict:n}={}){t7(t,e);let i=t.slice(e,r);return n&&t9(i,e,r),i}(t,e,r,{strict:n})}function t7(t,e){if("number"==typeof e&&e>0&&e>(0,tC.d)(t)-1)throw new t4.mV({offset:e,position:"start",size:(0,tC.d)(t)})}function t9(t,e,r){if("number"==typeof e&&"number"==typeof r&&(0,tC.d)(t)!==r-e)throw new t4.mV({offset:r,position:"end",size:(0,tC.d)(t)})}function et(t){let{chainId:e,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=t;if(e<=0)throw new tJ({chainId:e});if(i&&!(0,tm.U)(i))throw new tg.b({address:i});if(n&&n>2n**256n-1n)throw new tZ({maxFeePerGas:n});if(r&&n&&r>n)throw new t3({maxFeePerGas:n,maxPriorityFeePerGas:r})}function ee(t){if(!t||0===t.length)return[];let e=[];for(let r=0;r<t.length;r++){let{address:n,storageKeys:i}=t[r];for(let t=0;t<i.length;t++)if(i[t].length-2!=64)throw new tN({storageKey:i[t]});if(!(0,tm.U)(n,{strict:!1}))throw new tg.b({address:n});e.push([n,i])}return e}function er(t,e){let r=function(t){if(t.type)return t.type;if(void 0!==t.authorizationList)return"eip7702";if(void 0!==t.blobs||void 0!==t.blobVersionedHashes||void 0!==t.maxFeePerBlobGas||void 0!==t.sidecars)return"eip4844";if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)return"eip1559";if(void 0!==t.gasPrice)return void 0!==t.accessList?"eip2930":"legacy";throw new tq({transaction:t})}(t);return"eip1559"===r?function(t,e){let{chainId:r,gas:n,nonce:i,to:s,value:o,maxFeePerGas:a,maxPriorityFeePerGas:u,accessList:l,data:h}=t;et(t);let c=ee(l);return tI(["0x02",t_([(0,tp.NC)(r),i?(0,tp.NC)(i):"0x",u?(0,tp.NC)(u):"0x",a?(0,tp.NC)(a):"0x",n?(0,tp.NC)(n):"0x",s??"0x",o?(0,tp.NC)(o):"0x",h??"0x",c,...en(t,e)])])}(t,e):"eip2930"===r?function(t,e){let{chainId:r,gas:n,data:i,nonce:s,to:o,value:a,accessList:u,gasPrice:l}=t;!function(t){let{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:s}=t;if(e<=0)throw new tJ({chainId:e});if(s&&!(0,tm.U)(s))throw new tg.b({address:s});if(r||i)throw new tS.G("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>2n**256n-1n)throw new tZ({maxFeePerGas:n})}(t);let h=ee(u);return tI(["0x01",t_([(0,tp.NC)(r),s?(0,tp.NC)(s):"0x",l?(0,tp.NC)(l):"0x",n?(0,tp.NC)(n):"0x",o??"0x",a?(0,tp.NC)(a):"0x",i??"0x",h,...en(t,e)])])}(t,e):"eip4844"===r?function(t,e){let{chainId:r,gas:n,nonce:i,to:s,value:o,maxFeePerBlobGas:a,maxFeePerGas:u,maxPriorityFeePerGas:l,accessList:h,data:c}=t;!function(t){let{blobVersionedHashes:e}=t;if(e){if(0===e.length)throw new tF;for(let t of e){let e=(0,tC.d)(t),r=(0,tw.ly)(t5(t,0,1));if(32!==e)throw new tD({hash:t,size:e});if(1!==r)throw new tG({hash:t,version:r})}}et(t)}(t);let d=t.blobVersionedHashes,p=t.sidecars;if(t.blobs&&(void 0===d||void 0===p)){let e="string"==typeof t.blobs[0]?t.blobs:t.blobs.map(t=>(0,tp.ci)(t)),r=t.kzg,n=tU({blobs:e,kzg:r});if(void 0===d&&(d=function(t){let{commitments:e,version:r}=t,n=t.to??("string"==typeof e[0]?"hex":"bytes"),i=[];for(let t of e)i.push(function(t){let{commitment:e,version:r=1}=t,n=t.to??("string"==typeof e?"hex":"bytes"),i=function(t,e){let r=f((0,tj.v)(t,{strict:!1})?(0,tv.O0)(t):t);return"bytes"===(e||"hex")?r:(0,tp.NC)(r)}(e,"bytes");return i.set([r],0),"bytes"===n?i:(0,tp.ci)(i)}({commitment:t,to:n,version:r}));return i}({commitments:n})),void 0===p){let t=tW({blobs:e,commitments:n,kzg:r});p=function(t){let{data:e,kzg:r,to:n}
10=t,i=t.blobs??function(t){let e=t.to??("string"==typeof t.data?"hex":"bytes"),r="string"==typeof t.data?(0,tv.nr)(t.data):t.data,n=(0,tC.d)(r);if(!n)throw new tF;if(n>761855)throw new tK({maxSize:761855,size:n});let i=[],s=!0,o=0;for(;s;){let t=tP(new Uint8Array(131072)),e=0;for(;e<4096;){let n=r.slice(o,o+31);if(t.pushByte(0),t.pushBytes(n),n.length<31){t.pushByte(128),s=!1;break}e++,o+=31}i.push(t)}return"bytes"===e?i.map(t=>t.bytes):i.map(t=>(0,tp.ci)(t.bytes))}({data:e,to:n}),s=t.commitments??tU({blobs:i,kzg:r,to:n}),o=t.proofs??tW({blobs:i,commitments:s,kzg:r,to:n}),a=[];for(let t=0;t<i.length;t++)a.push({blob:i[t],commitment:s[t],proof:o[t]});return a}({blobs:e,commitments:n,proofs:t})}}let g=ee(h),m=[(0,tp.NC)(r),i?(0,tp.NC)(i):"0x",l?(0,tp.NC)(l):"0x",u?(0,tp.NC)(u):"0x",n?(0,tp.NC)(n):"0x",s??"0x",o?(0,tp.NC)(o):"0x",c??"0x",g,a?(0,tp.NC)(a):"0x",d??[],...en(t,e)],y=[],b=[],w=[];if(p)for(let t=0;t<p.length;t++){let{blob:e,commitment:r,proof:n}=p[t];y.push(e),b.push(r),w.push(n)}return tI(["0x03",p?t_([m,y,b,w]):t_(m)])}(t,e):"eip7702"===r?function(t,e){let{authorizationList:r,chainId:n,gas:i,nonce:s,to:o,value:a,maxFeePerGas:u,maxPriorityFeePerGas:l,accessList:h,data:c}=t;!function(t){let{authorizationList:e}=t;if(e)for(let t of e){let{contractAddress:e,chainId:r}=t;if(!(0,tm.U)(e))throw new tg.b({address:e});if(r<=0)throw new tJ({chainId:r})}et(t)}(t);let d=ee(h),f=function(t){if(!t||0===t.length)return[];let e=[];
10for(let r of t){let{contractAddress:t,chainId:n,nonce:i,...s}=r;e.push([(0,tp.NC)(n),t,(0,tp.NC)(i),...en({},s)])}return e}(r);return tI(["0x04",t_([(0,tp.NC)(n),s?(0,tp.NC)(s):"0x",l?(0,tp.NC)(l):"0x",u?(0,tp.NC)(u):"0x",i?(0,tp.NC)(i):"0x",o??"0x",a?(0,tp.NC)(a):"0x",c??"0x",d,f,...en(t,e)])])}(t,e):function(t,e){let{chainId:r=0,gas:n,data:i,nonce:s,to:o,value:a,gasPrice:u}=t;!function(t){let{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:s}=t;if(s&&!(0,tm.U)(s))throw new tg.b({address:s});if(void 0!==e&&e<=0)throw new tJ({chainId:e});if(r||i)throw new tS.G("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>2n**256n-1n)throw new tZ({maxFeePerGas:n})}(t);let l=[s?(0,tp.NC)(s):"0x",u?(0,tp.NC)(u):"0x",n?(0,tp.NC)(n):"0x",o??"0x",a?(0,tp.NC)(a):"0x",i??"0x"];if(e){let t=(()=>{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(35n===e.v?0n:1n);if(r>0)return BigInt(2*r)+BigInt(35n+e.v-27n);let t=27n+(27n===e.v?0n:1n);if(e.v!==t)throw new t$({v:e.v});return t})(),n=tH(e.r),i=tH(e.s);l=[...l,(0,tp.NC)(t),"0x00"===n?"0x":n,"0x00"===i?"0x":i]}else r>0&&(l=[...l,(0,tp.NC)(r),"0x","0x"]);return t_(l)}(t,e)}function en(t,e){let r=e??t,{v:n,yParity:i}=r;if(void 0===r.r||void 0===r.s||void 0===n&&void 0===i)return[];let s=tH(r.r),o=tH(r.s);return["number"==typeof i?i?(0,tp.NC)(1):"0x":0n===n?"0x":1n===n?(0,tp.NC)(1):27n===n?"0x":(0,tp.NC)(1),"0x00"===s?"0x":s,"0x00"===o?"0x":o]}async function ei(t){let{privateKey:e,transaction:r,serializer:n=er}=t,i="eip4844"===r.type?{...r,sidecars:!1}:r,s=await tk({hash:(0,tb.w)(n(i)),privateKey:e});return n(r,s)}class es extends tS.G{constructor({expectedLength:t,givenLength:e,type:r}){super(`ABI encoding array length mismatch for type ${r}.
11Expected length: ${t}
12Given length: ${e}`,{name:"AbiEncodingArrayLengthMismatchError"})}}class eo extends tS.G{constructor({expectedSize:t,value:e}){super(`Size of bytes "${e}" (bytes${(0,tC.d)(e)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class ea extends tS.G{constructor({expectedLength:t,givenLength:e}){super(`ABI encoding params/values length mismatch.
13Expected length (params): ${t}
14Given length (values): ${e}`,{name:"AbiEncodingLengthMismatchError"})}}class eu extends tS.G{constructor({expectedSize:t,givenSize:e}){super(`Expected bytes${t}, got bytes${e}.`,{name:"BytesSizeMismatchError"})}}class el extends tS.G{constructor(t,{docsPath:e}){super(`Type "${t}" is not a valid encoding type.
15Please provide a valid ABI type.`,{docsPath:e,name:"InvalidAbiEncodingType"})}}class eh extends tS.G{constructor(t){super(`Value "${t}" is not a valid array.`,{name:"InvalidArrayError"})}}var ec=r(68500);function ed(t,e){if(t.length!==e.length)throw new ea({expectedLength:t.length,givenLength:e.length});let r=ef(function({params:t,values:e}){let r=[];for(let n=0;n<t.length;n++)r.push(function t({param:e,value:r}){let n=function(t){let e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}(e.type);if(n){let[i,s]=n;return function(e,{length:r,param:n}){let i=null===r;if(!Array.isArray(e))throw new eh(e);if(!i&&e.length!==r)throw new es({expectedLength:r,givenLength:e.length,type:`${n.type}[${r}]`});let s=!1,o=[];for(let r=0;r<e.length;r++){let i=t({param:n,value:e[r]});i.dynamic&&(s=!0),o.push(i)}if(i||s){let t=ef(o);if(i){let e=(0,tp.eC)(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?tx([e,t]):e}}if(s)return{dynamic:!0,encoded:t}}return{dynamic:!1,encoded:tx(o.map(({encoded:t})=>t))}}(r,{length:i,param:{...e,type:s}})}if("tuple"===e.type)return function(e,{param:r}){let n=!1,i=[];for(let s=0;s<r.components.length;s++){let o=r.components[s],a=Array.isArray(e)?s:o.name,u=t({param:o,value:e[a]});i.push(u),u.dynamic&&(n=!0)}return{dynamic:n,encoded:n?ef(i):tx(i.map(({encoded:t})=>t))}}(r,{param:e});if("address"===e.type)return function(t){if(!(0,tm.U)(t))throw new tg.b({address:t});return{dynamic:!1,encoded:(0,ec.gc)(t.toLowerCase())}}(r);if("bool"===e.type)return function(t){if("boolean"!=typeof t)throw new tS.G(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,ec.gc)((0,tp.C4)(t))}}(r);if(e.type.startsWith("uint")||e.type.startsWith("int"))return function(t,{signed:e}){return{dynamic:!1,encoded:(0,tp.eC)(t,{size:32,signed:e})}}(r,{signed:e.type.startsWith("int")});if(e.type.startsWith("bytes"))return function(t,{param:e}){let[,r]=e.type.split("bytes"),n=(0,tC.d)(t);if(!r){let e=t;return n%32!=0&&(e=(0,ec.gc)(e,{dir:"right",size:32*Math.ceil((t.length-2)/2/32)})),{dynamic:!0,encoded:tx([(0,ec.gc)((0,tp.eC)(n,{size:32})),e])}}if(n!==Number.parseInt(r))throw new eo({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:(0,ec.gc)(t,{dir:"right"})}}(r,{param:e});if("string"===e.type)return function(t){let e=(0,tp.$G)(t),r=Math.ceil((0,tC.d)(e)/32),n=[];for(let t=0;t<r;t++)n.push((0,ec.gc)(t5(e,32*t,(t+1)*32),{dir:"right"}));return{dynamic:!0,encoded:tx([(0,ec.gc)((0,tp.eC)((0,tC.d)(e),{size:32})),...n])}}(r);throw new el(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}({param:t[n],value:e[n]}));return r}({params:t,values:e}));return 0===r.length?"0x":r}function ef(t){let e=0;for(let r=0;r<t.length;r++){let{dynamic:n,encoded:i}=t[r];n?e+=32:e+=(0,tC.d)(i)}let r=[],n=[],i=0;for(let s=0;s<t.length;s++){let{dynamic:o,encoded:a}=t[s];o?(r.push((0,tp.eC)(e+i,{size:32})),n.push(a),i+=(0,tC.d)(a)):r.push(a)}return tx([...r,...n])}
15let ep=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,eg=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function em({data:t,primaryType:e,types:r}){let n=function t({data:e,primaryType:r,types:n}){let i=[{type:"bytes32"}],s=[function({primaryType:t,types:e}){let r=(0,tp.NC)(function({primaryType:t,types:e}){let r="",n=function t({primaryType:e,types:r},n=new Set){let i=e.match(/^\w*/u),s=i?.[0];if(n.has(s)||void 0===r[s])return n;for(let e of(n.add(s),r[s]))t({primaryType:e.type,types:r},n);return n}({primaryType:t,types:e});for(let i of(n.delete(t),[t,...Array.from(n).sort()]))r+=`${i}(${e[i].map(({name:t,type:e})=>`${e} ${t}`).join(",")})`;return r}({primaryType:t,types:e}));return(0,tb.w)(r)}({primaryType:r,types:n})];for(let o of n[r]){let[r,a]=function e({types:r,name:n,type:i,value:s}){if(void 0!==r[i])return[{type:"bytes32"},(0,tb.w)(t({data:s,primaryType:i,types:r}))];if("bytes"===i){let t=s.length%2?"0":"";return s=`0x${t+s.slice(2)}`,[{type:"bytes32"},(0,tb.w)(s)]}if("string"===i)return[{type:"bytes32"},(0,tb.w)((0,tp.NC)(s))];if(i.lastIndexOf("]")===i.length-1){let t=i.slice(0,i.lastIndexOf("[")),o=s.map(i=>e({name:n,type:t,types:r,value:i}));return[{type:"bytes32"},(0,tb.w)(ed(o.map(([t])=>t),o.map(([,t])=>t)))]}return[{type:i},s]}({types:n,name:o.name,type:o.type,value:e[o.name]});i.push(r),s.push(a)}return ed(i,s)}({data:t,primaryType:e,types:r});return(0,tb.w)(n)}async function ey(t){let{privateKey:e,...r}=t;return await tk({hash:function(t){let{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:function({domain:t}){return["string"==typeof t?.name&&{name:"name",type:"string"},t?.version&&{name:"version",type:"string"},"number"==typeof t?.chainId&&{name:"chainId",type:"uint256"},t?.verifyingContract&&{name:"verifyingContract",type:"address"},t?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}({domain:e}),...t.types};!function(t){let{domain:e,message:r,primaryType:n,types:i}=t,s=(t,e)=>{for(let r of t){let{name:t,type:n}=r,o=e[t],a=n.match(eg);if(a&&("number"==typeof o||"bigint"==typeof o)){let[t,e,r]=a;(0,tp.eC)(o,{signed:"int"===e,size:Number.parseInt(r)/8})}if("address"===n&&"string"==typeof o&&!(0,tm.U)(o))throw new tg.b({address:o});let u=n.match(ep);if(u){let[t,e]=u;if(e&&(0,tC.d)(o)!==Number.parseInt(e))throw new eu({expectedSize:Number.parseInt(e),givenSize:(0,tC.d)(o)})}let l=i[n];l&&s(l,o)}};i.EIP712Domain&&e&&s(i.EIP712Domain,e),"EIP712Domain"!==n&&s(i[n],r)}({domain:e,message:r,primaryType:n,types:i});let s=["0x1901"];return e&&s.push(function({domain:t,types:e}){return em({data:t,primaryType:"EIP712Domain",types:e})}({domain:e,types:i})),"EIP712Domain"!==n&&s.push(em({data:r,primaryType:n,types:i})),(0,tb.w)(tx(s))}(r),privateKey:e,to:"hex"})}function eb(t,e={}){let{nonceManager:r}=e,n=(0,tp.NC)(tf.getPublicKey(t.slice(2),!1));return{...function(t){if("string"==typeof t){if(!(0,tm.U)(t,{strict:!1}))throw new tg.b({address:t});return{address:t,type:"json-rpc"}}if(!(0,tm.U)(t.address,{strict:!1}))throw new tg.b({address:t.address});return{address:t.address,nonceManager:t.nonceManager,sign:t.sign,experimental_signAuthorization:t.experimental_signAuthorization,signMessage:t.signMessage,signTransaction:t.signTransaction,signTypedData:t.signTypedData,source:"custom",type:"local"}}({address:function(t){let e=(0,tb.w)(`0x${t.substring(4)}`).substring(26);return(0,ty.x)(`0x${e}`)}(n),nonceManager:r,sign:async({hash:e})=>tk({hash:e,privateKey:t,to:"hex"}),experimental_signAuthorization:async e=>tT({...e,privateKey:t}),signMessage:async({message:e})=>tL({message:e,privateKey:t}),signTransaction:async(e,{serializer:r}={})=>ei({privateKey:t,transaction:e,serializer:r}),signTypedData:async e=>ey({...e,privateKey:t})}),publicKey:n,source:"privateKey"}}},85219:function(t,e,r){"use strict";r.d(e,{R:function(){return n}});let n=(0,r(42033).a)({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}})},13494:function(t,e,r){"use strict";r.d(e,{F:function(){return n}});let n=(0,r(42033).a)({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol
15:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0})},42995:function(t,e,r){"use strict";r.d(e,{d:function(){return m}});var n=r(55403),i=r(45688);class s extends i.G{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}let o=new Map;var a=r(20340),u=r(75879);let l={current:0,take(){return this.current++},reset(){this.current=0}};var h=r(21352),c=r(87524),d=r(20068);let f=new(r(45122)).k(8192);var p=r(46855),g=r(38908);function m(t,e={}){let{batch:r,fetchOptions:m,key:y="http",name:b="HTTP JSON-RPC",onFetchRequest:w,onFetchResponse:v,retryDelay:k}=e;return({chain:x,retryCount:I,timeout:S})=>{let{batchSize:M=1e3,wait:E=0}="object"==typeof r?r:{},A=e.retryCount??I,B=S??e.timeout??1e4,P=t||x?.rpcUrls.default.http[0];if(!P)throw new s;let _=function(t,e={}){return{async request(r){let{body:i,onRequest:s=e.onRequest,onResponse:o=e.onResponse,timeout:h=e.timeout??1e4}=r,c={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:d,method:f,signal:p}=c;try{let e;let r=await (0,a.F)(async({signal:e})=>{let r={...c,body:Array.isArray(i)?(0,u.P)(i.map(t=>({jsonrpc:"2.0",id:t.id??l.take(),...t}))):(0,u.P)({jsonrpc:"2.0",id:i.id??l.take(),...i}),headers:{"Content-Type":"application/json",...d},method:f||"POST",signal:p||(h>0?e:null)},n=new Request(t,r);return s&&await s(n),await fetch(t,r)},{errorInstance:new n.W5({body:i,url:t}),timeout:h,signal:!0});if(o&&await o(r),r.headers.get("Content-Type")?.startsWith("application/json")?e=await r.json():(e=await r.text(),e=JSON.parse(e||"{}")),!r.ok)throw new n.Gg({body:i,details:(0,u.P)(e.error)||r.statusText,headers:r.headers,status:r.status,url:t});return e}catch(e){if(e instanceof n.Gg||e instanceof n.W5)throw e;throw new n.Gg({body:i,cause:e,url:t})}}}}(P,{fetchOptions:m,onRequest:w,onResponse:v,timeout:B});return function({key:t,name:e,request:r,retryCount:s=3,retryDelay:o=150,timeout:a,type:l},m){return{config:{key:t,name:e,request:r,retryCount:s,retryDelay:o,timeout:a,type:l},request:function(t,e={}){return async(r,s={})=>{let{dedupe:o=!1,retryDelay:a=150,retryCount:l=3,uid:g}={...e,...s},m=o?(0,d.w)((0,c.$G)(`${g}.${(0,u.P)(r)}`)):void 0;return function(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(f.get(r))return f.get(r);let n=t().finally(()=>f.delete(r));return f.set(r,n),n}(()=>(0,p.J)(async()=>{try{return await t(r)}catch(t){switch(t.code){case h.s7.code:throw new h.s7(t);case h.B.code:throw new h.B(t);case h.LX.code:throw new h.LX(t,{method:r.method});case h.nY.code:throw new h.nY(t);case h.XS.code:throw new h.XS(t);case h.yR.code:throw new h.yR(t);case h.Og.code:throw new h.Og(t);case h.pT.code:throw new h.pT(t);case h.KB.code:throw new h.KB(t);case h.gS.code:throw new h.gS(t,{method:r.method});case h.Pv.code:throw new h.Pv(t);case h.GD.code:throw new h.GD(t);case h.ab.code:throw new h.ab(t);case h.PE.code:throw new h.PE(t);case h.Ts.code:throw new h.Ts(t);case h.u5.code:throw new h.u5(t);case h.I0.code:throw new h.I0(t);case h.x3.code:throw new h.x3(t);case 5e3:throw new h.ab(t);default:if(t instanceof i.G)throw t;throw new h.ir(t)}}},{delay:({count:t,error:e})=>{if(e&&e instanceof n.Gg){let t=e?.headers?.get("Retry-After");if(t?.match(/\d/))return 1e3*Number.parseInt(t)}return~~(1<<t)*a},retryCount:l,shouldRetry:({error:t})=>"code"in t&&"number"==typeof t.code?-1===t.code||t.code===h.Pv.code||t.code===h.XS.code:!(t instanceof n.Gg)||!t.status||403===t.status||408===t.status||413===t.status||429===t.status||500===t.status||502===t.status||503===t.status||504===t.status}),{enabled:o,id:m})}}(r,{retryCount:s,retryDelay:o,uid:(0,g.h)()}),value:m}}({key:y,name:b,async request({method:t,params:e}){let i={method:t,params:e},{schedule:s}=function({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){let s=async()=>{let e=l();a();let r=e.map(({args:t})=>t);0!==r.length&&t(r).then(t=>{i&&Array.isArray(t)&&t.sort(i);for(let r=0;r<e.length;r++){let{pendingPromise:n}=e[r];n.resolve?.([t[r],t])}}).catch(t=>{for(let r=0;r<e.length;r++){let{pendingPromise:n}=e[r];n.reject?.(t)}})},a=()=>o.delete(e),u=()=>l().map(({args:t})=>t),l=()=>
15o.get(e)||[],h=t=>o.set(e,[...l(),t]);return{flush:a,async schedule(t){let e={},i=new Promise((t,r)=>{e.resolve=t,e.reject=r});return(r?.([...u(),t])&&s(),l().length>0)?h({args:t,pendingPromise:e}):(h({args:t,pendingPromise:e}),setTimeout(s,n)),i}}}({id:P,wait:E,shouldSplitBatch:t=>t.length>M,fn:t=>_.request({body:t}),sort:(t,e)=>t.id-e.id}),a=async t=>r?s(t):[await _.request({body:t})],[{error:u,result:l}]=await a(i);if(u)throw new n.bs({body:i,error:u,url:P});return l},retryCount:A,retryDelay:k,timeout:B,type:"http"},{fetchOptions:m,url:P})}}},27373:function(t,e,r){"use strict";r.d(e,{b:function(){return i}});var n=r(45688);class i extends n.G{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}},45688:function(t,e,r){"use strict";r.d(e,{G:function(){return s}});let n="2.20.1",i={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:n};class s extends Error{constructor(t,e={}){let r=e.cause instanceof s?e.cause.details:e.cause?.message?e.cause.message:e.details,o=e.cause instanceof s&&e.cause.docsPath||e.docsPath,a=i.getDocsUrl?.({...e,docsPath:o});super([t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join("\n"),e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=e.metaMessages,this.name=e.name??this.name,this.shortMessage=t,this.version=n}walk(t){return function t(e,r){return r?.(e)?e:e&&"object"==typeof e&&"cause"in e?t(e.cause,r):r?null:e}(this,t)}}},86359:function(t,e,r){"use strict";r.d(e,{$s:function(){return s},mV:function(){return i}});var n=r(45688);class i extends n.G{constructor({offset:t,position:e,size:r}){super(`Slice ${"start"===e?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class s extends n.G{constructor({size:t,targetSize:e,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${e}).`,{name:"SizeExceedsPaddingSizeError"})}}},76595:function(t,e,r){"use strict";r.d(e,{J5:function(){return i},M6:function(){return s}});var n=r(45688);class i extends n.G{constructor({max:t,min:e,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${e} to ${t})`:`(above ${e})`}`,{name:"IntegerOutOfRangeError"})}}class s extends n.G{constructor({givenSize:t,maxSize:e}){super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}},55403:function(t,e,r){"use strict";r.d(e,{Gg:function(){return o},bs:function(){return a},W5:function(){return u}});var n=r(75879),i=r(45688);let s=t=>t;class o extends i.G{constructor({body:t,cause:e,details:r,headers:i,status:o,url:a}){super("HTTP request failed.",{cause:e,details:r,metaMessages:[o&&`Status: ${o}`,`URL: ${s(a)}`,t&&`Request body: ${(0,n.P)(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=i,this.status=o,this.url=a}}class a extends i.G{constructor({body:t,error:e,url:r}){super("RPC Request failed.",{cause:e,details:e.message,metaMessages:[`URL: ${s(r)}`,`Request body: ${(0,n.P)(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e.code}}class u extends i.G{constructor({body:t,url:e}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${s(e)}`,`Request body: ${(0,n.P)(t)}`],name:"TimeoutError"})}}},21352:function(t,e,r){"use strict";r.d(e,{B:function(){return u},GD:function(){return b},I0:function(){return I},KB:function(){return g},LX:function(){return l},Og:function(){return f},PE:function(){return v},Pv:function(){return y},Ts:function(){return k},XS:function(){return c},ab:function(){return w},gS:function(){return m},ir:function(){return M},nY:function(){return h},pT:function(){return p},s7:function(){return a},u5:function(){return x},x3:function(){return S},yR:function(){return d}});var n=r(45688),i=r(55403);class s extends n.G{constructor(t,{code:e,docsPath:r,metaMessages:n,name:s,shortMessage:o}
vendor: 18,093 bytes, line 15
15){super(o,{cause:t,docsPath:r,metaMessages:n||t?.metaMessages,name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||t.name,this.code=t instanceof i.bs?t.code:e??-1}}class o extends s{constructor(t,e){super(t,e),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e.data}}class a extends s{constructor(t){super(t,{code:a.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class u extends s{constructor(t){super(t,{code:u.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class l extends s{constructor(t,{method:e}={}){super(t,{code:l.code,name:"MethodNotFoundRpcError",shortMessage:`The method${e?` "${e}"`:""} does not exist / is not available.`})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class h extends s{constructor(t){super(t,{code:h.code,name:"InvalidParamsRpcError",shortMessage:"Invalid parameters were provided to the RPC method.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class c extends s{constructor(t){super(t,{code:c.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class d extends s{constructor(t){super(t,{code:d.code,name:"InvalidInputRpcError",shortMessage:"Missing or invalid parameters.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class f extends s{constructor(t){super(t,{code:f.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class p extends s{constructor(t){super(t,{code:p.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class g extends s{constructor(t){super(t,{code:g.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class m extends s{constructor(t,{method:e}={}){super(t,{code:m.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${e?` "${e}"`:""} is not implemented.`})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class y extends s{constructor(t){super(t,{code:y.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class b extends s{constructor(t){super(t,{code:b.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class w extends o{constructor(t){super(t,{code:w.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class v extends o{constructor(t){super(t,{code:v.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class k extends o{constructor(t,{method:e}={}){super(t,{code:k.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${e?` " ${e}"`:""}.`})}}Object.defineProperty(k,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class x extends o{constructor(t){super(t,{code:x.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class I extends o{constructor(t){super(t,{code:I.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(I,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class S extends o{constructor(t){super(t,{code:S.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(S,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class M extends s{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}},29583:function(t,e,r){"use strict";r.d(e,{K:function(){return h},x:function(){return l}});var n=r(27373),i=r(9365),s=r(20068),o=r(45122),a=r(77272);let u=new o.k(8192);function l(t,e){if(u.has(`${t}.${e}`))return u.get(`${t}.${e}`);let r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=(0,s.w)((0,i.qX)(r),"bytes"),o=(e?r.substring(`${e}0x`.length):r).split("");for(let t=0;t<40;t+=2)n[t>>1]>>4>=8&&o[t]&&(o[t]=o[t].toUpperCase()),(15&n[t>>1])>=8&&o[t+1]&&(o[t+1]=o[t+1].toUpperCase());let a=`0x${o.join("")}`;return u.set(`${t}.${e}`,a),a}function h(t,e){if(!(0,a.U)(t,{strict:!1}))throw new n.b({address:t});return l(t,e)}},77272:function(t,e,r){"use strict";r.d(e,{U:function(){return a}});var n=r(45122),i=r(29583);let s=/^0x[a-fA-F0-9]{40}$/,o=new n.k(8192);function a(t,e){let{strict:r=!0}=e??{},n=`${t}.${r}`;if(o.has(n))return o.get(n);let a=!!s.test(t)&&(t.toLowerCase()===t||!r||(0,i.x)(t)===t);return o.set(n,a),a}},42033:function(t,e,r){"use strict";function n(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}r.d(e,{a:function(){return n}})},54959:function(t,e,r){"use strict";function n(t,{strict:e=!0}={}){return!!t&&"string"==typeof t&&(e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x"))}r.d(e,{v:function(){return n}})},68500:function(t,e,r){"use strict";r.d(e,{gc:function(){return s},vk:function(){return i}});var n=r(86359);function i(t,{dir:e,size:r=32}={}){return"string"==typeof t?s(t,{dir:e,size:r}):function(t,{dir:e,size:r=32}={}){if(null===r)return t;if(t.length>r)throw new n.$s({size:t.length,targetSize:r,type:"bytes"});let i=new Uint8Array(r);for(let n=0;n<r;n++){let s="right"===e;i[s?n:r-n-1]=t[s?n:t.length-n-1]}return i}(t,{dir:e,size:r})}function s(t,{dir:e,size:r=32}={}){if(null===r)return t;let i=t.replace("0x","");if(i.length>2*r)throw new n.$s({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i["right"===e?"padEnd":"padStart"](2*r,"0")}`}},86340:function(t,e,r){"use strict";r.d(e,{d:function(){return i}});var n=r(54959);function i(t){return(0,n.v)(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}},95455:function(t,e,r){"use strict";r.d(e,{Yf:function(){return s},ly:function(){return a},y_:function(){return o}});var n=r(76595),i=r(86340);function s(t,{size:e}){if((0,i.d)(t)>e)throw new n.M6({givenSize:(0,i.d)(t),maxSize:e})}function o(t,e={}){let{signed:r}=e;e.size&&s(t,{size:e.size});let n=BigInt(t);if(!r)return n;let i=(t.length-2)/2;return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function a(t,e={}){return Number(o(t,e))}},9365:function(t,e,r){"use strict";r.d(e,{O0:function(){return l},nr:function(){return d},qX:function(){return f}});var n=r(45688),i=r(54959),s=r(68500),o=r(95455),a=r(87524);let u=new TextEncoder;function l(t,e={}){return"number"==typeof t||"bigint"==typeof t?d((0,a.eC)(t,e)):"boolean"==typeof t?function(t,e={}){let r=new Uint8Array(1);return(r[0]=Number(t),"number"==typeof e.size)?((0,o.Yf)(r,{size:e.size}),(0,s.vk)(r,{size:e.size})):r}(t,e):(0,i.v)(t)?d(t,e):f(t,e)}let h={zero:48,nine:57,A:65,F:70,a:97,f:102};function c(t){return t>=h.zero&&t<=h.nine?t-h.zero:t>=h.A&&t<=h.F?t-(h.A-10):t>=h.a&&t<=h.f?t-(h.a-10):void 0}function d(t,e={}){let r=t;e.size&&((0,o.Yf)(r,{size:e.size}),r=(0,s.vk)(r,{dir:"right",size:e.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);let a=i.length/2,u=new Uint8Array(a);for(let t=0,e=0;t<a;t++){let r=c(i.charCodeAt(e++)),s=c(i.charCodeAt(e++));if(void 0===r||void 0===s)throw new n.G(`Invalid byte sequence ("${i[e-2]}${i[e-1]}" in "${i}").`);u[t]=16*r+s}return u}function f(t,e={}){let r=u.encode(t);return"number"==typeof e.size?((0,o.Yf)(r,{size:e.size}),(0,s.vk)(r,{dir:"right",size:e.size})):r}},87524:function(t,e,r){"use strict";r.d(e,{$G:function(){return d},C4:function(){return u},NC:function(){return a},ci:function(){return l},eC:function(){return h}});var n=r(76595),i=r(68500),s=r(95455);let o=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function a(t,e={}){return"number"==typeof t||"bigint"==typeof t?h(t,e):"string"==typeof t?d(t,e):"boolean"==typeof t?u(t,e):l(t,e)}function u(t,e={}){let r=`0x${Number(t)}`;return"number"==typeof e.size?((0,s.Yf)(r,{size:e.size}),(0,i.vk)(r,{size:e.size})):r}function l(t,e={}){let r="";for(let e=0;e<t.length;e++)r+=o[t[e]];let n=`0x${r}`;return"number"==typeof e.size?((0,s.Yf)(n,{size:e.size}),(0,i.vk)(n,{dir:"right",size:e.size})):n}function h(t,e={}){let r;let{signed:s,size:o}=e,a=BigInt(t);o?r=s?(1n<<8n*BigInt(o)-1n)-1n:2n**(8n*BigInt(o))-1n:"number"==typeof t&&(r=BigInt(Number.MAX_SAFE_INTEGER));let u="bigint"==typeof r&&s?-r-1n:0;if(r&&a>r||a<u){let e="bigint"==typeof t?"n":"";throw new n.J5({max:r?`${r}${e}`:void 0,min:`${u}${e}`,signed:s,size:o,value:`${t}${e}`})}let l=`0x${(s&&a<0?(1n<<BigInt(8*o))+BigInt(a):a).toString(16)}`;return o?(0,i.vk)(l,{size:o}):l}let c=new TextEncoder;function d(t,e={}){return l(c.encode(t),e)}},20068:function(t,e,r){"use strict";r.d(e,{w:function(){return P}});var n=r(55805);let i=BigInt(4294967296-1),s=BigInt(32),o=(t,e,r)=>t<<r|e>>>32-r,a=(t,e,r)=>e<<r|t>>>32-r,u=(t,e,r)=>e<<r-32|t>>>64-r,l=(t,e,r)=>t<<r-32|e>>>64-r;var h=r(83326);let c=[],d=[],f=[],p=BigInt(0),g=BigInt(1),m=BigInt(2),y=BigInt(7),b=BigInt(256),w=BigInt(113);for(let t=0,e=g,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],c.push(2*(5*n+r)),d.push((t+1)*(t+2)/2%64);let i=p;for(let t=0;t<7;t++)(e=(e<<g^(e>>y)*w)%b)&m&&(i^=g<<(g<<BigInt(t))-g);f.push(i)}let[v,k]=function(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let o=0;o<t.length;o++){let{h:a,l:u}=function(t,e=!1){return e?{h:Number(t&i),l:Number(t>>s&i)}:{h:0|Number(t>>s&i),l:0|Number(t&i)}}(t[o],e);[r[o],n[o]]=[a,u]}return[r,n]}(f,!0),x=(t,e,r)=>r>32?u(t,e,r):o(t,e,r),I=(t,e,r)=>r>32?l(t,e,r):a(t,e,r);class S extends h.kb{constructor(t,e,r,i=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.Rx)(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,h.Jq)(this.state)}keccak(){h.iA||(0,h.l1)(this.state32),function(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){let n=(e+8)%10,i=(e+2)%10,s=r[i],o=r[i+1],a=x(s,o,1)^r[n],u=I(s,o,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=u}let e=t[2],i=t[3];for(let r=0;r<24;r++){let n=d[r],s=x(e,i,n),o=I(e,i,n),a=c[r];e=t[a],i=t[a+1],t[a]=s,t[a+1]=o}for(let e=0;e<50;e+=10){for(let n=0;n<10;n++)r[n]=t[e+n];for(let n=0;n<10;n++)t[e+n]^=~r[(n+2)%10]&r[(n+4)%10]}t[0]^=v[n],t[1]^=k[n]}r.fill(0)}(this.state32,this.rounds),h.iA||(0,h.l1)(this.state32),this.posOut=0,this.pos=0}update(t){(0,n.Gg)(this);let{blockLen:e,state:r}=this,i=(t=(0,h.O0)(t)).length;for(let n=0;n<i;){let s=Math.min(e-this.pos,i-n);for(let e=0;e<s;e++)r[this.pos++]^=t[n++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:r,blockLen:n}=this;t[r]^=e,(128&e)!=0&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){(0,n.Gg)(this,!1),(0,n.aI)(t),this.finish();let e=this.state,{blockLen:r}=this;for(let n=0,i=t.length;n<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-n);t.set(e.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return t}xofInto(t){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,n.Rx)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,n.J8)(t,this),this.finished)throw Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return t||(t=new S(e,r,n,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=s,t.destroyed=this.destroyed,t}}let M=(0,h.hE)(()=>new S(136,1,32));var E=r(54959),A=r(9365),B=r(87524);function P(t,e){let r=M((0,E.v)(t,{strict:!1})?(0,A.O0)(t):t);return"bytes"===(e||"hex")?r:(0,B.NC)(r)}},45122:function(t,e,r){"use strict";r.d(e,{k:function(){return n}});class n extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}set(t,e){return super.set(t,e),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}},46855:function(t,e,r){"use strict";async function n(t){return new Promise(e=>setTimeout(e,t))}function i(t,{delay:e=100,retryCount:r=2,shouldRetry:i=()=>!0}={}){return new Promise((s,o)=>{let a=async({count:u=0}={})=>{let l=async({error:t})=>{let r="function"==typeof e?e({count:u,error:t}):e;r&&await n(r),a({count:u+1})};try{let e=await t();s(e)}catch(t){if(u<r&&await i({count:u,error:t}))return l({error:t});o(t)}};a()})}r.d(e,{J:function(){return i}})},20340:function(t,e,r){"use strict";function n(t,{errorInstance:e=Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{let a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:a?.signal||null}))}catch(t){t?.name==="AbortError"&&s(e),s(t)}finally{clearTimeout(o)}})()})}r.d(e,{F:function(){return n}})},75879:function(t,e,r){"use strict";r.d(e,{P:function(){return n}});let n=(t,e,r)=>JSON.stringify(t,(t,r)=>{let n="bigint"==typeof r?r.toString():r;return"function"==typeof e?e(t,n):n},r)},38908:function(t,e,r){"use strict";let n;r.d(e,{h:function(){return s}});let i=256;function s(t=11){if(!n||i+t>512){n="",i=0;for(let t=0;t<256;t++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(i,i+++t)}},55805:function(t,e,r){"use strict";function n(t){if(!Number.isSafeInteger(t)||t<0)throw Error(`positive integer expected, not ${t}`)}function i(t,...e){if(!(t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name))throw Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function s(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.wrapConstructor");n(t.outputLen),n(t.blockLen)}function o(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function a(t,e){i(t);let r=e.outputLen;if(t.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}r.d(e,{Gg:function(){return o},J8:function(){return a},Rx:function(){return n},aI:function(){return i},vp:function(){return s}})},83326:function(t,e,r){"use strict";r.d(e,{kb:function(){return f},l1:function(){return h},eV:function(){return d},GL:function(){return o},iA:function(){return u},O6:function(){return g},np:function(){return a},O0:function(){return c},Jq:function(){return s},hE:function(){return p}});let n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;var i=r(55805);let s=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),o=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),a=(t,e)=>t<<32-e|t>>>e,u=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],l=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function h(t){for(let e=0;e<t.length;e++)t[e]=l(t[e])}function c(t){return"string"==typeof t&&(t=function(t){if("string"!=typeof t)throw Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}(t)),(0,i.aI)(t),t}function d(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];(0,i.aI)(n),e+=n.length}let r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){let i=t[e];r.set(i,n),n+=i.length}return r}class f{clone(){return this._cloneInto()}}function p(t){let e=e=>t().update(c(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function g(t=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(t));throw Error("crypto.getRandomValues must be defined")}},63857:function(t,e,r){"use strict";r.d(e,{$GI:function(){return i.$GI},DDg:function(){return i.DDg},Dg1:function(){return i.Dg1},DvG:function(){return u.Dv},RUf:function(){return i.RUf},SGi:function(){return i.SGi},Y0F:function(){return u.Y0},Zv5:function(){return i.Zv5},bn:function(){return a.bn},e5z:function(){return i.e5z},fnN:function(){return i.fnN},gS:function(){return o.g},hQe:function(){return i.hQe},kLt:function(){return s.kL},mMY:function(){return i.mMY},mRj:function(){return i.mRj},ngp:function(){return i.ngp},vos:function(){return i.vos},w0$:function(){return s.w0},w5x:function(){return i.w5x},z$m:function(){return i.z$m},zoF:function(){return u.zo},zt6:function(){return i.zt6}}),r(21662),r(82824),r(75522);var n,i=r(54051),s=r(76506),o=r(44843);
15r(83116),r(6239),r(52231),r(96522);var a=r(18172);r(3306),r(13734),r(37843),r(23946);var u=r(77198);(0,Object.defineProperty)(function(t){return t},"name",{value:"createConfig",configurable:!0});var l=((n=l||{}).build="build",n.deploy="deploy",n.dev="dev",n.init="init",n.versions="versions",n.node="node",n)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.