@dcl/shop 0.1.0-29111888971.commit-e1b927a → 0.1.0-29111917255.commit-e6715c3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{AnimatedBackground-XZF9g9Bk.js → AnimatedBackground-BYKnsBtz.js} +3 -3
- package/assets/{Assets-CZPTo1jO.js → Assets-ClVmauZ2.js} +1 -1
- package/assets/{Button-B2TDtyup.js → Button-CgZSqnGW.js} +1 -1
- package/assets/{Cart-DhU4_S6H.js → Cart-Up06p7ew.js} +1 -1
- package/assets/{CircularProgress-Cf__730y.js → CircularProgress-BbGH0RSH.js} +1 -1
- package/assets/{Collection-CRBxkkqX.js → Collection-DvK8DQsK.js} +1 -1
- package/assets/{ConstantsUtil-DrWe0yob.js → ConstantsUtil-CiDezLbv.js} +1 -1
- package/assets/{Creator-DO__19RD.js → Creator-ClUMhdS6.js} +1 -1
- package/assets/{ExchangeController-txwSQL2Z.js → ExchangeController-DdSsjFTm.js} +1 -1
- package/assets/{GetCredits-DS1z5pyp.js → GetCredits-7W0xZLwI.js} +2 -2
- package/assets/{HelpersUtil-CMysbO5y.js → HelpersUtil-CbFvbY-T.js} +1 -1
- package/assets/{ImportListings-ChNZ2UwM.js → ImportListings-tpyUcfqZ.js} +1 -1
- package/assets/ItemDetail-CZQ3QPE1.js +2 -0
- package/assets/{Market-Z4jp-uLb.js → Market-CRtp3AGM.js} +1 -1
- package/assets/{MenuItem-B4U0TYKf.js → MenuItem-BLQsL8Vh.js} +1 -1
- package/assets/{MyAssets-C7QdtDYF.js → MyAssets-Cp2z98Lz.js} +1 -1
- package/assets/{MyFavorites-Bu2IDcdJ.js → MyFavorites-_R79W8pO.js} +1 -1
- package/assets/{MyPurchases-CDUC3XzQ.js → MyPurchases-DJYHRbWz.js} +1 -1
- package/assets/{NetworkUtil-Ddexw9-U.js → NetworkUtil-DDES604E.js} +1 -1
- package/assets/{NotFound-D5sXjRPf.js → NotFound-6FTGg4R1.js} +1 -1
- package/assets/{RealCheckout-DBL3uxEj.js → RealCheckout-BemiXyZF.js} +1 -1
- package/assets/{ShopFooterInner-BHh4OUAv.js → ShopFooterInner-KJ2oezRg.js} +2 -2
- package/assets/{Success-BrvAPmP4.js → Success-CXjLiyYm.js} +1 -1
- package/assets/{SvgIcon-Cg5l4LDh.js → SvgIcon-DtxoFXOd.js} +1 -1
- package/assets/{SwapController-BDZMxnNb.js → SwapController-C07T-0ls.js} +1 -1
- package/assets/{TradeService-CkLYTYcJ.js → TradeService-D4PrM9vt.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-D4DCXtQm.js → W3MFrameProviderSingleton-DXEpVsCm.js} +3 -3
- package/assets/{WebCryptoP256-OE37a6hF.js → WebCryptoP256-B1xyhPdr.js} +1 -1
- package/assets/{basic-SUHSB6nZ.js → basic-Dq4Wpic2.js} +1 -1
- package/assets/{biconomy-C6flCXA4.js → biconomy-BQtB5Ab0.js} +1 -1
- package/assets/{buy-YkuLG1h7.js → buy-6ORWjZW_.js} +1 -1
- package/assets/{buy-gasless-gRmZHjsE.js → buy-gasless-DL6o_Lwi.js} +1 -1
- package/assets/{ccip-7fqLW_t2.js → ccip-DgHj7djR.js} +1 -1
- package/assets/{ccip-ByQiZ_aq.js → ccip-Zo_y8Ko9.js} +1 -1
- package/assets/{chains-CMJ6lVMG.js → chains-Bk629xE3.js} +1 -1
- package/assets/{collection-2CKCNH2O.js → collection-B8w_ujSk.js} +1 -1
- package/assets/{common-GsSQn_vD.js → common-CEkVtB9E.js} +1 -1
- package/assets/{controller-BO0zre2A.js → controller-CNZZBumM.js} +2 -2
- package/assets/{core-D-mQUZ3X.js → core-C_RCjMc6.js} +4 -4
- package/assets/{custom-C6VO1Je_.js → custom-BM-_NC1p.js} +1 -1
- package/assets/{data-capture-DdxbO7dd.js → data-capture-Clu_u_4e.js} +1 -1
- package/assets/decimals-C7k-JLnD.js +1 -0
- package/assets/{decimals-Di7mGY-D.js → decimals-DYUDFeSV.js} +1 -1
- package/assets/{detectExtension-DsE82Ej6.js → detectExtension-b3FK4NnW.js} +1 -1
- package/assets/{email-BTEyDEk6.js → email-C0z3A7sK.js} +1 -1
- package/assets/{embedded-wallet-QGoIGdCB.js → embedded-wallet-COvvX2Qp.js} +1 -1
- package/assets/{engine-Bjifrd8K.js → engine-Cs_nlYqC.js} +1 -1
- package/assets/{estimate-l1-fee-Bqou6JLl.js → estimate-l1-fee-oTYMvZsv.js} +1 -1
- package/assets/eth_estimateGas-D2h2NKDU.js +1 -0
- package/assets/{eth_getStorageAt-B-cqm2CG.js → eth_getStorageAt-nxicedso.js} +1 -1
- package/assets/eth_getTransactionCount-CYYgSGiU.js +1 -0
- package/assets/{ethereum-CjiWK1L5.js → ethereum-CdeRZR9J.js} +1 -1
- package/assets/{ethers-DHDSyreX.js → ethers-JeCAM1sd.js} +1 -1
- package/assets/{extractIPFS-C5EI4cZz.js → extractIPFS-DzIizex4.js} +1 -1
- package/assets/{features-U-ULFF0v.js → features-Ck7HAsYI.js} +1 -1
- package/assets/{fetchTokenMetadata-DHc2WWGs.js → fetchTokenMetadata-CvdEl9__.js} +2 -2
- package/assets/{generateUtilityClasses-BAjjhm6X.js → generateUtilityClasses-C3jgMIyn.js} +1 -1
- package/assets/get-ecosystem-wallet-info-B4ca6uUn.js +1 -0
- package/assets/{getBalance-C8i1-K0c.js → getBalance-BS9M_tBF.js} +2 -2
- package/assets/{getInstalledModules-BXhbS0To.js → getInstalledModules-TJvbccgJ.js} +1 -1
- package/assets/{getNFT-CzHwZ4FU.js → getNFT-BlQFGY94.js} +2 -2
- package/assets/{getNFT-D3XSi6wm.js → getNFT-Xlc7XB2G.js} +1 -1
- package/assets/{hashTypedData-DX5YrpbP.js → hashTypedData-B7sBgfoL.js} +1 -1
- package/assets/{hashTypedData-BOc0w62Q.js → hashTypedData-CEYoWftx.js} +1 -1
- package/assets/{import-BulayqYM.js → import-J8FWHnju.js} +1 -1
- package/assets/{in-app-wallet-calls-BI0pU06-.js → in-app-wallet-calls-GDlqBGpw.js} +1 -1
- package/assets/{index-GAmNssSM.js → index-2dkhZZEZ.js} +1 -1
- package/assets/{index-BZ5hUBd_.js → index-6YdbHDXd.js} +1 -1
- package/assets/{index-CzfG6alx.js → index-B0PvzweT.js} +1 -1
- package/assets/{index-DQx-sY_c.js → index-B11b--Yh.js} +1 -1
- package/assets/{index-BKSTjS_b.js → index-B5Oqojt4.js} +1 -1
- package/assets/{index-D4VlTBkw.js → index-B5nwKjyJ.js} +1 -1
- package/assets/{index-n-cFV5ht.js → index-B6-wCRdo.js} +1 -1
- package/assets/{index-DIMSfymy.js → index-BA1ToKo5.js} +3 -3
- package/assets/{index-D3hzhbb8.js → index-BBTg_Taa.js} +1 -1
- package/assets/{index-CkHNiFzW.js → index-BLF3lLRE.js} +1 -1
- package/assets/{index--_rHc9Od.js → index-BNjQhTuO.js} +1 -1
- package/assets/{index-Qzch3HJ1.js → index-BNsmSCur.js} +1 -1
- package/assets/{index-BOQwd6ZB.js → index-BRAKTMPG.js} +1 -1
- package/assets/{index-BOwZsNrV.js → index-B_xrDWUL.js} +1 -1
- package/assets/{index-DhBdPYnK.js → index-BcvgfIV4.js} +1 -1
- package/assets/{index-CdfeQ7YK.js → index-BcyJUD4U.js} +1 -1
- package/assets/{index-ULMMROQ0.js → index-BeymNI6W.js} +1 -1
- package/assets/{index-DjPU0-Js.js → index-BgtBi25O.js} +1 -1
- package/assets/{index-CIPKmOlZ.js → index-Bj-x5N2U.js} +1 -1
- package/assets/{index-Pp2oEhTr.js → index-Blc7OGRU.js} +1 -1
- package/assets/{index-LSZxonl2.js → index-BnrCQ-kr.js} +1 -1
- package/assets/{index-jYazATJj.js → index-Bu2DcNS5.js} +1 -1
- package/assets/{index-C6FQ8I_Q.js → index-C9P6N44e.js} +2 -2
- package/assets/{index-C7-iTfFV.js → index-CI_HQD35.js} +25 -25
- package/assets/{index-C2U9pe20.js → index-CMib98th.js} +1 -1
- package/assets/{index-DacKA042.js → index-CPc95Sx-.js} +1 -1
- package/assets/{index-DShBCYos.js → index-CS7PjWbj.js} +3 -3
- package/assets/{index-BuKyqX4w.js → index-CSh-BHOv.js} +1 -1
- package/assets/{index-DV4p99KA.js → index-CZ8lEqAg.js} +2 -2
- package/assets/{index-CxyR8sie.js → index-ChHYiWiR.js} +1 -1
- package/assets/{index-CDMAFM2h.js → index-CkCZBr-g.js} +1 -1
- package/assets/{index-CMavzzI_.js → index-Cl4u62mB.js} +1 -1
- package/assets/{index-CbJmVQBN.js → index-CoACJ04N.js} +1 -1
- package/assets/{index-C2OMQVG4.js → index-CptRe6qL.js} +2 -2
- package/assets/{index-YfJF6hV4.js → index-CxQiq4b6.js} +1 -1
- package/assets/{index-CcQfGUgB.js → index-Cye62OPB.js} +1 -1
- package/assets/{index-BLQJ40Mi.js → index-D-lax9BR.js} +1 -1
- package/assets/{index-BlEd83Li.js → index-DA60UT_n.js} +1 -1
- package/assets/{index-CzFnbzvY.js → index-DFJdN6PH.js} +1 -1
- package/assets/{index-D5qOQwpy.js → index-DGSeBOvG.js} +1 -1
- package/assets/{index-DtrBN21c.js → index-DSUWwVug.js} +1 -1
- package/assets/{index-Eb-Zd0F2.js → index-DUnXGO0a.js} +1 -1
- package/assets/{index-CiIXwK1P.js → index-DWEAO5Zp.js} +1 -1
- package/assets/{index-BF6unOoT.js → index-DWk4e-hQ.js} +1 -1
- package/assets/{index-DJyoXp5I.js → index-DZ8SABwK.js} +1 -1
- package/assets/{index-2NUAW7ds.js → index-D_vsPbWD.js} +1 -1
- package/assets/{index-DlllSUoB.js → index-DjbM69kL.js} +1 -1
- package/assets/{index-CkVoCPEe.js → index-DnPCa8RK.js} +1 -1
- package/assets/{index-BNH6Xzon.js → index-DoS7CfZ4.js} +2 -2
- package/assets/{index-DOTYPGXa.js → index-Dv6YT5k2.js} +1 -1
- package/assets/{index-DIw62AgP.js → index-S-U9uSud.js} +1 -1
- package/assets/{index-IfYZnKCO.js → index-_AHcKVpB.js} +1 -1
- package/assets/{index-Bo6hVxzu.js → index-dE2OwwEn.js} +1 -1
- package/assets/{index-BaSqmd6J.js → index-pJLySSiV.js} +1 -1
- package/assets/{index-CENZ1Xjd.js → index-t3MAsdpb.js} +1 -1
- package/assets/{index-kxu93Of2.js → index-ulcskxUh.js} +1 -1
- package/assets/{index-DS8DYtub.js → index-yq7Vx7EH.js} +1 -1
- package/assets/{index.es-DnMpNe4m.js → index.es-BQrA1NgE.js} +4 -4
- package/assets/{index.es-IGCEipYb.js → index.es-CbOKB2xh.js} +1 -1
- package/assets/{index.es-Dk6KC5kj.js → index.es-Cz73nZm3.js} +1 -1
- package/assets/{localBatchGatewayRequest-BLJAP4fw.js → localBatchGatewayRequest-DVz1EzYT.js} +1 -1
- package/assets/{mana-rate-DkxpKYLQ.js → mana-rate-PT3JDtK4.js} +1 -1
- package/assets/{native-7uSYstXA.js → native-C_y7cRlS.js} +1 -1
- package/assets/network-Bdkbzo_l.js +1 -0
- package/assets/{networks-Bc_Uf_7y.js → networks-DVx7-Y5v.js} +1 -1
- package/assets/{onramp-DnhEoZl6.js → onramp-DWqw8mwD.js} +1 -1
- package/assets/{openzeppelin-DwFpqgXP.js → openzeppelin-B2NGugOR.js} +1 -1
- package/assets/{ownerOf-Qq7Or7yc.js → ownerOf-BoMFaGBI.js} +1 -1
- package/assets/{parseNft-B-POJxiL.js → parseNft-DdgcBV60.js} +2 -2
- package/assets/{parseSignature-ClLI6O4f.js → parseSignature-BMBhmj1o.js} +3 -3
- package/assets/{parseSignature-kOoafZEo.js → parseSignature-Cu4M83H5.js} +1 -1
- package/assets/{pay-with-exchange-BZR4RMBZ.js → pay-with-exchange-B3xXFySH.js} +1 -1
- package/assets/{qr-overlay-9WMDd_PO.js → qr-overlay-DXC6ldlf.js} +1 -1
- package/assets/{receive-CtJWuhGM.js → receive-C-M9SmxL.js} +1 -1
- package/assets/{resolveImplementation-BJatMhHh.js → resolveImplementation-D1Bqtnhr.js} +1 -1
- package/assets/{rpc-BA0W82l4.js → rpc-DE1f6rs1.js} +1 -1
- package/assets/{secp256k1-B82Rx-TY.js → secp256k1-B39Q-Q6x.js} +1 -1
- package/assets/{secp256k1-DFslM7tB.js → secp256k1-CrKymG_Q.js} +1 -1
- package/assets/{secp256k1-DHqlJ8nk.js → secp256k1-D1Tuv2c6.js} +1 -1
- package/assets/{send-DXVwWcB5.js → send-C1EU45CZ.js} +1 -1
- package/assets/{send-batch-transaction-D1j9aZww.js → send-batch-transaction-BTFORkZH.js} +1 -1
- package/assets/{send-eip712-transaction-CrryJAyV.js → send-eip712-transaction-CJ_pjExq.js} +2 -2
- package/assets/{send-gasless-transaction-B7YcLCGg.js → send-gasless-transaction-CHYN-ATV.js} +2 -2
- package/assets/{sendRawTransaction-DT-ObNx8.js → sendRawTransaction-YUhe5FDd.js} +3 -3
- package/assets/{serializeTransaction-DawhfTu0.js → serializeTransaction-xu35AVgP.js} +1 -1
- package/assets/{session-proposal-lgMupzDT.js → session-proposal-BZLBnV_x.js} +1 -1
- package/assets/{session-request-DacijEHD.js → session-request-mA9oQfs4.js} +2 -2
- package/assets/{sha256-BxR-wXll.js → sha256-De0VIEFf.js} +1 -1
- package/assets/{signing-CoPa7cSW.js → signing-DqVkCMNZ.js} +5 -5
- package/assets/{socials-CMh8u0Ej.js → socials-BImUXGbF.js} +1 -1
- package/assets/{swaps-B0Q00kKq.js → swaps-B8Tuo6Pt.js} +1 -1
- package/assets/{thirdweb-9c12J_EF.js → thirdweb-BPuxSwTj.js} +3 -3
- package/assets/{totalSupply-BCZn9Djj.js → totalSupply-Bbiy7170.js} +1 -1
- package/assets/{transactionReceipt-C2iQ3ozz.js → transactionReceipt-BcAWHNof.js} +1 -1
- package/assets/{transactions-Dqx74UWQ.js → transactions-N8K1pD5P.js} +1 -1
- package/assets/{useInfiniteGrid-DgSsqvQS.js → useInfiniteGrid-CVs5pP6I.js} +1 -1
- package/assets/{utils-nbkSUjEy.js → utils-BmX8TqzP.js} +1 -1
- package/assets/{verifyHash-BVbpPoSf.js → verifyHash-CnnSGyZz.js} +1 -1
- package/assets/{w3m-modal-DvCL5Oh_.js → w3m-modal-DJII43ig.js} +1 -1
- package/assets/{w3m-modal-CGHylzdj.js → w3m-modal-DWJdJGvu.js} +1 -1
- package/assets/{wait-for-tx-receipt-Dm2aAIs1.js → wait-for-tx-receipt-D0UsY_wi.js} +1 -1
- package/assets/{wallet-kind-vciDs8sO.js → wallet-kind-C-lIAMBM.js} +1 -1
- package/assets/{wallets-D8labJv_.js → wallets-KGduOTOw.js} +6 -6
- package/assets/{web-connector-C9MeCxtf.js → web-connector-Ca9PblTL.js} +3 -3
- package/assets/{writeContract-C3IzBPhR.js → writeContract-dj4TlIky.js} +1 -1
- package/assets/{zora-sepolia-BQEmh41Y.js → zora-sepolia-kNKNf7Kl.js} +1 -1
- package/assets/{zoraTestnet-CduWQC79.js → zoraTestnet-BhynxBH0.js} +1 -1
- package/index.html +8 -8
- package/package.json +2 -2
- package/assets/ItemDetail-Do5cjFW8.js +0 -2
- package/assets/decimals-ByIlBo-2.js +0 -1
- package/assets/eth_estimateGas-CarYiSgL.js +0 -1
- package/assets/eth_getTransactionCount-Dfx3JW2Q.js +0 -1
- package/assets/get-ecosystem-wallet-info-CWcGnKL4.js +0 -1
- package/assets/network-DsCGVBhE.js +0 -1
|
@@ -6,4 +6,4 @@ import{g as sn,c as Aa}from"./react-Vu6nbGi5.js";const Bo=globalThis||void 0||se
|
|
|
6
6
|
*/(function(D){const U=t,q=S,z=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;D.Buffer=P,D.SlowBuffer=A,D.INSPECT_MAX_BYTES=50;const j=2147483647;D.kMaxLength=j;const{Uint8Array:Y,ArrayBuffer:X,SharedArrayBuffer:ie}=globalThis;P.TYPED_ARRAY_SUPPORT=se(),!P.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function se(){try{const v=new Y(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Y.prototype),Object.setPrototypeOf(v,u),v.foo()===42}catch{return!1}}Object.defineProperty(P.prototype,"parent",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.buffer}}),Object.defineProperty(P.prototype,"offset",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.byteOffset}});function ne(v){if(v>j)throw new RangeError('The value "'+v+'" is invalid for option "size"');const u=new Y(v);return Object.setPrototypeOf(u,P.prototype),u}function P(v,u,h){if(typeof v=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(v)}return m(v,u,h)}P.poolSize=8192;function m(v,u,h){if(typeof v=="string")return y(v,u);if(X.isView(v))return I(v);if(v==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v);if(ht(v,X)||v&&ht(v.buffer,X)||typeof ie<"u"&&(ht(v,ie)||v&&ht(v.buffer,ie)))return R(v,u,h);if(typeof v=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const _=v.valueOf&&v.valueOf();if(_!=null&&_!==v)return P.from(_,u,h);const F=p(v);if(F)return F;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof v[Symbol.toPrimitive]=="function")return P.from(v[Symbol.toPrimitive]("string"),u,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v)}P.from=function(v,u,h){return m(v,u,h)},Object.setPrototypeOf(P.prototype,Y.prototype),Object.setPrototypeOf(P,Y);function a(v){if(typeof v!="number")throw new TypeError('"size" argument must be of type number');if(v<0)throw new RangeError('The value "'+v+'" is invalid for option "size"')}function d(v,u,h){return a(v),v<=0?ne(v):u!==void 0?typeof h=="string"?ne(v).fill(u,h):ne(v).fill(u):ne(v)}P.alloc=function(v,u,h){return d(v,u,h)};function b(v){return a(v),ne(v<0?0:f(v)|0)}P.allocUnsafe=function(v){return b(v)},P.allocUnsafeSlow=function(v){return b(v)};function y(v,u){if((typeof u!="string"||u==="")&&(u="utf8"),!P.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const h=B(v,u)|0;let _=ne(h);const F=_.write(v,u);return F!==h&&(_=_.slice(0,F)),_}function E(v){const u=v.length<0?0:f(v.length)|0,h=ne(u);for(let _=0;_<u;_+=1)h[_]=v[_]&255;return h}function I(v){if(ht(v,Y)){const u=new Y(v);return R(u.buffer,u.byteOffset,u.byteLength)}return E(v)}function R(v,u,h){if(u<0||v.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(v.byteLength<u+(h||0))throw new RangeError('"length" is outside of buffer bounds');let _;return u===void 0&&h===void 0?_=new Y(v):h===void 0?_=new Y(v,u):_=new Y(v,u,h),Object.setPrototypeOf(_,P.prototype),_}function p(v){if(P.isBuffer(v)){const u=f(v.length)|0,h=ne(u);return h.length===0||v.copy(h,0,0,u),h}if(v.length!==void 0)return typeof v.length!="number"||Ue(v.length)?ne(0):E(v);if(v.type==="Buffer"&&Array.isArray(v.data))return E(v.data)}function f(v){if(v>=j)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+j.toString(16)+" bytes");return v|0}function A(v){return+v!=v&&(v=0),P.alloc(+v)}P.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==P.prototype},P.compare=function(u,h){if(ht(u,Y)&&(u=P.from(u,u.offset,u.byteLength)),ht(h,Y)&&(h=P.from(h,h.offset,h.byteLength)),!P.isBuffer(u)||!P.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===h)return 0;let _=u.length,F=h.length;for(let L=0,V=Math.min(_,F);L<V;++L)if(u[L]!==h[L]){_=u[L],F=h[L];break}return _<F?-1:F<_?1:0},P.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},P.concat=function(u,h){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return P.alloc(0);let _;if(h===void 0)for(h=0,_=0;_<u.length;++_)h+=u[_].length;const F=P.allocUnsafe(h);let L=0;for(_=0;_<u.length;++_){let V=u[_];if(ht(V,Y))L+V.length>F.length?(P.isBuffer(V)||(V=P.from(V)),V.copy(F,L)):Y.prototype.set.call(F,V,L);else if(P.isBuffer(V))V.copy(F,L);else throw new TypeError('"list" argument must be an Array of Buffers');L+=V.length}return F};function B(v,u){if(P.isBuffer(v))return v.length;if(X.isView(v)||ht(v,X))return v.byteLength;if(typeof v!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof v);const h=v.length,_=arguments.length>2&&arguments[2]===!0;if(!_&&h===0)return 0;let F=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return De(v).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Ge(v).length;default:if(F)return _?-1:De(v).length;u=(""+u).toLowerCase(),F=!0}}P.byteLength=B;function l(v,u,h){let _=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,u>>>=0,h<=u))return"";for(v||(v="utf8");;)switch(v){case"hex":return Ce(this,u,h);case"utf8":case"utf-8":return ue(this,u,h);case"ascii":return ke(this,u,h);case"latin1":case"binary":return Nt(this,u,h);case"base64":return ae(this,u,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ne(this,u,h);default:if(_)throw new TypeError("Unknown encoding: "+v);v=(v+"").toLowerCase(),_=!0}}P.prototype._isBuffer=!0;function N(v,u,h){const _=v[u];v[u]=v[h],v[h]=_}P.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<u;h+=2)N(this,h,h+1);return this},P.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<u;h+=4)N(this,h,h+3),N(this,h+1,h+2);return this},P.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<u;h+=8)N(this,h,h+7),N(this,h+1,h+6),N(this,h+2,h+5),N(this,h+3,h+4);return this},P.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?ue(this,0,u):l.apply(this,arguments)},P.prototype.toLocaleString=P.prototype.toString,P.prototype.equals=function(u){if(!P.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:P.compare(this,u)===0},P.prototype.inspect=function(){let u="";const h=D.INSPECT_MAX_BYTES;return u=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(u+=" ... "),"<Buffer "+u+">"},z&&(P.prototype[z]=P.prototype.inspect),P.prototype.compare=function(u,h,_,F,L){if(ht(u,Y)&&(u=P.from(u,u.offset,u.byteLength)),!P.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(h===void 0&&(h=0),_===void 0&&(_=u?u.length:0),F===void 0&&(F=0),L===void 0&&(L=this.length),h<0||_>u.length||F<0||L>this.length)throw new RangeError("out of range index");if(F>=L&&h>=_)return 0;if(F>=L)return-1;if(h>=_)return 1;if(h>>>=0,_>>>=0,F>>>=0,L>>>=0,this===u)return 0;let V=L-F,xe=_-h;const le=Math.min(V,xe),he=this.slice(F,L),Be=u.slice(h,_);for(let ce=0;ce<le;++ce)if(he[ce]!==Be[ce]){V=he[ce],xe=Be[ce];break}return V<xe?-1:xe<V?1:0};function J(v,u,h,_,F){if(v.length===0)return-1;if(typeof h=="string"?(_=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Ue(h)&&(h=F?0:v.length-1),h<0&&(h=v.length+h),h>=v.length){if(F)return-1;h=v.length-1}else if(h<0)if(F)h=0;else return-1;if(typeof u=="string"&&(u=P.from(u,_)),P.isBuffer(u))return u.length===0?-1:K(v,u,h,_,F);if(typeof u=="number")return u=u&255,typeof Y.prototype.indexOf=="function"?F?Y.prototype.indexOf.call(v,u,h):Y.prototype.lastIndexOf.call(v,u,h):K(v,[u],h,_,F);throw new TypeError("val must be string, number or Buffer")}function K(v,u,h,_,F){let L=1,V=v.length,xe=u.length;if(_!==void 0&&(_=String(_).toLowerCase(),_==="ucs2"||_==="ucs-2"||_==="utf16le"||_==="utf-16le")){if(v.length<2||u.length<2)return-1;L=2,V/=2,xe/=2,h/=2}function le(Be,ce){return L===1?Be[ce]:Be.readUInt16BE(ce*L)}let he;if(F){let Be=-1;for(he=h;he<V;he++)if(le(v,he)===le(u,Be===-1?0:he-Be)){if(Be===-1&&(Be=he),he-Be+1===xe)return Be*L}else Be!==-1&&(he-=he-Be),Be=-1}else for(h+xe>V&&(h=V-xe),he=h;he>=0;he--){let Be=!0;for(let ce=0;ce<xe;ce++)if(le(v,he+ce)!==le(u,ce)){Be=!1;break}if(Be)return he}return-1}P.prototype.includes=function(u,h,_){return this.indexOf(u,h,_)!==-1},P.prototype.indexOf=function(u,h,_){return J(this,u,h,_,!0)},P.prototype.lastIndexOf=function(u,h,_){return J(this,u,h,_,!1)};function W(v,u,h,_){h=Number(h)||0;const F=v.length-h;_?(_=Number(_),_>F&&(_=F)):_=F;const L=u.length;_>L/2&&(_=L/2);let V;for(V=0;V<_;++V){const xe=parseInt(u.substr(V*2,2),16);if(Ue(xe))return V;v[h+V]=xe}return V}function oe(v,u,h,_){return Re(De(u,v.length-h),v,h,_)}function $(v,u,h,_){return Re(Ke(u),v,h,_)}function te(v,u,h,_){return Re(Ge(u),v,h,_)}function _e(v,u,h,_){return Re(cr(u,v.length-h),v,h,_)}P.prototype.write=function(u,h,_,F){if(h===void 0)F="utf8",_=this.length,h=0;else if(_===void 0&&typeof h=="string")F=h,_=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(_)?(_=_>>>0,F===void 0&&(F="utf8")):(F=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const L=this.length-h;if((_===void 0||_>L)&&(_=L),u.length>0&&(_<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");let V=!1;for(;;)switch(F){case"hex":return W(this,u,h,_);case"utf8":case"utf-8":return oe(this,u,h,_);case"ascii":case"latin1":case"binary":return $(this,u,h,_);case"base64":return te(this,u,h,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,u,h,_);default:if(V)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),V=!0}},P.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ae(v,u,h){return u===0&&h===v.length?U.fromByteArray(v):U.fromByteArray(v.slice(u,h))}function ue(v,u,h){h=Math.min(v.length,h);const _=[];let F=u;for(;F<h;){const L=v[F];let V=null,xe=L>239?4:L>223?3:L>191?2:1;if(F+xe<=h){let le,he,Be,ce;switch(xe){case 1:L<128&&(V=L);break;case 2:le=v[F+1],(le&192)===128&&(ce=(L&31)<<6|le&63,ce>127&&(V=ce));break;case 3:le=v[F+1],he=v[F+2],(le&192)===128&&(he&192)===128&&(ce=(L&15)<<12|(le&63)<<6|he&63,ce>2047&&(ce<55296||ce>57343)&&(V=ce));break;case 4:le=v[F+1],he=v[F+2],Be=v[F+3],(le&192)===128&&(he&192)===128&&(Be&192)===128&&(ce=(L&15)<<18|(le&63)<<12|(he&63)<<6|Be&63,ce>65535&&ce<1114112&&(V=ce))}}V===null?(V=65533,xe=1):V>65535&&(V-=65536,_.push(V>>>10&1023|55296),V=56320|V&1023),_.push(V),F+=xe}return we(_)}const pt=4096;function we(v){const u=v.length;if(u<=pt)return String.fromCharCode.apply(String,v);let h="",_=0;for(;_<u;)h+=String.fromCharCode.apply(String,v.slice(_,_+=pt));return h}function ke(v,u,h){let _="";h=Math.min(v.length,h);for(let F=u;F<h;++F)_+=String.fromCharCode(v[F]&127);return _}function Nt(v,u,h){let _="";h=Math.min(v.length,h);for(let F=u;F<h;++F)_+=String.fromCharCode(v[F]);return _}function Ce(v,u,h){const _=v.length;(!u||u<0)&&(u=0),(!h||h<0||h>_)&&(h=_);let F="";for(let L=u;L<h;++L)F+=Je[v[L]];return F}function Ne(v,u,h){const _=v.slice(u,h);let F="";for(let L=0;L<_.length-1;L+=2)F+=String.fromCharCode(_[L]+_[L+1]*256);return F}P.prototype.slice=function(u,h){const _=this.length;u=~~u,h=h===void 0?_:~~h,u<0?(u+=_,u<0&&(u=0)):u>_&&(u=_),h<0?(h+=_,h<0&&(h=0)):h>_&&(h=_),h<u&&(h=u);const F=this.subarray(u,h);return Object.setPrototypeOf(F,P.prototype),F};function Fe(v,u,h){if(v%1!==0||v<0)throw new RangeError("offset is not uint");if(v+u>h)throw new RangeError("Trying to access beyond buffer length")}P.prototype.readUintLE=P.prototype.readUIntLE=function(u,h,_){u=u>>>0,h=h>>>0,_||Fe(u,h,this.length);let F=this[u],L=1,V=0;for(;++V<h&&(L*=256);)F+=this[u+V]*L;return F},P.prototype.readUintBE=P.prototype.readUIntBE=function(u,h,_){u=u>>>0,h=h>>>0,_||Fe(u,h,this.length);let F=this[u+--h],L=1;for(;h>0&&(L*=256);)F+=this[u+--h]*L;return F},P.prototype.readUint8=P.prototype.readUInt8=function(u,h){return u=u>>>0,h||Fe(u,1,this.length),this[u]},P.prototype.readUint16LE=P.prototype.readUInt16LE=function(u,h){return u=u>>>0,h||Fe(u,2,this.length),this[u]|this[u+1]<<8},P.prototype.readUint16BE=P.prototype.readUInt16BE=function(u,h){return u=u>>>0,h||Fe(u,2,this.length),this[u]<<8|this[u+1]},P.prototype.readUint32LE=P.prototype.readUInt32LE=function(u,h){return u=u>>>0,h||Fe(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},P.prototype.readUint32BE=P.prototype.readUInt32BE=function(u,h){return u=u>>>0,h||Fe(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},P.prototype.readBigUInt64LE=bt(function(u){u=u>>>0,_t(u,"offset");const h=this[u],_=this[u+7];(h===void 0||_===void 0)&&Ie(u,this.length-8);const F=h+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,L=this[++u]+this[++u]*2**8+this[++u]*2**16+_*2**24;return BigInt(F)+(BigInt(L)<<BigInt(32))}),P.prototype.readBigUInt64BE=bt(function(u){u=u>>>0,_t(u,"offset");const h=this[u],_=this[u+7];(h===void 0||_===void 0)&&Ie(u,this.length-8);const F=h*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],L=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+_;return(BigInt(F)<<BigInt(32))+BigInt(L)}),P.prototype.readIntLE=function(u,h,_){u=u>>>0,h=h>>>0,_||Fe(u,h,this.length);let F=this[u],L=1,V=0;for(;++V<h&&(L*=256);)F+=this[u+V]*L;return L*=128,F>=L&&(F-=Math.pow(2,8*h)),F},P.prototype.readIntBE=function(u,h,_){u=u>>>0,h=h>>>0,_||Fe(u,h,this.length);let F=h,L=1,V=this[u+--F];for(;F>0&&(L*=256);)V+=this[u+--F]*L;return L*=128,V>=L&&(V-=Math.pow(2,8*h)),V},P.prototype.readInt8=function(u,h){return u=u>>>0,h||Fe(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},P.prototype.readInt16LE=function(u,h){u=u>>>0,h||Fe(u,2,this.length);const _=this[u]|this[u+1]<<8;return _&32768?_|4294901760:_},P.prototype.readInt16BE=function(u,h){u=u>>>0,h||Fe(u,2,this.length);const _=this[u+1]|this[u]<<8;return _&32768?_|4294901760:_},P.prototype.readInt32LE=function(u,h){return u=u>>>0,h||Fe(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},P.prototype.readInt32BE=function(u,h){return u=u>>>0,h||Fe(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},P.prototype.readBigInt64LE=bt(function(u){u=u>>>0,_t(u,"offset");const h=this[u],_=this[u+7];(h===void 0||_===void 0)&&Ie(u,this.length-8);const F=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(_<<24);return(BigInt(F)<<BigInt(32))+BigInt(h+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),P.prototype.readBigInt64BE=bt(function(u){u=u>>>0,_t(u,"offset");const h=this[u],_=this[u+7];(h===void 0||_===void 0)&&Ie(u,this.length-8);const F=(h<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(F)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+_)}),P.prototype.readFloatLE=function(u,h){return u=u>>>0,h||Fe(u,4,this.length),q.read(this,u,!0,23,4)},P.prototype.readFloatBE=function(u,h){return u=u>>>0,h||Fe(u,4,this.length),q.read(this,u,!1,23,4)},P.prototype.readDoubleLE=function(u,h){return u=u>>>0,h||Fe(u,8,this.length),q.read(this,u,!0,52,8)},P.prototype.readDoubleBE=function(u,h){return u=u>>>0,h||Fe(u,8,this.length),q.read(this,u,!1,52,8)};function be(v,u,h,_,F,L){if(!P.isBuffer(v))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>F||u<L)throw new RangeError('"value" argument is out of bounds');if(h+_>v.length)throw new RangeError("Index out of range")}P.prototype.writeUintLE=P.prototype.writeUIntLE=function(u,h,_,F){if(u=+u,h=h>>>0,_=_>>>0,!F){const xe=Math.pow(2,8*_)-1;be(this,u,h,_,xe,0)}let L=1,V=0;for(this[h]=u&255;++V<_&&(L*=256);)this[h+V]=u/L&255;return h+_},P.prototype.writeUintBE=P.prototype.writeUIntBE=function(u,h,_,F){if(u=+u,h=h>>>0,_=_>>>0,!F){const xe=Math.pow(2,8*_)-1;be(this,u,h,_,xe,0)}let L=_-1,V=1;for(this[h+L]=u&255;--L>=0&&(V*=256);)this[h+L]=u/V&255;return h+_},P.prototype.writeUint8=P.prototype.writeUInt8=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,1,255,0),this[h]=u&255,h+1},P.prototype.writeUint16LE=P.prototype.writeUInt16LE=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,2,65535,0),this[h]=u&255,this[h+1]=u>>>8,h+2},P.prototype.writeUint16BE=P.prototype.writeUInt16BE=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,2,65535,0),this[h]=u>>>8,this[h+1]=u&255,h+2},P.prototype.writeUint32LE=P.prototype.writeUInt32LE=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,4,4294967295,0),this[h+3]=u>>>24,this[h+2]=u>>>16,this[h+1]=u>>>8,this[h]=u&255,h+4},P.prototype.writeUint32BE=P.prototype.writeUInt32BE=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,4,4294967295,0),this[h]=u>>>24,this[h+1]=u>>>16,this[h+2]=u>>>8,this[h+3]=u&255,h+4};function Ae(v,u,h,_,F){Le(u,_,F,v,h,7);let L=Number(u&BigInt(4294967295));v[h++]=L,L=L>>8,v[h++]=L,L=L>>8,v[h++]=L,L=L>>8,v[h++]=L;let V=Number(u>>BigInt(32)&BigInt(4294967295));return v[h++]=V,V=V>>8,v[h++]=V,V=V>>8,v[h++]=V,V=V>>8,v[h++]=V,h}function wt(v,u,h,_,F){Le(u,_,F,v,h,7);let L=Number(u&BigInt(4294967295));v[h+7]=L,L=L>>8,v[h+6]=L,L=L>>8,v[h+5]=L,L=L>>8,v[h+4]=L;let V=Number(u>>BigInt(32)&BigInt(4294967295));return v[h+3]=V,V=V>>8,v[h+2]=V,V=V>>8,v[h+1]=V,V=V>>8,v[h]=V,h+8}P.prototype.writeBigUInt64LE=bt(function(u,h=0){return Ae(this,u,h,BigInt(0),BigInt("0xffffffffffffffff"))}),P.prototype.writeBigUInt64BE=bt(function(u,h=0){return wt(this,u,h,BigInt(0),BigInt("0xffffffffffffffff"))}),P.prototype.writeIntLE=function(u,h,_,F){if(u=+u,h=h>>>0,!F){const le=Math.pow(2,8*_-1);be(this,u,h,_,le-1,-le)}let L=0,V=1,xe=0;for(this[h]=u&255;++L<_&&(V*=256);)u<0&&xe===0&&this[h+L-1]!==0&&(xe=1),this[h+L]=(u/V>>0)-xe&255;return h+_},P.prototype.writeIntBE=function(u,h,_,F){if(u=+u,h=h>>>0,!F){const le=Math.pow(2,8*_-1);be(this,u,h,_,le-1,-le)}let L=_-1,V=1,xe=0;for(this[h+L]=u&255;--L>=0&&(V*=256);)u<0&&xe===0&&this[h+L+1]!==0&&(xe=1),this[h+L]=(u/V>>0)-xe&255;return h+_},P.prototype.writeInt8=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,1,127,-128),u<0&&(u=255+u+1),this[h]=u&255,h+1},P.prototype.writeInt16LE=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,2,32767,-32768),this[h]=u&255,this[h+1]=u>>>8,h+2},P.prototype.writeInt16BE=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,2,32767,-32768),this[h]=u>>>8,this[h+1]=u&255,h+2},P.prototype.writeInt32LE=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,4,2147483647,-2147483648),this[h]=u&255,this[h+1]=u>>>8,this[h+2]=u>>>16,this[h+3]=u>>>24,h+4},P.prototype.writeInt32BE=function(u,h,_){return u=+u,h=h>>>0,_||be(this,u,h,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[h]=u>>>24,this[h+1]=u>>>16,this[h+2]=u>>>8,this[h+3]=u&255,h+4},P.prototype.writeBigInt64LE=bt(function(u,h=0){return Ae(this,u,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),P.prototype.writeBigInt64BE=bt(function(u,h=0){return wt(this,u,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Pe(v,u,h,_,F,L){if(h+_>v.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function Me(v,u,h,_,F){return u=+u,h=h>>>0,F||Pe(v,u,h,4),q.write(v,u,h,_,23,4),h+4}P.prototype.writeFloatLE=function(u,h,_){return Me(this,u,h,!0,_)},P.prototype.writeFloatBE=function(u,h,_){return Me(this,u,h,!1,_)};function Qt(v,u,h,_,F){return u=+u,h=h>>>0,F||Pe(v,u,h,8),q.write(v,u,h,_,52,8),h+8}P.prototype.writeDoubleLE=function(u,h,_){return Qt(this,u,h,!0,_)},P.prototype.writeDoubleBE=function(u,h,_){return Qt(this,u,h,!1,_)},P.prototype.copy=function(u,h,_,F){if(!P.isBuffer(u))throw new TypeError("argument should be a Buffer");if(_||(_=0),!F&&F!==0&&(F=this.length),h>=u.length&&(h=u.length),h||(h=0),F>0&&F<_&&(F=_),F===_||u.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("sourceEnd out of bounds");F>this.length&&(F=this.length),u.length-h<F-_&&(F=u.length-h+_);const L=F-_;return this===u&&typeof Y.prototype.copyWithin=="function"?this.copyWithin(h,_,F):Y.prototype.set.call(u,this.subarray(_,F),h),L},P.prototype.fill=function(u,h,_,F){if(typeof u=="string"){if(typeof h=="string"?(F=h,h=0,_=this.length):typeof _=="string"&&(F=_,_=this.length),F!==void 0&&typeof F!="string")throw new TypeError("encoding must be a string");if(typeof F=="string"&&!P.isEncoding(F))throw new TypeError("Unknown encoding: "+F);if(u.length===1){const V=u.charCodeAt(0);(F==="utf8"&&V<128||F==="latin1")&&(u=V)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(h<0||this.length<h||this.length<_)throw new RangeError("Out of range index");if(_<=h)return this;h=h>>>0,_=_===void 0?this.length:_>>>0,u||(u=0);let L;if(typeof u=="number")for(L=h;L<_;++L)this[L]=u;else{const V=P.isBuffer(u)?u:P.from(u,F),xe=V.length;if(xe===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(L=0;L<_-h;++L)this[L+h]=V[L%xe]}return this};const Se={};function Oe(v,u,h){Se[v]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${v}]`,this.stack,delete this.name}get code(){return v}set code(F){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:F,writable:!0})}toString(){return`${this.name} [${v}]: ${this.message}`}}}Oe("ERR_BUFFER_OUT_OF_BOUNDS",function(v){return v?`${v} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Oe("ERR_INVALID_ARG_TYPE",function(v,u){return`The "${v}" argument must be of type number. Received type ${typeof u}`},TypeError),Oe("ERR_OUT_OF_RANGE",function(v,u,h){let _=`The value of "${v}" is out of range.`,F=h;return Number.isInteger(h)&&Math.abs(h)>2**32?F=Yt(String(h)):typeof h=="bigint"&&(F=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(F=Yt(F)),F+="n"),_+=` It must be ${u}. Received ${F}`,_},RangeError);function Yt(v){let u="",h=v.length;const _=v[0]==="-"?1:0;for(;h>=_+4;h-=3)u=`_${v.slice(h-3,h)}${u}`;return`${v.slice(0,h)}${u}`}function ze(v,u,h){_t(u,"offset"),(v[u]===void 0||v[u+h]===void 0)&&Ie(u,v.length-(h+1))}function Le(v,u,h,_,F,L){if(v>h||v<u){const V=typeof u=="bigint"?"n":"";let xe;throw u===0||u===BigInt(0)?xe=`>= 0${V} and < 2${V} ** ${(L+1)*8}${V}`:xe=`>= -(2${V} ** ${(L+1)*8-1}${V}) and < 2 ** ${(L+1)*8-1}${V}`,new Se.ERR_OUT_OF_RANGE("value",xe,v)}ze(_,F,L)}function _t(v,u){if(typeof v!="number")throw new Se.ERR_INVALID_ARG_TYPE(u,"number",v)}function Ie(v,u,h){throw Math.floor(v)!==v?(_t(v,h),new Se.ERR_OUT_OF_RANGE("offset","an integer",v)):u<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,v)}const He=/[^+/0-9A-Za-z-_]/g;function fr(v){if(v=v.split("=")[0],v=v.trim().replace(He,""),v.length<2)return"";for(;v.length%4!==0;)v=v+"=";return v}function De(v,u){u=u||1/0;let h;const _=v.length;let F=null;const L=[];for(let V=0;V<_;++V){if(h=v.charCodeAt(V),h>55295&&h<57344){if(!F){if(h>56319){(u-=3)>-1&&L.push(239,191,189);continue}else if(V+1===_){(u-=3)>-1&&L.push(239,191,189);continue}F=h;continue}if(h<56320){(u-=3)>-1&&L.push(239,191,189),F=h;continue}h=(F-55296<<10|h-56320)+65536}else F&&(u-=3)>-1&&L.push(239,191,189);if(F=null,h<128){if((u-=1)<0)break;L.push(h)}else if(h<2048){if((u-=2)<0)break;L.push(h>>6|192,h&63|128)}else if(h<65536){if((u-=3)<0)break;L.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((u-=4)<0)break;L.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return L}function Ke(v){const u=[];for(let h=0;h<v.length;++h)u.push(v.charCodeAt(h)&255);return u}function cr(v,u){let h,_,F;const L=[];for(let V=0;V<v.length&&!((u-=2)<0);++V)h=v.charCodeAt(V),_=h>>8,F=h%256,L.push(F),L.push(_);return L}function Ge(v){return U.toByteArray(fr(v))}function Re(v,u,h,_){let F;for(F=0;F<_&&!(F+h>=u.length||F>=v.length);++F)u[F+h]=v[F];return F}function ht(v,u){return v instanceof u||v!=null&&v.constructor!=null&&v.constructor.name!=null&&v.constructor.name===u.name}function Ue(v){return v!==v}const Je=(function(){const v="0123456789abcdef",u=new Array(256);for(let h=0;h<16;++h){const _=h*16;for(let F=0;F<16;++F)u[_+F]=v[h]+v[F]}return u})();function bt(v){return typeof BigInt>"u"?Ve:v}function Ve(){throw new Error("BigInt not supported")}})(e);const T=e.Buffer;n.Blob=e.Blob,n.BlobOptions=e.BlobOptions,n.Buffer=e.Buffer,n.File=e.File,n.FileOptions=e.FileOptions,n.INSPECT_MAX_BYTES=e.INSPECT_MAX_BYTES,n.SlowBuffer=e.SlowBuffer,n.TranscodeEncoding=e.TranscodeEncoding,n.atob=e.atob,n.btoa=e.btoa,n.constants=e.constants,n.default=T,n.isAscii=e.isAscii,n.isUtf8=e.isUtf8,n.kMaxLength=e.kMaxLength,n.kStringMaxLength=e.kStringMaxLength,n.resolveObjectURL=e.resolveObjectURL,n.transcode=e.transcode})(Mi)),Mi}var Ia=Ln.exports,Fo;function ka(){return Fo||(Fo=1,(function(n){(function(e,t){function r(m,a){if(!m)throw new Error(a||"Assertion failed")}function i(m,a){m.super_=a;var d=function(){};d.prototype=a.prototype,m.prototype=new d,m.prototype.constructor=m}function o(m,a,d){if(o.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((a==="le"||a==="be")&&(d=a,a=10),this._init(m||0,a||10,d||"be"))}typeof e=="object"?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=Ma().Buffer}catch{}o.isBN=function(a){return a instanceof o?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===o.wordSize&&Array.isArray(a.words)},o.max=function(a,d){return a.cmp(d)>0?a:d},o.min=function(a,d){return a.cmp(d)<0?a:d},o.prototype._init=function(a,d,b){if(typeof a=="number")return this._initNumber(a,d,b);if(typeof a=="object")return this._initArray(a,d,b);d==="hex"&&(d=16),r(d===(d|0)&&d>=2&&d<=36),a=a.toString().replace(/\s+/g,"");var y=0;a[0]==="-"&&(y++,this.negative=1),y<a.length&&(d===16?this._parseHex(a,y,b):(this._parseBase(a,d,y),b==="le"&&this._initArray(this.toArray(),d,b)))},o.prototype._initNumber=function(a,d,b){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[a&67108863],this.length=1):a<4503599627370496?(this.words=[a&67108863,a/67108864&67108863],this.length=2):(r(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),d,b)},o.prototype._initArray=function(a,d,b){if(r(typeof a.length=="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var E,I,R=0;if(b==="be")for(y=a.length-1,E=0;y>=0;y-=3)I=a[y]|a[y-1]<<8|a[y-2]<<16,this.words[E]|=I<<R&67108863,this.words[E+1]=I>>>26-R&67108863,R+=24,R>=26&&(R-=26,E++);else if(b==="le")for(y=0,E=0;y<a.length;y+=3)I=a[y]|a[y+1]<<8|a[y+2]<<16,this.words[E]|=I<<R&67108863,this.words[E+1]=I>>>26-R&67108863,R+=24,R>=26&&(R-=26,E++);return this._strip()};function c(m,a){var d=m.charCodeAt(a);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;r(!1,"Invalid character in "+m)}function x(m,a,d){var b=c(m,d);return d-1>=a&&(b|=c(m,d-1)<<4),b}o.prototype._parseHex=function(a,d,b){this.length=Math.ceil((a.length-d)/6),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var E=0,I=0,R;if(b==="be")for(y=a.length-1;y>=d;y-=2)R=x(a,d,y)<<E,this.words[I]|=R&67108863,E>=18?(E-=18,I+=1,this.words[I]|=R>>>26):E+=8;else{var p=a.length-d;for(y=p%2===0?d+1:d;y<a.length;y+=2)R=x(a,d,y)<<E,this.words[I]|=R&67108863,E>=18?(E-=18,I+=1,this.words[I]|=R>>>26):E+=8}this._strip()};function g(m,a,d,b){for(var y=0,E=0,I=Math.min(m.length,d),R=a;R<I;R++){var p=m.charCodeAt(R)-48;y*=b,p>=49?E=p-49+10:p>=17?E=p-17+10:E=p,r(p>=0&&E<b,"Invalid character"),y+=E}return y}o.prototype._parseBase=function(a,d,b){this.words=[0],this.length=1;for(var y=0,E=1;E<=67108863;E*=d)y++;y--,E=E/d|0;for(var I=a.length-b,R=I%y,p=Math.min(I,I-R)+b,f=0,A=b;A<p;A+=y)f=g(a,A,A+y,d),this.imuln(E),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(R!==0){var B=1;for(f=g(a,A,a.length,d),A=0;A<R;A++)B*=d;this.imuln(B),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this._strip()},o.prototype.copy=function(a){a.words=new Array(this.length);for(var d=0;d<this.length;d++)a.words[d]=this.words[d];a.length=this.length,a.negative=this.negative,a.red=this.red};function w(m,a){m.words=a.words,m.length=a.length,m.negative=a.negative,m.red=a.red}if(o.prototype._move=function(a){w(a,this)},o.prototype.clone=function(){var a=new o(null);return this.copy(a),a},o.prototype._expand=function(a){for(;this.length<a;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{o.prototype.inspect=M}else o.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var C=["","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"],G=[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],H=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(a,d){a=a||10,d=d|0||1;var b;if(a===16||a==="hex"){b="";for(var y=0,E=0,I=0;I<this.length;I++){var R=this.words[I],p=((R<<y|E)&16777215).toString(16);E=R>>>24-y&16777215,y+=2,y>=26&&(y-=26,I--),E!==0||I!==this.length-1?b=C[6-p.length]+p+b:b=p+b}for(E!==0&&(b=E.toString(16)+b);b.length%d!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(a===(a|0)&&a>=2&&a<=36){var f=G[a],A=H[a];b="";var B=this.clone();for(B.negative=0;!B.isZero();){var l=B.modrn(A).toString(a);B=B.idivn(A),B.isZero()?b=l+b:b=C[f-l.length]+l+b}for(this.isZero()&&(b="0"+b);b.length%d!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(a,d){return this.toArrayLike(s,a,d)}),o.prototype.toArray=function(a,d){return this.toArrayLike(Array,a,d)};var k=function(a,d){return a.allocUnsafe?a.allocUnsafe(d):new a(d)};o.prototype.toArrayLike=function(a,d,b){this._strip();var y=this.byteLength(),E=b||Math.max(1,y);r(y<=E,"byte array longer than desired length"),r(E>0,"Requested array length <= 0");var I=k(a,E),R=d==="le"?"LE":"BE";return this["_toArrayLike"+R](I,y),I},o.prototype._toArrayLikeLE=function(a,d){for(var b=0,y=0,E=0,I=0;E<this.length;E++){var R=this.words[E]<<I|y;a[b++]=R&255,b<a.length&&(a[b++]=R>>8&255),b<a.length&&(a[b++]=R>>16&255),I===6?(b<a.length&&(a[b++]=R>>24&255),y=0,I=0):(y=R>>>24,I+=2)}if(b<a.length)for(a[b++]=y;b<a.length;)a[b++]=0},o.prototype._toArrayLikeBE=function(a,d){for(var b=a.length-1,y=0,E=0,I=0;E<this.length;E++){var R=this.words[E]<<I|y;a[b--]=R&255,b>=0&&(a[b--]=R>>8&255),b>=0&&(a[b--]=R>>16&255),I===6?(b>=0&&(a[b--]=R>>24&255),y=0,I=0):(y=R>>>24,I+=2)}if(b>=0)for(a[b--]=y;b>=0;)a[b--]=0},Math.clz32?o.prototype._countBits=function(a){return 32-Math.clz32(a)}:o.prototype._countBits=function(a){var d=a,b=0;return d>=4096&&(b+=13,d>>>=13),d>=64&&(b+=7,d>>>=7),d>=8&&(b+=4,d>>>=4),d>=2&&(b+=2,d>>>=2),b+d},o.prototype._zeroBits=function(a){if(a===0)return 26;var d=a,b=0;return(d&8191)===0&&(b+=13,d>>>=13),(d&127)===0&&(b+=7,d>>>=7),(d&15)===0&&(b+=4,d>>>=4),(d&3)===0&&(b+=2,d>>>=2),(d&1)===0&&b++,b},o.prototype.bitLength=function(){var a=this.words[this.length-1],d=this._countBits(a);return(this.length-1)*26+d};function S(m){for(var a=new Array(m.bitLength()),d=0;d<a.length;d++){var b=d/26|0,y=d%26;a[d]=m.words[b]>>>y&1}return a}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,d=0;d<this.length;d++){var b=this._zeroBits(this.words[d]);if(a+=b,b!==26)break}return a},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(a){return this.negative!==0?this.abs().inotn(a).iaddn(1):this.clone()},o.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var d=0;d<a.length;d++)this.words[d]=this.words[d]|a.words[d];return this._strip()},o.prototype.ior=function(a){return r((this.negative|a.negative)===0),this.iuor(a)},o.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},o.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},o.prototype.iuand=function(a){var d;this.length>a.length?d=a:d=this;for(var b=0;b<d.length;b++)this.words[b]=this.words[b]&a.words[b];return this.length=d.length,this._strip()},o.prototype.iand=function(a){return r((this.negative|a.negative)===0),this.iuand(a)},o.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},o.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},o.prototype.iuxor=function(a){var d,b;this.length>a.length?(d=this,b=a):(d=a,b=this);for(var y=0;y<b.length;y++)this.words[y]=d.words[y]^b.words[y];if(this!==d)for(;y<d.length;y++)this.words[y]=d.words[y];return this.length=d.length,this._strip()},o.prototype.ixor=function(a){return r((this.negative|a.negative)===0),this.iuxor(a)},o.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},o.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},o.prototype.inotn=function(a){r(typeof a=="number"&&a>=0);var d=Math.ceil(a/26)|0,b=a%26;this._expand(d),b>0&&d--;for(var y=0;y<d;y++)this.words[y]=~this.words[y]&67108863;for(b>0&&(this.words[y]=~this.words[y]&67108863>>26-b,y++);y<this.length;y++)this.words[y]=0;return this._strip()},o.prototype.notn=function(a){return this.clone().inotn(a)},o.prototype.setn=function(a,d){r(typeof a=="number"&&a>=0);var b=a/26|0,y=a%26;return this._expand(b+1),d?this.words[b]=this.words[b]|1<<y:this.words[b]=this.words[b]&~(1<<y),this._strip()},o.prototype.iadd=function(a){var d;if(this.negative!==0&&a.negative===0)return this.negative=0,d=this.isub(a),this.negative^=1,this._normSign();if(this.negative===0&&a.negative!==0)return a.negative=0,d=this.isub(a),a.negative=1,d._normSign();var b,y;this.length>a.length?(b=this,y=a):(b=a,y=this);for(var E=0,I=0;I<y.length;I++)d=(b.words[I]|0)+(y.words[I]|0)+E,this.words[I]=d&67108863,E=d>>>26;for(;E!==0&&I<b.length;I++)d=(b.words[I]|0)+E,this.words[I]=d&67108863,E=d>>>26;if(this.length=b.length,E!==0)this.words[this.length]=E,this.length++;else if(b!==this)for(;I<b.length;I++)this.words[I]=b.words[I];return this},o.prototype.add=function(a){var d;return a.negative!==0&&this.negative===0?(a.negative=0,d=this.sub(a),a.negative^=1,d):a.negative===0&&this.negative!==0?(this.negative=0,d=a.sub(this),this.negative=1,d):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},o.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var d=this.iadd(a);return a.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var b=this.cmp(a);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var y,E;b>0?(y=this,E=a):(y=a,E=this);for(var I=0,R=0;R<E.length;R++)d=(y.words[R]|0)-(E.words[R]|0)+I,I=d>>26,this.words[R]=d&67108863;for(;I!==0&&R<y.length;R++)d=(y.words[R]|0)+I,I=d>>26,this.words[R]=d&67108863;if(I===0&&R<y.length&&y!==this)for(;R<y.length;R++)this.words[R]=y.words[R];return this.length=Math.max(this.length,R),y!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(a){return this.clone().isub(a)};function T(m,a,d){d.negative=a.negative^m.negative;var b=m.length+a.length|0;d.length=b,b=b-1|0;var y=m.words[0]|0,E=a.words[0]|0,I=y*E,R=I&67108863,p=I/67108864|0;d.words[0]=R;for(var f=1;f<b;f++){for(var A=p>>>26,B=p&67108863,l=Math.min(f,a.length-1),N=Math.max(0,f-m.length+1);N<=l;N++){var J=f-N|0;y=m.words[J]|0,E=a.words[N]|0,I=y*E+B,A+=I/67108864|0,B=I&67108863}d.words[f]=B|0,p=A|0}return p!==0?d.words[f]=p|0:d.length--,d._strip()}var D=function(a,d,b){var y=a.words,E=d.words,I=b.words,R=0,p,f,A,B=y[0]|0,l=B&8191,N=B>>>13,J=y[1]|0,K=J&8191,W=J>>>13,oe=y[2]|0,$=oe&8191,te=oe>>>13,_e=y[3]|0,ae=_e&8191,ue=_e>>>13,pt=y[4]|0,we=pt&8191,ke=pt>>>13,Nt=y[5]|0,Ce=Nt&8191,Ne=Nt>>>13,Fe=y[6]|0,be=Fe&8191,Ae=Fe>>>13,wt=y[7]|0,Pe=wt&8191,Me=wt>>>13,Qt=y[8]|0,Se=Qt&8191,Oe=Qt>>>13,Yt=y[9]|0,ze=Yt&8191,Le=Yt>>>13,_t=E[0]|0,Ie=_t&8191,He=_t>>>13,fr=E[1]|0,De=fr&8191,Ke=fr>>>13,cr=E[2]|0,Ge=cr&8191,Re=cr>>>13,ht=E[3]|0,Ue=ht&8191,Je=ht>>>13,bt=E[4]|0,Ve=bt&8191,v=bt>>>13,u=E[5]|0,h=u&8191,_=u>>>13,F=E[6]|0,L=F&8191,V=F>>>13,xe=E[7]|0,le=xe&8191,he=xe>>>13,Be=E[8]|0,ce=Be&8191,Qe=Be>>>13,Cr=E[9]|0,Ye=Cr&8191,Xe=Cr>>>13;b.negative=a.negative^d.negative,b.length=19,p=Math.imul(l,Ie),f=Math.imul(l,He),f=f+Math.imul(N,Ie)|0,A=Math.imul(N,He);var gr=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(gr>>>26)|0,gr&=67108863,p=Math.imul(K,Ie),f=Math.imul(K,He),f=f+Math.imul(W,Ie)|0,A=Math.imul(W,He),p=p+Math.imul(l,De)|0,f=f+Math.imul(l,Ke)|0,f=f+Math.imul(N,De)|0,A=A+Math.imul(N,Ke)|0;var mr=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(mr>>>26)|0,mr&=67108863,p=Math.imul($,Ie),f=Math.imul($,He),f=f+Math.imul(te,Ie)|0,A=Math.imul(te,He),p=p+Math.imul(K,De)|0,f=f+Math.imul(K,Ke)|0,f=f+Math.imul(W,De)|0,A=A+Math.imul(W,Ke)|0,p=p+Math.imul(l,Ge)|0,f=f+Math.imul(l,Re)|0,f=f+Math.imul(N,Ge)|0,A=A+Math.imul(N,Re)|0;var yr=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(yr>>>26)|0,yr&=67108863,p=Math.imul(ae,Ie),f=Math.imul(ae,He),f=f+Math.imul(ue,Ie)|0,A=Math.imul(ue,He),p=p+Math.imul($,De)|0,f=f+Math.imul($,Ke)|0,f=f+Math.imul(te,De)|0,A=A+Math.imul(te,Ke)|0,p=p+Math.imul(K,Ge)|0,f=f+Math.imul(K,Re)|0,f=f+Math.imul(W,Ge)|0,A=A+Math.imul(W,Re)|0,p=p+Math.imul(l,Ue)|0,f=f+Math.imul(l,Je)|0,f=f+Math.imul(N,Ue)|0,A=A+Math.imul(N,Je)|0;var vr=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(vr>>>26)|0,vr&=67108863,p=Math.imul(we,Ie),f=Math.imul(we,He),f=f+Math.imul(ke,Ie)|0,A=Math.imul(ke,He),p=p+Math.imul(ae,De)|0,f=f+Math.imul(ae,Ke)|0,f=f+Math.imul(ue,De)|0,A=A+Math.imul(ue,Ke)|0,p=p+Math.imul($,Ge)|0,f=f+Math.imul($,Re)|0,f=f+Math.imul(te,Ge)|0,A=A+Math.imul(te,Re)|0,p=p+Math.imul(K,Ue)|0,f=f+Math.imul(K,Je)|0,f=f+Math.imul(W,Ue)|0,A=A+Math.imul(W,Je)|0,p=p+Math.imul(l,Ve)|0,f=f+Math.imul(l,v)|0,f=f+Math.imul(N,Ve)|0,A=A+Math.imul(N,v)|0;var wr=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(wr>>>26)|0,wr&=67108863,p=Math.imul(Ce,Ie),f=Math.imul(Ce,He),f=f+Math.imul(Ne,Ie)|0,A=Math.imul(Ne,He),p=p+Math.imul(we,De)|0,f=f+Math.imul(we,Ke)|0,f=f+Math.imul(ke,De)|0,A=A+Math.imul(ke,Ke)|0,p=p+Math.imul(ae,Ge)|0,f=f+Math.imul(ae,Re)|0,f=f+Math.imul(ue,Ge)|0,A=A+Math.imul(ue,Re)|0,p=p+Math.imul($,Ue)|0,f=f+Math.imul($,Je)|0,f=f+Math.imul(te,Ue)|0,A=A+Math.imul(te,Je)|0,p=p+Math.imul(K,Ve)|0,f=f+Math.imul(K,v)|0,f=f+Math.imul(W,Ve)|0,A=A+Math.imul(W,v)|0,p=p+Math.imul(l,h)|0,f=f+Math.imul(l,_)|0,f=f+Math.imul(N,h)|0,A=A+Math.imul(N,_)|0;var li=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(li>>>26)|0,li&=67108863,p=Math.imul(be,Ie),f=Math.imul(be,He),f=f+Math.imul(Ae,Ie)|0,A=Math.imul(Ae,He),p=p+Math.imul(Ce,De)|0,f=f+Math.imul(Ce,Ke)|0,f=f+Math.imul(Ne,De)|0,A=A+Math.imul(Ne,Ke)|0,p=p+Math.imul(we,Ge)|0,f=f+Math.imul(we,Re)|0,f=f+Math.imul(ke,Ge)|0,A=A+Math.imul(ke,Re)|0,p=p+Math.imul(ae,Ue)|0,f=f+Math.imul(ae,Je)|0,f=f+Math.imul(ue,Ue)|0,A=A+Math.imul(ue,Je)|0,p=p+Math.imul($,Ve)|0,f=f+Math.imul($,v)|0,f=f+Math.imul(te,Ve)|0,A=A+Math.imul(te,v)|0,p=p+Math.imul(K,h)|0,f=f+Math.imul(K,_)|0,f=f+Math.imul(W,h)|0,A=A+Math.imul(W,_)|0,p=p+Math.imul(l,L)|0,f=f+Math.imul(l,V)|0,f=f+Math.imul(N,L)|0,A=A+Math.imul(N,V)|0;var di=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(di>>>26)|0,di&=67108863,p=Math.imul(Pe,Ie),f=Math.imul(Pe,He),f=f+Math.imul(Me,Ie)|0,A=Math.imul(Me,He),p=p+Math.imul(be,De)|0,f=f+Math.imul(be,Ke)|0,f=f+Math.imul(Ae,De)|0,A=A+Math.imul(Ae,Ke)|0,p=p+Math.imul(Ce,Ge)|0,f=f+Math.imul(Ce,Re)|0,f=f+Math.imul(Ne,Ge)|0,A=A+Math.imul(Ne,Re)|0,p=p+Math.imul(we,Ue)|0,f=f+Math.imul(we,Je)|0,f=f+Math.imul(ke,Ue)|0,A=A+Math.imul(ke,Je)|0,p=p+Math.imul(ae,Ve)|0,f=f+Math.imul(ae,v)|0,f=f+Math.imul(ue,Ve)|0,A=A+Math.imul(ue,v)|0,p=p+Math.imul($,h)|0,f=f+Math.imul($,_)|0,f=f+Math.imul(te,h)|0,A=A+Math.imul(te,_)|0,p=p+Math.imul(K,L)|0,f=f+Math.imul(K,V)|0,f=f+Math.imul(W,L)|0,A=A+Math.imul(W,V)|0,p=p+Math.imul(l,le)|0,f=f+Math.imul(l,he)|0,f=f+Math.imul(N,le)|0,A=A+Math.imul(N,he)|0;var xi=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(xi>>>26)|0,xi&=67108863,p=Math.imul(Se,Ie),f=Math.imul(Se,He),f=f+Math.imul(Oe,Ie)|0,A=Math.imul(Oe,He),p=p+Math.imul(Pe,De)|0,f=f+Math.imul(Pe,Ke)|0,f=f+Math.imul(Me,De)|0,A=A+Math.imul(Me,Ke)|0,p=p+Math.imul(be,Ge)|0,f=f+Math.imul(be,Re)|0,f=f+Math.imul(Ae,Ge)|0,A=A+Math.imul(Ae,Re)|0,p=p+Math.imul(Ce,Ue)|0,f=f+Math.imul(Ce,Je)|0,f=f+Math.imul(Ne,Ue)|0,A=A+Math.imul(Ne,Je)|0,p=p+Math.imul(we,Ve)|0,f=f+Math.imul(we,v)|0,f=f+Math.imul(ke,Ve)|0,A=A+Math.imul(ke,v)|0,p=p+Math.imul(ae,h)|0,f=f+Math.imul(ae,_)|0,f=f+Math.imul(ue,h)|0,A=A+Math.imul(ue,_)|0,p=p+Math.imul($,L)|0,f=f+Math.imul($,V)|0,f=f+Math.imul(te,L)|0,A=A+Math.imul(te,V)|0,p=p+Math.imul(K,le)|0,f=f+Math.imul(K,he)|0,f=f+Math.imul(W,le)|0,A=A+Math.imul(W,he)|0,p=p+Math.imul(l,ce)|0,f=f+Math.imul(l,Qe)|0,f=f+Math.imul(N,ce)|0,A=A+Math.imul(N,Qe)|0;var pi=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(pi>>>26)|0,pi&=67108863,p=Math.imul(ze,Ie),f=Math.imul(ze,He),f=f+Math.imul(Le,Ie)|0,A=Math.imul(Le,He),p=p+Math.imul(Se,De)|0,f=f+Math.imul(Se,Ke)|0,f=f+Math.imul(Oe,De)|0,A=A+Math.imul(Oe,Ke)|0,p=p+Math.imul(Pe,Ge)|0,f=f+Math.imul(Pe,Re)|0,f=f+Math.imul(Me,Ge)|0,A=A+Math.imul(Me,Re)|0,p=p+Math.imul(be,Ue)|0,f=f+Math.imul(be,Je)|0,f=f+Math.imul(Ae,Ue)|0,A=A+Math.imul(Ae,Je)|0,p=p+Math.imul(Ce,Ve)|0,f=f+Math.imul(Ce,v)|0,f=f+Math.imul(Ne,Ve)|0,A=A+Math.imul(Ne,v)|0,p=p+Math.imul(we,h)|0,f=f+Math.imul(we,_)|0,f=f+Math.imul(ke,h)|0,A=A+Math.imul(ke,_)|0,p=p+Math.imul(ae,L)|0,f=f+Math.imul(ae,V)|0,f=f+Math.imul(ue,L)|0,A=A+Math.imul(ue,V)|0,p=p+Math.imul($,le)|0,f=f+Math.imul($,he)|0,f=f+Math.imul(te,le)|0,A=A+Math.imul(te,he)|0,p=p+Math.imul(K,ce)|0,f=f+Math.imul(K,Qe)|0,f=f+Math.imul(W,ce)|0,A=A+Math.imul(W,Qe)|0,p=p+Math.imul(l,Ye)|0,f=f+Math.imul(l,Xe)|0,f=f+Math.imul(N,Ye)|0,A=A+Math.imul(N,Xe)|0;var bi=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(bi>>>26)|0,bi&=67108863,p=Math.imul(ze,De),f=Math.imul(ze,Ke),f=f+Math.imul(Le,De)|0,A=Math.imul(Le,Ke),p=p+Math.imul(Se,Ge)|0,f=f+Math.imul(Se,Re)|0,f=f+Math.imul(Oe,Ge)|0,A=A+Math.imul(Oe,Re)|0,p=p+Math.imul(Pe,Ue)|0,f=f+Math.imul(Pe,Je)|0,f=f+Math.imul(Me,Ue)|0,A=A+Math.imul(Me,Je)|0,p=p+Math.imul(be,Ve)|0,f=f+Math.imul(be,v)|0,f=f+Math.imul(Ae,Ve)|0,A=A+Math.imul(Ae,v)|0,p=p+Math.imul(Ce,h)|0,f=f+Math.imul(Ce,_)|0,f=f+Math.imul(Ne,h)|0,A=A+Math.imul(Ne,_)|0,p=p+Math.imul(we,L)|0,f=f+Math.imul(we,V)|0,f=f+Math.imul(ke,L)|0,A=A+Math.imul(ke,V)|0,p=p+Math.imul(ae,le)|0,f=f+Math.imul(ae,he)|0,f=f+Math.imul(ue,le)|0,A=A+Math.imul(ue,he)|0,p=p+Math.imul($,ce)|0,f=f+Math.imul($,Qe)|0,f=f+Math.imul(te,ce)|0,A=A+Math.imul(te,Qe)|0,p=p+Math.imul(K,Ye)|0,f=f+Math.imul(K,Xe)|0,f=f+Math.imul(W,Ye)|0,A=A+Math.imul(W,Xe)|0;var gi=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(gi>>>26)|0,gi&=67108863,p=Math.imul(ze,Ge),f=Math.imul(ze,Re),f=f+Math.imul(Le,Ge)|0,A=Math.imul(Le,Re),p=p+Math.imul(Se,Ue)|0,f=f+Math.imul(Se,Je)|0,f=f+Math.imul(Oe,Ue)|0,A=A+Math.imul(Oe,Je)|0,p=p+Math.imul(Pe,Ve)|0,f=f+Math.imul(Pe,v)|0,f=f+Math.imul(Me,Ve)|0,A=A+Math.imul(Me,v)|0,p=p+Math.imul(be,h)|0,f=f+Math.imul(be,_)|0,f=f+Math.imul(Ae,h)|0,A=A+Math.imul(Ae,_)|0,p=p+Math.imul(Ce,L)|0,f=f+Math.imul(Ce,V)|0,f=f+Math.imul(Ne,L)|0,A=A+Math.imul(Ne,V)|0,p=p+Math.imul(we,le)|0,f=f+Math.imul(we,he)|0,f=f+Math.imul(ke,le)|0,A=A+Math.imul(ke,he)|0,p=p+Math.imul(ae,ce)|0,f=f+Math.imul(ae,Qe)|0,f=f+Math.imul(ue,ce)|0,A=A+Math.imul(ue,Qe)|0,p=p+Math.imul($,Ye)|0,f=f+Math.imul($,Xe)|0,f=f+Math.imul(te,Ye)|0,A=A+Math.imul(te,Xe)|0;var mi=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(mi>>>26)|0,mi&=67108863,p=Math.imul(ze,Ue),f=Math.imul(ze,Je),f=f+Math.imul(Le,Ue)|0,A=Math.imul(Le,Je),p=p+Math.imul(Se,Ve)|0,f=f+Math.imul(Se,v)|0,f=f+Math.imul(Oe,Ve)|0,A=A+Math.imul(Oe,v)|0,p=p+Math.imul(Pe,h)|0,f=f+Math.imul(Pe,_)|0,f=f+Math.imul(Me,h)|0,A=A+Math.imul(Me,_)|0,p=p+Math.imul(be,L)|0,f=f+Math.imul(be,V)|0,f=f+Math.imul(Ae,L)|0,A=A+Math.imul(Ae,V)|0,p=p+Math.imul(Ce,le)|0,f=f+Math.imul(Ce,he)|0,f=f+Math.imul(Ne,le)|0,A=A+Math.imul(Ne,he)|0,p=p+Math.imul(we,ce)|0,f=f+Math.imul(we,Qe)|0,f=f+Math.imul(ke,ce)|0,A=A+Math.imul(ke,Qe)|0,p=p+Math.imul(ae,Ye)|0,f=f+Math.imul(ae,Xe)|0,f=f+Math.imul(ue,Ye)|0,A=A+Math.imul(ue,Xe)|0;var yi=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(yi>>>26)|0,yi&=67108863,p=Math.imul(ze,Ve),f=Math.imul(ze,v),f=f+Math.imul(Le,Ve)|0,A=Math.imul(Le,v),p=p+Math.imul(Se,h)|0,f=f+Math.imul(Se,_)|0,f=f+Math.imul(Oe,h)|0,A=A+Math.imul(Oe,_)|0,p=p+Math.imul(Pe,L)|0,f=f+Math.imul(Pe,V)|0,f=f+Math.imul(Me,L)|0,A=A+Math.imul(Me,V)|0,p=p+Math.imul(be,le)|0,f=f+Math.imul(be,he)|0,f=f+Math.imul(Ae,le)|0,A=A+Math.imul(Ae,he)|0,p=p+Math.imul(Ce,ce)|0,f=f+Math.imul(Ce,Qe)|0,f=f+Math.imul(Ne,ce)|0,A=A+Math.imul(Ne,Qe)|0,p=p+Math.imul(we,Ye)|0,f=f+Math.imul(we,Xe)|0,f=f+Math.imul(ke,Ye)|0,A=A+Math.imul(ke,Xe)|0;var vi=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(vi>>>26)|0,vi&=67108863,p=Math.imul(ze,h),f=Math.imul(ze,_),f=f+Math.imul(Le,h)|0,A=Math.imul(Le,_),p=p+Math.imul(Se,L)|0,f=f+Math.imul(Se,V)|0,f=f+Math.imul(Oe,L)|0,A=A+Math.imul(Oe,V)|0,p=p+Math.imul(Pe,le)|0,f=f+Math.imul(Pe,he)|0,f=f+Math.imul(Me,le)|0,A=A+Math.imul(Me,he)|0,p=p+Math.imul(be,ce)|0,f=f+Math.imul(be,Qe)|0,f=f+Math.imul(Ae,ce)|0,A=A+Math.imul(Ae,Qe)|0,p=p+Math.imul(Ce,Ye)|0,f=f+Math.imul(Ce,Xe)|0,f=f+Math.imul(Ne,Ye)|0,A=A+Math.imul(Ne,Xe)|0;var wi=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(wi>>>26)|0,wi&=67108863,p=Math.imul(ze,L),f=Math.imul(ze,V),f=f+Math.imul(Le,L)|0,A=Math.imul(Le,V),p=p+Math.imul(Se,le)|0,f=f+Math.imul(Se,he)|0,f=f+Math.imul(Oe,le)|0,A=A+Math.imul(Oe,he)|0,p=p+Math.imul(Pe,ce)|0,f=f+Math.imul(Pe,Qe)|0,f=f+Math.imul(Me,ce)|0,A=A+Math.imul(Me,Qe)|0,p=p+Math.imul(be,Ye)|0,f=f+Math.imul(be,Xe)|0,f=f+Math.imul(Ae,Ye)|0,A=A+Math.imul(Ae,Xe)|0;var Ai=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(Ai>>>26)|0,Ai&=67108863,p=Math.imul(ze,le),f=Math.imul(ze,he),f=f+Math.imul(Le,le)|0,A=Math.imul(Le,he),p=p+Math.imul(Se,ce)|0,f=f+Math.imul(Se,Qe)|0,f=f+Math.imul(Oe,ce)|0,A=A+Math.imul(Oe,Qe)|0,p=p+Math.imul(Pe,Ye)|0,f=f+Math.imul(Pe,Xe)|0,f=f+Math.imul(Me,Ye)|0,A=A+Math.imul(Me,Xe)|0;var Ei=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(Ei>>>26)|0,Ei&=67108863,p=Math.imul(ze,ce),f=Math.imul(ze,Qe),f=f+Math.imul(Le,ce)|0,A=Math.imul(Le,Qe),p=p+Math.imul(Se,Ye)|0,f=f+Math.imul(Se,Xe)|0,f=f+Math.imul(Oe,Ye)|0,A=A+Math.imul(Oe,Xe)|0;var _i=(R+p|0)+((f&8191)<<13)|0;R=(A+(f>>>13)|0)+(_i>>>26)|0,_i&=67108863,p=Math.imul(ze,Ye),f=Math.imul(ze,Xe),f=f+Math.imul(Le,Ye)|0,A=Math.imul(Le,Xe);var Si=(R+p|0)+((f&8191)<<13)|0;return R=(A+(f>>>13)|0)+(Si>>>26)|0,Si&=67108863,I[0]=gr,I[1]=mr,I[2]=yr,I[3]=vr,I[4]=wr,I[5]=li,I[6]=di,I[7]=xi,I[8]=pi,I[9]=bi,I[10]=gi,I[11]=mi,I[12]=yi,I[13]=vi,I[14]=wi,I[15]=Ai,I[16]=Ei,I[17]=_i,I[18]=Si,R!==0&&(I[19]=R,b.length++),b};Math.imul||(D=T);function U(m,a,d){d.negative=a.negative^m.negative,d.length=m.length+a.length;for(var b=0,y=0,E=0;E<d.length-1;E++){var I=y;y=0;for(var R=b&67108863,p=Math.min(E,a.length-1),f=Math.max(0,E-m.length+1);f<=p;f++){var A=E-f,B=m.words[A]|0,l=a.words[f]|0,N=B*l,J=N&67108863;I=I+(N/67108864|0)|0,J=J+R|0,R=J&67108863,I=I+(J>>>26)|0,y+=I>>>26,I&=67108863}d.words[E]=R,b=I,I=y}return b!==0?d.words[E]=b:d.length--,d._strip()}function q(m,a,d){return U(m,a,d)}o.prototype.mulTo=function(a,d){var b,y=this.length+a.length;return this.length===10&&a.length===10?b=D(this,a,d):y<63?b=T(this,a,d):y<1024?b=U(this,a,d):b=q(this,a,d),b},o.prototype.mul=function(a){var d=new o(null);return d.words=new Array(this.length+a.length),this.mulTo(a,d)},o.prototype.mulf=function(a){var d=new o(null);return d.words=new Array(this.length+a.length),q(this,a,d)},o.prototype.imul=function(a){return this.clone().mulTo(a,this)},o.prototype.imuln=function(a){var d=a<0;d&&(a=-a),r(typeof a=="number"),r(a<67108864);for(var b=0,y=0;y<this.length;y++){var E=(this.words[y]|0)*a,I=(E&67108863)+(b&67108863);b>>=26,b+=E/67108864|0,b+=I>>>26,this.words[y]=I&67108863}return b!==0&&(this.words[y]=b,this.length++),this.length=a===0?1:this.length,d?this.ineg():this},o.prototype.muln=function(a){return this.clone().imuln(a)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(a){var d=S(a);if(d.length===0)return new o(1);for(var b=this,y=0;y<d.length&&d[y]===0;y++,b=b.sqr());if(++y<d.length)for(var E=b.sqr();y<d.length;y++,E=E.sqr())d[y]!==0&&(b=b.mul(E));return b},o.prototype.iushln=function(a){r(typeof a=="number"&&a>=0);var d=a%26,b=(a-d)/26,y=67108863>>>26-d<<26-d,E;if(d!==0){var I=0;for(E=0;E<this.length;E++){var R=this.words[E]&y,p=(this.words[E]|0)-R<<d;this.words[E]=p|I,I=R>>>26-d}I&&(this.words[E]=I,this.length++)}if(b!==0){for(E=this.length-1;E>=0;E--)this.words[E+b]=this.words[E];for(E=0;E<b;E++)this.words[E]=0;this.length+=b}return this._strip()},o.prototype.ishln=function(a){return r(this.negative===0),this.iushln(a)},o.prototype.iushrn=function(a,d,b){r(typeof a=="number"&&a>=0);var y;d?y=(d-d%26)/26:y=0;var E=a%26,I=Math.min((a-E)/26,this.length),R=67108863^67108863>>>E<<E,p=b;if(y-=I,y=Math.max(0,y),p){for(var f=0;f<I;f++)p.words[f]=this.words[f];p.length=I}if(I!==0)if(this.length>I)for(this.length-=I,f=0;f<this.length;f++)this.words[f]=this.words[f+I];else this.words[0]=0,this.length=1;var A=0;for(f=this.length-1;f>=0&&(A!==0||f>=y);f--){var B=this.words[f]|0;this.words[f]=A<<26-E|B>>>E,A=B&R}return p&&A!==0&&(p.words[p.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(a,d,b){return r(this.negative===0),this.iushrn(a,d,b)},o.prototype.shln=function(a){return this.clone().ishln(a)},o.prototype.ushln=function(a){return this.clone().iushln(a)},o.prototype.shrn=function(a){return this.clone().ishrn(a)},o.prototype.ushrn=function(a){return this.clone().iushrn(a)},o.prototype.testn=function(a){r(typeof a=="number"&&a>=0);var d=a%26,b=(a-d)/26,y=1<<d;if(this.length<=b)return!1;var E=this.words[b];return!!(E&y)},o.prototype.imaskn=function(a){r(typeof a=="number"&&a>=0);var d=a%26,b=(a-d)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(d!==0&&b++,this.length=Math.min(b,this.length),d!==0){var y=67108863^67108863>>>d<<d;this.words[this.length-1]&=y}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.maskn=function(a){return this.clone().imaskn(a)},o.prototype.iaddn=function(a){return r(typeof a=="number"),r(a<67108864),a<0?this.isubn(-a):this.negative!==0?this.length===1&&(this.words[0]|0)<=a?(this.words[0]=a-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},o.prototype._iaddn=function(a){this.words[0]+=a;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},o.prototype.isubn=function(a){if(r(typeof a=="number"),r(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},o.prototype.addn=function(a){return this.clone().iaddn(a)},o.prototype.subn=function(a){return this.clone().isubn(a)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(a,d,b){var y=a.length+b,E;this._expand(y);var I,R=0;for(E=0;E<a.length;E++){I=(this.words[E+b]|0)+R;var p=(a.words[E]|0)*d;I-=p&67108863,R=(I>>26)-(p/67108864|0),this.words[E+b]=I&67108863}for(;E<this.length-b;E++)I=(this.words[E+b]|0)+R,R=I>>26,this.words[E+b]=I&67108863;if(R===0)return this._strip();for(r(R===-1),R=0,E=0;E<this.length;E++)I=-(this.words[E]|0)+R,R=I>>26,this.words[E]=I&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(a,d){var b=this.length-a.length,y=this.clone(),E=a,I=E.words[E.length-1]|0,R=this._countBits(I);b=26-R,b!==0&&(E=E.ushln(b),y.iushln(b),I=E.words[E.length-1]|0);var p=y.length-E.length,f;if(d!=="mod"){f=new o(null),f.length=p+1,f.words=new Array(f.length);for(var A=0;A<f.length;A++)f.words[A]=0}var B=y.clone()._ishlnsubmul(E,1,p);B.negative===0&&(y=B,f&&(f.words[p]=1));for(var l=p-1;l>=0;l--){var N=(y.words[E.length+l]|0)*67108864+(y.words[E.length+l-1]|0);for(N=Math.min(N/I|0,67108863),y._ishlnsubmul(E,N,l);y.negative!==0;)N--,y.negative=0,y._ishlnsubmul(E,1,l),y.isZero()||(y.negative^=1);f&&(f.words[l]=N)}return f&&f._strip(),y._strip(),d!=="div"&&b!==0&&y.iushrn(b),{div:f||null,mod:y}},o.prototype.divmod=function(a,d,b){if(r(!a.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var y,E,I;return this.negative!==0&&a.negative===0?(I=this.neg().divmod(a,d),d!=="mod"&&(y=I.div.neg()),d!=="div"&&(E=I.mod.neg(),b&&E.negative!==0&&E.iadd(a)),{div:y,mod:E}):this.negative===0&&a.negative!==0?(I=this.divmod(a.neg(),d),d!=="mod"&&(y=I.div.neg()),{div:y,mod:I.mod}):(this.negative&a.negative)!==0?(I=this.neg().divmod(a.neg(),d),d!=="div"&&(E=I.mod.neg(),b&&E.negative!==0&&E.isub(a)),{div:I.div,mod:E}):a.length>this.length||this.cmp(a)<0?{div:new o(0),mod:this}:a.length===1?d==="div"?{div:this.divn(a.words[0]),mod:null}:d==="mod"?{div:null,mod:new o(this.modrn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new o(this.modrn(a.words[0]))}:this._wordDiv(a,d)},o.prototype.div=function(a){return this.divmod(a,"div",!1).div},o.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},o.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},o.prototype.divRound=function(a){var d=this.divmod(a);if(d.mod.isZero())return d.div;var b=d.div.negative!==0?d.mod.isub(a):d.mod,y=a.ushrn(1),E=a.andln(1),I=b.cmp(y);return I<0||E===1&&I===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},o.prototype.modrn=function(a){var d=a<0;d&&(a=-a),r(a<=67108863);for(var b=(1<<26)%a,y=0,E=this.length-1;E>=0;E--)y=(b*y+(this.words[E]|0))%a;return d?-y:y},o.prototype.modn=function(a){return this.modrn(a)},o.prototype.idivn=function(a){var d=a<0;d&&(a=-a),r(a<=67108863);for(var b=0,y=this.length-1;y>=0;y--){var E=(this.words[y]|0)+b*67108864;this.words[y]=E/a|0,b=E%a}return this._strip(),d?this.ineg():this},o.prototype.divn=function(a){return this.clone().idivn(a)},o.prototype.egcd=function(a){r(a.negative===0),r(!a.isZero());var d=this,b=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var y=new o(1),E=new o(0),I=new o(0),R=new o(1),p=0;d.isEven()&&b.isEven();)d.iushrn(1),b.iushrn(1),++p;for(var f=b.clone(),A=d.clone();!d.isZero();){for(var B=0,l=1;(d.words[0]&l)===0&&B<26;++B,l<<=1);if(B>0)for(d.iushrn(B);B-- >0;)(y.isOdd()||E.isOdd())&&(y.iadd(f),E.isub(A)),y.iushrn(1),E.iushrn(1);for(var N=0,J=1;(b.words[0]&J)===0&&N<26;++N,J<<=1);if(N>0)for(b.iushrn(N);N-- >0;)(I.isOdd()||R.isOdd())&&(I.iadd(f),R.isub(A)),I.iushrn(1),R.iushrn(1);d.cmp(b)>=0?(d.isub(b),y.isub(I),E.isub(R)):(b.isub(d),I.isub(y),R.isub(E))}return{a:I,b:R,gcd:b.iushln(p)}},o.prototype._invmp=function(a){r(a.negative===0),r(!a.isZero());var d=this,b=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var y=new o(1),E=new o(0),I=b.clone();d.cmpn(1)>0&&b.cmpn(1)>0;){for(var R=0,p=1;(d.words[0]&p)===0&&R<26;++R,p<<=1);if(R>0)for(d.iushrn(R);R-- >0;)y.isOdd()&&y.iadd(I),y.iushrn(1);for(var f=0,A=1;(b.words[0]&A)===0&&f<26;++f,A<<=1);if(f>0)for(b.iushrn(f);f-- >0;)E.isOdd()&&E.iadd(I),E.iushrn(1);d.cmp(b)>=0?(d.isub(b),y.isub(E)):(b.isub(d),E.isub(y))}var B;return d.cmpn(1)===0?B=y:B=E,B.cmpn(0)<0&&B.iadd(a),B},o.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var d=this.clone(),b=a.clone();d.negative=0,b.negative=0;for(var y=0;d.isEven()&&b.isEven();y++)d.iushrn(1),b.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;b.isEven();)b.iushrn(1);var E=d.cmp(b);if(E<0){var I=d;d=b,b=I}else if(E===0||b.cmpn(1)===0)break;d.isub(b)}while(!0);return b.iushln(y)},o.prototype.invm=function(a){return this.egcd(a).a.umod(a)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(a){return this.words[0]&a},o.prototype.bincn=function(a){r(typeof a=="number");var d=a%26,b=(a-d)/26,y=1<<d;if(this.length<=b)return this._expand(b+1),this.words[b]|=y,this;for(var E=y,I=b;E!==0&&I<this.length;I++){var R=this.words[I]|0;R+=E,E=R>>>26,R&=67108863,this.words[I]=R}return E!==0&&(this.words[I]=E,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(a){var d=a<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var b;if(this.length>1)b=1;else{d&&(a=-a),r(a<=67108863,"Number is too big");var y=this.words[0]|0;b=y===a?0:y<a?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var d=this.ucmp(a);return this.negative!==0?-d|0:d},o.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var d=0,b=this.length-1;b>=0;b--){var y=this.words[b]|0,E=a.words[b]|0;if(y!==E){y<E?d=-1:y>E&&(d=1);break}}return d},o.prototype.gtn=function(a){return this.cmpn(a)===1},o.prototype.gt=function(a){return this.cmp(a)===1},o.prototype.gten=function(a){return this.cmpn(a)>=0},o.prototype.gte=function(a){return this.cmp(a)>=0},o.prototype.ltn=function(a){return this.cmpn(a)===-1},o.prototype.lt=function(a){return this.cmp(a)===-1},o.prototype.lten=function(a){return this.cmpn(a)<=0},o.prototype.lte=function(a){return this.cmp(a)<=0},o.prototype.eqn=function(a){return this.cmpn(a)===0},o.prototype.eq=function(a){return this.cmp(a)===0},o.red=function(a){return new ne(a)},o.prototype.toRed=function(a){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(a){return this.red=a,this},o.prototype.forceRed=function(a){return r(!this.red,"Already a number in reduction context"),this._forceRed(a)},o.prototype.redAdd=function(a){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},o.prototype.redIAdd=function(a){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},o.prototype.redSub=function(a){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},o.prototype.redISub=function(a){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},o.prototype.redShl=function(a){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},o.prototype.redMul=function(a){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},o.prototype.redIMul=function(a){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(a){return r(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var z={k256:null,p224:null,p192:null,p25519:null};function j(m,a){this.name=m,this.p=new o(a,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}j.prototype._tmp=function(){var a=new o(null);return a.words=new Array(Math.ceil(this.n/13)),a},j.prototype.ireduce=function(a){var d=a,b;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),b=d.bitLength();while(b>this.n);var y=b<this.n?-1:d.ucmp(this.p);return y===0?(d.words[0]=0,d.length=1):y>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},j.prototype.split=function(a,d){a.iushrn(this.n,0,d)},j.prototype.imulK=function(a){return a.imul(this.k)};function Y(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(Y,j),Y.prototype.split=function(a,d){for(var b=4194303,y=Math.min(a.length,9),E=0;E<y;E++)d.words[E]=a.words[E];if(d.length=y,a.length<=9){a.words[0]=0,a.length=1;return}var I=a.words[9];for(d.words[d.length++]=I&b,E=10;E<a.length;E++){var R=a.words[E]|0;a.words[E-10]=(R&b)<<4|I>>>22,I=R}I>>>=22,a.words[E-10]=I,I===0&&a.length>10?a.length-=10:a.length-=9},Y.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var d=0,b=0;b<a.length;b++){var y=a.words[b]|0;d+=y*977,a.words[b]=d&67108863,d=y*64+(d/67108864|0)}return a.words[a.length-1]===0&&(a.length--,a.words[a.length-1]===0&&a.length--),a};function X(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(X,j);function ie(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(ie,j);function se(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(se,j),se.prototype.imulK=function(a){for(var d=0,b=0;b<a.length;b++){var y=(a.words[b]|0)*19+d,E=y&67108863;y>>>=26,a.words[b]=E,d=y}return d!==0&&(a.words[a.length++]=d),a},o._prime=function(a){if(z[a])return z[a];var d;if(a==="k256")d=new Y;else if(a==="p224")d=new X;else if(a==="p192")d=new ie;else if(a==="p25519")d=new se;else throw new Error("Unknown prime "+a);return z[a]=d,d};function ne(m){if(typeof m=="string"){var a=o._prime(m);this.m=a.p,this.prime=a}else r(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}ne.prototype._verify1=function(a){r(a.negative===0,"red works only with positives"),r(a.red,"red works only with red numbers")},ne.prototype._verify2=function(a,d){r((a.negative|d.negative)===0,"red works only with positives"),r(a.red&&a.red===d.red,"red works only with red numbers")},ne.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):(w(a,a.umod(this.m)._forceRed(this)),a)},ne.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},ne.prototype.add=function(a,d){this._verify2(a,d);var b=a.add(d);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},ne.prototype.iadd=function(a,d){this._verify2(a,d);var b=a.iadd(d);return b.cmp(this.m)>=0&&b.isub(this.m),b},ne.prototype.sub=function(a,d){this._verify2(a,d);var b=a.sub(d);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},ne.prototype.isub=function(a,d){this._verify2(a,d);var b=a.isub(d);return b.cmpn(0)<0&&b.iadd(this.m),b},ne.prototype.shl=function(a,d){return this._verify1(a),this.imod(a.ushln(d))},ne.prototype.imul=function(a,d){return this._verify2(a,d),this.imod(a.imul(d))},ne.prototype.mul=function(a,d){return this._verify2(a,d),this.imod(a.mul(d))},ne.prototype.isqr=function(a){return this.imul(a,a.clone())},ne.prototype.sqr=function(a){return this.mul(a,a)},ne.prototype.sqrt=function(a){if(a.isZero())return a.clone();var d=this.m.andln(3);if(r(d%2===1),d===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(a,b)}for(var y=this.m.subn(1),E=0;!y.isZero()&&y.andln(1)===0;)E++,y.iushrn(1);r(!y.isZero());var I=new o(1).toRed(this),R=I.redNeg(),p=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);this.pow(f,p).cmp(R)!==0;)f.redIAdd(R);for(var A=this.pow(f,y),B=this.pow(a,y.addn(1).iushrn(1)),l=this.pow(a,y),N=E;l.cmp(I)!==0;){for(var J=l,K=0;J.cmp(I)!==0;K++)J=J.redSqr();r(K<N);var W=this.pow(A,new o(1).iushln(N-K-1));B=B.redMul(W),A=W.redSqr(),l=l.redMul(A),N=K}return B},ne.prototype.invm=function(a){var d=a._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},ne.prototype.pow=function(a,d){if(d.isZero())return new o(1).toRed(this);if(d.cmpn(1)===0)return a.clone();var b=4,y=new Array(1<<b);y[0]=new o(1).toRed(this),y[1]=a;for(var E=2;E<y.length;E++)y[E]=this.mul(y[E-1],a);var I=y[0],R=0,p=0,f=d.bitLength()%26;for(f===0&&(f=26),E=d.length-1;E>=0;E--){for(var A=d.words[E],B=f-1;B>=0;B--){var l=A>>B&1;if(I!==y[0]&&(I=this.sqr(I)),l===0&&R===0){p=0;continue}R<<=1,R|=l,p++,!(p!==b&&(E!==0||B!==0))&&(I=this.mul(I,y[R]),p=0,R=0)}f=26}return I},ne.prototype.convertTo=function(a){var d=a.umod(this.m);return d===a?d.clone():d},ne.prototype.convertFrom=function(a){var d=a.clone();return d.red=null,d},o.mont=function(a){return new P(a)};function P(m){ne.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(P,ne),P.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},P.prototype.convertFrom=function(a){var d=this.imod(a.mul(this.rinv));return d.red=null,d},P.prototype.imul=function(a,d){if(a.isZero()||d.isZero())return a.words[0]=0,a.length=1,a;var b=a.imul(d),y=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=b.isub(y).iushrn(this.shift),I=E;return E.cmp(this.m)>=0?I=E.isub(this.m):E.cmpn(0)<0&&(I=E.iadd(this.m)),I._forceRed(this)},P.prototype.mul=function(a,d){if(a.isZero()||d.isZero())return new o(0)._forceRed(this);var b=a.mul(d),y=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=b.isub(y).iushrn(this.shift),I=E;return E.cmp(this.m)>=0?I=E.isub(this.m):E.cmpn(0)<0&&(I=E.iadd(this.m)),I._forceRed(this)},P.prototype.invm=function(a){var d=this.imod(a._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(n,Ia)})(Ln)),Ln.exports}var Ca=ka();const de=sn(Ca),Na="logger/5.8.0";let Oo=!1,Do=!1;const Gn={debug:1,default:2,info:2,warning:3,error:4,off:5};let Uo=Gn.default,Ii=null;function Ra(){try{const n=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{n.push(e)}}),n.length)throw new Error("missing "+n.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(n){return n.message}return null}const Lo=Ra();var ro;(function(n){n.DEBUG="DEBUG",n.INFO="INFO",n.WARNING="WARNING",n.ERROR="ERROR",n.OFF="OFF"})(ro||(ro={}));var Ht;(function(n){n.UNKNOWN_ERROR="UNKNOWN_ERROR",n.NOT_IMPLEMENTED="NOT_IMPLEMENTED",n.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",n.NETWORK_ERROR="NETWORK_ERROR",n.SERVER_ERROR="SERVER_ERROR",n.TIMEOUT="TIMEOUT",n.BUFFER_OVERRUN="BUFFER_OVERRUN",n.NUMERIC_FAULT="NUMERIC_FAULT",n.MISSING_NEW="MISSING_NEW",n.INVALID_ARGUMENT="INVALID_ARGUMENT",n.MISSING_ARGUMENT="MISSING_ARGUMENT",n.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",n.CALL_EXCEPTION="CALL_EXCEPTION",n.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",n.NONCE_EXPIRED="NONCE_EXPIRED",n.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",n.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",n.TRANSACTION_REPLACED="TRANSACTION_REPLACED",n.ACTION_REJECTED="ACTION_REJECTED"})(Ht||(Ht={}));const Go="0123456789abcdef";class O{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();Gn[r]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Uo>Gn[r])&&console.log.apply(console,t)}debug(...e){this._log(O.levels.DEBUG,e)}info(...e){this._log(O.levels.INFO,e)}warn(...e){this._log(O.levels.WARNING,e)}makeError(e,t,r){if(Do)return this.makeError("censored error",t,{});t||(t=O.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach(x=>{const g=r[x];try{if(g instanceof Uint8Array){let w="";for(let M=0;M<g.length;M++)w+=Go[g[M]>>4],w+=Go[g[M]&15];i.push(x+"=Uint8Array(0x"+w+")")}else i.push(x+"="+JSON.stringify(g))}catch{i.push(x+"="+JSON.stringify(r[x].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);const o=e;let s="";switch(t){case Ht.NUMERIC_FAULT:{s="NUMERIC_FAULT";const x=e;switch(x){case"overflow":case"underflow":case"division-by-zero":s+="-"+x;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case Ht.CALL_EXCEPTION:case Ht.INSUFFICIENT_FUNDS:case Ht.MISSING_NEW:case Ht.NONCE_EXPIRED:case Ht.REPLACEMENT_UNDERPRICED:case Ht.TRANSACTION_REPLACED:case Ht.UNPREDICTABLE_GAS_LIMIT:s=t;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const c=new Error(e);return c.reason=o,c.code=t,Object.keys(r).forEach(function(x){c[x]=r[x]}),c}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,O.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,i){e||this.throwError(t,r,i)}assertArgument(e,t,r,i){e||this.throwArgumentError(t,r,i)}checkNormalize(e){Lo&&this.throwError("platform missing String.prototype.normalize",O.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Lo})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r?r=": "+r:r="",e<t&&this.throwError("missing argument"+r,O.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,O.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",O.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Ii||(Ii=new O(Na)),Ii}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Oo){if(!e)return;this.globalLogger().throwError("error censorship permanent",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Do=!!e,Oo=!!t}static setLogLevel(e){const t=Gn[e.toLowerCase()];if(t==null){O.globalLogger().warn("invalid log level - "+e);return}Uo=t}static from(e){return new O(e)}}O.errors=Ht;O.levels=ro;const Ba="bytes/5.8.0",tt=new O(Ba);function es(n){return!!n.toHexString}function $r(n){return n.slice||(n.slice=function(){const e=Array.prototype.slice.call(arguments);return $r(new Uint8Array(Array.prototype.slice.apply(n,e)))}),n}function Pn(n){return ve(n)&&!(n.length%2)||Ur(n)}function qo(n){return typeof n=="number"&&n==n&&n%1===0}function Ur(n){if(n==null)return!1;if(n.constructor===Uint8Array)return!0;if(typeof n=="string"||!qo(n.length)||n.length<0)return!1;for(let e=0;e<n.length;e++){const t=n[e];if(!qo(t)||t<0||t>=256)return!1}return!0}function Z(n,e){if(e||(e={}),typeof n=="number"){tt.checkSafeUint53(n,"invalid arrayify value");const t=[];for(;n;)t.unshift(n&255),n=parseInt(String(n/256));return t.length===0&&t.push(0),$r(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof n=="string"&&n.substring(0,2)!=="0x"&&(n="0x"+n),es(n)&&(n=n.toHexString()),ve(n)){let t=n.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":tt.throwArgumentError("hex data is odd-length","value",n));const r=[];for(let i=0;i<t.length;i+=2)r.push(parseInt(t.substring(i,i+2),16));return $r(new Uint8Array(r))}return Ur(n)?$r(new Uint8Array(n)):tt.throwArgumentError("invalid arrayify value","value",n)}function rt(n){const e=n.map(i=>Z(i)),t=e.reduce((i,o)=>i+o.length,0),r=new Uint8Array(t);return e.reduce((i,o)=>(r.set(o,i),i+o.length),0),$r(r)}function or(n){let e=Z(n);if(e.length===0)return e;let t=0;for(;t<e.length&&e[t]===0;)t++;return t&&(e=e.slice(t)),e}function ts(n,e){n=Z(n),n.length>e&&tt.throwArgumentError("value out of range","value",arguments[0]);const t=new Uint8Array(e);return t.set(n,e-n.length),$r(t)}function ve(n,e){return!(typeof n!="string"||!n.match(/^0x[0-9A-Fa-f]*$/)||e&&n.length!==2+2*e)}const ki="0123456789abcdef";function re(n,e){if(e||(e={}),typeof n=="number"){tt.checkSafeUint53(n,"invalid hexlify value");let t="";for(;n;)t=ki[n&15]+t,n=Math.floor(n/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if(typeof n=="bigint")return n=n.toString(16),n.length%2?"0x0"+n:"0x"+n;if(e.allowMissingPrefix&&typeof n=="string"&&n.substring(0,2)!=="0x"&&(n="0x"+n),es(n))return n.toHexString();if(ve(n))return n.length%2&&(e.hexPad==="left"?n="0x0"+n.substring(2):e.hexPad==="right"?n+="0":tt.throwArgumentError("hex data is odd-length","value",n)),n.toLowerCase();if(Ur(n)){let t="0x";for(let r=0;r<n.length;r++){let i=n[r];t+=ki[(i&240)>>4]+ki[i&15]}return t}return tt.throwArgumentError("invalid hexlify value","value",n)}function Pr(n){if(typeof n!="string")n=re(n);else if(!ve(n)||n.length%2)return null;return(n.length-2)/2}function ft(n,e,t){return typeof n!="string"?n=re(n):(!ve(n)||n.length%2)&&tt.throwArgumentError("invalid hexData","value",n),e=2+2*e,t!=null?"0x"+n.substring(e,2+2*t):"0x"+n.substring(e)}function At(n){let e="0x";return n.forEach(t=>{e+=re(t).substring(2)}),e}function ii(n){const e=rs(re(n,{hexPad:"left"}));return e==="0x"?"0x0":e}function rs(n){typeof n!="string"&&(n=re(n)),ve(n)||tt.throwArgumentError("invalid hex string","value",n),n=n.substring(2);let e=0;for(;e<n.length&&n[e]==="0";)e++;return"0x"+n.substring(e)}function We(n,e){for(typeof n!="string"?n=re(n):ve(n)||tt.throwArgumentError("invalid hex string","value",n),n.length>2*e+2&&tt.throwArgumentError("value out of range","value",arguments[1]);n.length<2*e+2;)n="0x0"+n.substring(2);return n}function Lr(n){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Pn(n)){let t=Z(n);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=re(t.slice(0,32)),e.s=re(t.slice(32,64))):t.length===65?(e.r=re(t.slice(0,32)),e.s=re(t.slice(32,64)),e.v=t[64]):tt.throwArgumentError("invalid signature string","signature",n),e.v<27&&(e.v===0||e.v===1?e.v+=27:tt.throwArgumentError("signature invalid v byte","signature",n)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=re(t.slice(32,64))}else{if(e.r=n.r,e.s=n.s,e.v=n.v,e.recoveryParam=n.recoveryParam,e._vs=n._vs,e._vs!=null){const i=ts(Z(e._vs),32);e._vs=re(i);const o=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=o:e.recoveryParam!==o&&tt.throwArgumentError("signature recoveryParam mismatch _vs","signature",n),i[0]&=127;const s=re(i);e.s==null?e.s=s:e.s!==s&&tt.throwArgumentError("signature v mismatch _vs","signature",n)}if(e.recoveryParam==null)e.v==null?tt.throwArgumentError("signature missing v and recoveryParam","signature",n):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&tt.throwArgumentError("signature recoveryParam mismatch v","signature",n)}e.r==null||!ve(e.r)?tt.throwArgumentError("signature missing or invalid r","signature",n):e.r=We(e.r,32),e.s==null||!ve(e.s)?tt.throwArgumentError("signature missing or invalid s","signature",n):e.s=We(e.s,32);const t=Z(e.s);t[0]>=128&&tt.throwArgumentError("signature s out of range","signature",n),e.recoveryParam&&(t[0]|=128);const r=re(t);e._vs&&(ve(e._vs)||tt.throwArgumentError("signature invalid _vs","signature",n),e._vs=We(e._vs,32)),e._vs==null?e._vs=r:e._vs!==r&&tt.throwArgumentError("signature _vs mismatch v and s","signature",n)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function no(n){return n=Lr(n),re(rt([n.r,n.s,n.recoveryParam?"0x1c":"0x1b"]))}const ns="bignumber/5.8.0";var jn=de.BN;const ur=new O(ns),Ci={},zo=9007199254740991;function Ta(n){return n!=null&&(ee.isBigNumber(n)||typeof n=="number"&&n%1===0||typeof n=="string"&&!!n.match(/^-?[0-9]+$/)||ve(n)||typeof n=="bigint"||Ur(n))}let Ho=!1;class ee{constructor(e,t){e!==Ci&&ur.throwError("cannot call constructor directly; use BigNumber.from",O.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return St(me(this).fromTwos(e))}toTwos(e){return St(me(this).toTwos(e))}abs(){return this._hex[0]==="-"?ee.from(this._hex.substring(1)):this}add(e){return St(me(this).add(me(e)))}sub(e){return St(me(this).sub(me(e)))}div(e){return ee.from(e).isZero()&&Rt("division-by-zero","div"),St(me(this).div(me(e)))}mul(e){return St(me(this).mul(me(e)))}mod(e){const t=me(e);return t.isNeg()&&Rt("division-by-zero","mod"),St(me(this).umod(t))}pow(e){const t=me(e);return t.isNeg()&&Rt("negative-power","pow"),St(me(this).pow(t))}and(e){const t=me(e);return(this.isNegative()||t.isNeg())&&Rt("unbound-bitwise-result","and"),St(me(this).and(t))}or(e){const t=me(e);return(this.isNegative()||t.isNeg())&&Rt("unbound-bitwise-result","or"),St(me(this).or(t))}xor(e){const t=me(e);return(this.isNegative()||t.isNeg())&&Rt("unbound-bitwise-result","xor"),St(me(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Rt("negative-width","mask"),St(me(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Rt("negative-width","shl"),St(me(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Rt("negative-width","shr"),St(me(this).shrn(e))}eq(e){return me(this).eq(me(e))}lt(e){return me(this).lt(me(e))}lte(e){return me(this).lte(me(e))}gt(e){return me(this).gt(me(e))}gte(e){return me(this).gte(me(e))}isNegative(){return this._hex[0]==="-"}isZero(){return me(this).isZero()}toNumber(){try{return me(this).toNumber()}catch{Rt("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return ur.throwError("this platform does not support BigInt",O.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Ho||(Ho=!0,ur.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?ur.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",O.errors.UNEXPECTED_ARGUMENT,{}):ur.throwError("BigNumber.toString does not accept parameters",O.errors.UNEXPECTED_ARGUMENT,{})),me(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof ee)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new ee(Ci,yn(e)):e.match(/^-?[0-9]+$/)?new ee(Ci,yn(new jn(e))):ur.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Rt("underflow","BigNumber.from",e),(e>=zo||e<=-zo)&&Rt("overflow","BigNumber.from",e),ee.from(String(e));const t=e;if(typeof t=="bigint")return ee.from(t.toString());if(Ur(t))return ee.from(re(t));if(t)if(t.toHexString){const r=t.toHexString();if(typeof r=="string")return ee.from(r)}else{let r=t._hex;if(r==null&&t.type==="BigNumber"&&(r=t.hex),typeof r=="string"&&(ve(r)||r[0]==="-"&&ve(r.substring(1))))return ee.from(r)}return ur.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function yn(n){if(typeof n!="string")return yn(n.toString(16));if(n[0]==="-")return n=n.substring(1),n[0]==="-"&&ur.throwArgumentError("invalid hex","value",n),n=yn(n),n==="0x00"?n:"-"+n;if(n.substring(0,2)!=="0x"&&(n="0x"+n),n==="0x")return"0x00";for(n.length%2&&(n="0x0"+n.substring(2));n.length>4&&n.substring(0,4)==="0x00";)n="0x"+n.substring(4);return n}function St(n){return ee.from(yn(n))}function me(n){const e=ee.from(n).toHexString();return e[0]==="-"?new jn("-"+e.substring(3),16):new jn(e.substring(2),16)}function Rt(n,e,t){const r={fault:n,operation:e};return t!=null&&(r.value=t),ur.throwError(n,O.errors.NUMERIC_FAULT,r)}function Fa(n){return new jn(n,36).toString(16)}const Et=new O(ns),xn={},is=ee.from(0),os=ee.from(-1);function ss(n,e,t,r){const i={fault:e,operation:t};return r!==void 0&&(i.value=r),Et.throwError(n,O.errors.NUMERIC_FAULT,i)}let pn="0";for(;pn.length<256;)pn+=pn;function xo(n){if(typeof n!="number")try{n=ee.from(n).toNumber()}catch{}return typeof n=="number"&&n>=0&&n<=256&&!(n%1)?"1"+pn.substring(0,n):Et.throwArgumentError("invalid decimal size","decimals",n)}function qn(n,e){e==null&&(e=0);const t=xo(e);n=ee.from(n);const r=n.lt(is);r&&(n=n.mul(os));let i=n.mod(t).toString();for(;i.length<t.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=n.div(t).toString();return t.length===1?n=o:n=o+"."+i,r&&(n="-"+n),n}function Zt(n,e){e==null&&(e=0);const t=xo(e);(typeof n!="string"||!n.match(/^-?[0-9.]+$/))&&Et.throwArgumentError("invalid decimal value","value",n);const r=n.substring(0,1)==="-";r&&(n=n.substring(1)),n==="."&&Et.throwArgumentError("missing value","value",n);const i=n.split(".");i.length>2&&Et.throwArgumentError("too many decimal points","value",n);let o=i[0],s=i[1];for(o||(o="0"),s||(s="0");s[s.length-1]==="0";)s=s.substring(0,s.length-1);for(s.length>t.length-1&&ss("fractional component exceeds decimals","underflow","parseFixed"),s===""&&(s="0");s.length<t.length-1;)s+="0";const c=ee.from(o),x=ee.from(s);let g=c.mul(t).add(x);return r&&(g=g.mul(os)),g}class en{constructor(e,t,r,i){e!==xn&&Et.throwError("cannot use FixedFormat constructor; use FixedFormat.from",O.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=i,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(i),this._multiplier=xo(i),Object.freeze(this)}static from(e){if(e instanceof en)return e;typeof e=="number"&&(e=`fixed128x${e}`);let t=!0,r=128,i=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")t=!1;else{const o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||Et.throwArgumentError("invalid fixed format","format",e),t=o[1]!=="u",r=parseInt(o[2]),i=parseInt(o[3])}}else if(e){const o=(s,c,x)=>e[s]==null?x:(typeof e[s]!==c&&Et.throwArgumentError("invalid fixed format ("+s+" not "+c+")","format."+s,e[s]),e[s]);t=o("signed","boolean",t),r=o("width","number",r),i=o("decimals","number",i)}return r%8&&Et.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&Et.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new en(xn,t,r,i)}}class dt{constructor(e,t,r,i){e!==xn&&Et.throwError("cannot use FixedNumber constructor; use FixedNumber.from",O.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Et.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=Zt(this._value,this.format.decimals),r=Zt(e._value,e.format.decimals);return dt.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=Zt(this._value,this.format.decimals),r=Zt(e._value,e.format.decimals);return dt.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=Zt(this._value,this.format.decimals),r=Zt(e._value,e.format.decimals);return dt.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=Zt(this._value,this.format.decimals),r=Zt(e._value,e.format.decimals);return dt.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=dt.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(Ko.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=dt.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(Ko.toFormat(t.format))),t}round(e){e==null&&(e=0);const t=this.toString().split(".");if(t.length===1&&t.push("0"),(e<0||e>80||e%1)&&Et.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=dt.from("1"+pn.substring(0,e),this.format),i=Oa.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Et.throwArgumentError("invalid byte width","width",e);const t=ee.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return We(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return dt.fromString(this._value,e)}static fromValue(e,t,r){return r==null&&t!=null&&!Ta(t)&&(r=t,t=null),t==null&&(t=0),r==null&&(r="fixed"),dt.fromString(qn(e,t),en.from(r))}static fromString(e,t){t==null&&(t="fixed");const r=en.from(t),i=Zt(e,r.decimals);!r.signed&&i.lt(is)&&ss("unsigned value cannot be negative","overflow","value",e);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=We(o,r.width/8));const s=qn(i,r.decimals);return new dt(xn,o,s,r)}static fromBytes(e,t){t==null&&(t="fixed");const r=en.from(t);if(Z(e).length>r.width/8)throw new Error("overflow");let i=ee.from(e);r.signed&&(i=i.fromTwos(r.width));const o=i.toTwos((r.signed?0:1)+r.width).toHexString(),s=qn(i,r.decimals);return new dt(xn,o,s,r)}static from(e,t){if(typeof e=="string")return dt.fromString(e,t);if(Ur(e))return dt.fromBytes(e,t);try{return dt.fromValue(e,0,t)}catch(r){if(r.code!==O.errors.INVALID_ARGUMENT)throw r}return Et.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const Ko=dt.from(1),Oa=dt.from("0.5"),Da="properties/5.8.0";var Ua=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const Qn=new O(Da);function Q(n,e,t){Object.defineProperty(n,e,{enumerable:!0,value:t,writable:!1})}function Wt(n,e){for(let t=0;t<32;t++){if(n[e])return n[e];if(!n.prototype||typeof n.prototype!="object")break;n=Object.getPrototypeOf(n.prototype).constructor}return null}function Te(n){return Ua(this,void 0,void 0,function*(){const e=Object.keys(n).map(r=>{const i=n[r];return Promise.resolve(i).then(o=>({key:r,value:o}))});return(yield Promise.all(e)).reduce((r,i)=>(r[i.key]=i.value,r),{})})}function po(n,e){(!n||typeof n!="object")&&Qn.throwArgumentError("invalid object","object",n),Object.keys(n).forEach(t=>{e[t]||Qn.throwArgumentError("invalid object key - "+t,"transaction:"+t,n)})}function nt(n){const e={};for(const t in n)e[t]=n[t];return e}const La={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function as(n){if(n==null||La[typeof n])return!0;if(Array.isArray(n)||typeof n=="object"){if(!Object.isFrozen(n))return!1;const e=Object.keys(n);for(let t=0;t<e.length;t++){let r=null;try{r=n[e[t]]}catch{continue}if(!as(r))return!1}return!0}return Qn.throwArgumentError(`Cannot deepCopy ${typeof n}`,"object",n)}function Ga(n){if(as(n))return n;if(Array.isArray(n))return Object.freeze(n.map(e=>sr(e)));if(typeof n=="object"){const e={};for(const t in n){const r=n[t];r!==void 0&&Q(e,t,sr(r))}return e}return Qn.throwArgumentError(`Cannot deepCopy ${typeof n}`,"object",n)}function sr(n){return Ga(n)}class Gr{constructor(e){for(const t in e)this[t]=sr(e[t])}}const Mn="abi/5.8.0",ye=new O(Mn),Or={};let Jo={calldata:!0,memory:!0,storage:!0},qa={calldata:!0,memory:!0};function Rn(n,e){if(n==="bytes"||n==="string"){if(Jo[e])return!0}else if(n==="address"){if(e==="payable")return!0}else if((n.indexOf("[")>=0||n==="tuple")&&qa[e])return!0;return(Jo[e]||e==="payable")&&ye.throwArgumentError("invalid modifier","name",e),!1}function za(n,e){let t=n;function r(c){ye.throwArgumentError(`unexpected character at position ${c}`,"param",n)}n=n.replace(/\s/g," ");function i(c){let x={type:"",name:"",parent:c,state:{allowType:!0}};return e&&(x.indexed=!1),x}let o={type:"",name:"",state:{allowType:!0}},s=o;for(let c=0;c<n.length;c++){let x=n[c];switch(x){case"(":s.state.allowType&&s.type===""?s.type="tuple":s.state.allowParams||r(c),s.state.allowType=!1,s.type=Vr(s.type),s.components=[i(s)],s=s.components[0];break;case")":delete s.state,s.name==="indexed"&&(e||r(c),s.indexed=!0,s.name=""),Rn(s.type,s.name)&&(s.name=""),s.type=Vr(s.type);let g=s;s=s.parent,s||r(c),delete g.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,s.name==="indexed"&&(e||r(c),s.indexed=!0,s.name=""),Rn(s.type,s.name)&&(s.name=""),s.type=Vr(s.type);let w=i(s.parent);s.parent.components.push(w),delete s.parent,s=w;break;case" ":s.state.allowType&&s.type!==""&&(s.type=Vr(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&s.name!==""&&(s.name==="indexed"?(e||r(c),s.indexed&&r(c),s.indexed=!0,s.name=""):Rn(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||r(c),s.type+=x,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||r(c),s.type+=x,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=x,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=x,delete s.state.allowArray):s.state.readArray?s.type+=x:r(c)}}return s.parent&&ye.throwArgumentError("unexpected eof","param",n),delete o.state,s.name==="indexed"?(e||r(t.length-7),s.indexed&&r(t.length-7),s.indexed=!0,s.name=""):Rn(s.type,s.name)&&(s.name=""),o.type=Vr(o.type),o}function zn(n,e){for(let t in e)Q(n,t,e[t])}const Ee=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Ha=new RegExp(/^(.*)\[([0-9]*)\]$/);class ct{constructor(e,t){e!==Or&&ye.throwError("use fromString",O.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),zn(this,t);let r=this.type.match(Ha);r?zn(this,{arrayLength:parseInt(r[2]||"-1"),arrayChildren:ct.fromObject({type:r[1],components:this.components}),baseType:"array"}):zn(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Ee.sighash),Ee[e]||ye.throwArgumentError("invalid format type","format",e),e===Ee.json){let r={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(r.indexed=this.indexed),this.components&&(r.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(r)}let t="";return this.baseType==="array"?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==Ee.sighash&&(t+=this.type),t+="("+this.components.map(r=>r.format(e)).join(e===Ee.full?", ":",")+")"):t+=this.type,e!==Ee.sighash&&(this.indexed===!0&&(t+=" indexed"),e===Ee.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return typeof e=="string"?ct.fromString(e,t):ct.fromObject(e)}static fromObject(e){return ct.isParamType(e)?e:new ct(Or,{name:e.name||null,type:Vr(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(ct.fromObject):null})}static fromString(e,t){function r(i){return ct.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return r(za(e,!!t))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function vn(n,e){return Ja(n).map(t=>ct.fromString(t,e))}class nr{constructor(e,t){e!==Or&&ye.throwError("use a static from method",O.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),zn(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return nr.isFragment(e)?e:typeof e=="string"?nr.fromString(e):nr.fromObject(e)}static fromObject(e){if(nr.isFragment(e))return e;switch(e.type){case"function":return Vt.fromObject(e);case"event":return rr.fromObject(e);case"constructor":return Jt.fromObject(e);case"error":return lr.fromObject(e);case"fallback":case"receive":return null}return ye.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?rr.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Vt.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Jt.fromString(e.trim()):e.split(" ")[0]==="error"?lr.fromString(e.substring(5).trim()):ye.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class rr extends nr{format(e){if(e||(e=Ee.sighash),Ee[e]||ye.throwArgumentError("invalid format type","format",e),e===Ee.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});let t="";return e!==Ee.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map(r=>r.format(e)).join(e===Ee.full?", ":",")+") ",e!==Ee.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return typeof e=="string"?rr.fromString(e):rr.fromObject(e)}static fromObject(e){if(rr.isEventFragment(e))return e;e.type!=="event"&&ye.throwArgumentError("invalid event object","value",e);const t={name:wn(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(ct.fromObject):[],type:"event"};return new rr(Or,t)}static fromString(e){let t=e.match(An);t||ye.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":r=!0;break;case"":break;default:ye.warn("unknown modifier: "+i)}}),rr.fromObject({name:t[1].trim(),anonymous:r,inputs:vn(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function fs(n,e){e.gas=null;let t=n.split("@");return t.length!==1?(t.length>2&&ye.throwArgumentError("invalid human-readable ABI signature","value",n),t[1].match(/^[0-9]+$/)||ye.throwArgumentError("invalid human-readable ABI signature gas","value",n),e.gas=ee.from(t[1]),t[0]):n}function cs(n,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",n.split(" ").forEach(t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}})}function us(n){let e={constant:!1,payable:!0,stateMutability:"payable"};return n.stateMutability!=null?(e.stateMutability=n.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",n.constant!=null&&!!n.constant!==e.constant&&ye.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",n),e.payable=e.stateMutability==="payable",n.payable!=null&&!!n.payable!==e.payable&&ye.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",n)):n.payable!=null?(e.payable=!!n.payable,n.constant==null&&!e.payable&&n.type!=="constructor"&&ye.throwArgumentError("unable to determine stateMutability","value",n),e.constant=!!n.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&ye.throwArgumentError("cannot have constant payable function","value",n)):n.constant!=null?(e.constant=!!n.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):n.type!=="constructor"&&ye.throwArgumentError("unable to determine stateMutability","value",n),e}class Jt extends nr{format(e){if(e||(e=Ee.sighash),Ee[e]||ye.throwArgumentError("invalid format type","format",e),e===Ee.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});e===Ee.sighash&&ye.throwError("cannot format a constructor for sighash",O.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map(r=>r.format(e)).join(e===Ee.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(t+=this.stateMutability+" "),t.trim()}static from(e){return typeof e=="string"?Jt.fromString(e):Jt.fromObject(e)}static fromObject(e){if(Jt.isConstructorFragment(e))return e;e.type!=="constructor"&&ye.throwArgumentError("invalid constructor object","value",e);let t=us(e);t.constant&&ye.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(ct.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ee.from(e.gas):null};return new Jt(Or,r)}static fromString(e){let t={type:"constructor"};e=fs(e,t);let r=e.match(An);return(!r||r[1].trim()!=="constructor")&&ye.throwArgumentError("invalid constructor string","value",e),t.inputs=vn(r[2].trim(),!1),cs(r[3].trim(),t),Jt.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Vt extends Jt{format(e){if(e||(e=Ee.sighash),Ee[e]||ye.throwArgumentError("invalid format type","format",e),e===Ee.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(e))),outputs:this.outputs.map(r=>JSON.parse(r.format(e)))});let t="";return e!==Ee.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map(r=>r.format(e)).join(e===Ee.full?", ":",")+") ",e!==Ee.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map(r=>r.format(e)).join(", ")+") "),this.gas!=null&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return typeof e=="string"?Vt.fromString(e):Vt.fromObject(e)}static fromObject(e){if(Vt.isFunctionFragment(e))return e;e.type!=="function"&&ye.throwArgumentError("invalid function object","value",e);let t=us(e);const r={type:e.type,name:wn(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(ct.fromObject):[],outputs:e.outputs?e.outputs.map(ct.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ee.from(e.gas):null};return new Vt(Or,r)}static fromString(e){let t={type:"function"};e=fs(e,t);let r=e.split(" returns ");r.length>2&&ye.throwArgumentError("invalid function string","value",e);let i=r[0].match(An);if(i||ye.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&wn(t.name),t.inputs=vn(i[2],!1),cs(i[3].trim(),t),r.length>1){let o=r[1].match(An);(o[1].trim()!=""||o[3].trim()!="")&&ye.throwArgumentError("unexpected tokens","value",e),t.outputs=vn(o[2],!1)}else t.outputs=[];return Vt.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function Vo(n){const e=n.format();return(e==="Error(string)"||e==="Panic(uint256)")&&ye.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",n),n}class lr extends nr{format(e){if(e||(e=Ee.sighash),Ee[e]||ye.throwArgumentError("invalid format type","format",e),e===Ee.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});let t="";return e!==Ee.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map(r=>r.format(e)).join(e===Ee.full?", ":",")+") ",t.trim()}static from(e){return typeof e=="string"?lr.fromString(e):lr.fromObject(e)}static fromObject(e){if(lr.isErrorFragment(e))return e;e.type!=="error"&&ye.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:wn(e.name),inputs:e.inputs?e.inputs.map(ct.fromObject):[]};return Vo(new lr(Or,t))}static fromString(e){let t={type:"error"},r=e.match(An);return r||ye.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&wn(t.name),t.inputs=vn(r[2],!1),Vo(lr.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Vr(n){return n.match(/^uint($|[^1-9])/)?n="uint256"+n.substring(4):n.match(/^int($|[^1-9])/)&&(n="int256"+n.substring(3)),n}const Ka=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function wn(n){return(!n||!n.match(Ka))&&ye.throwArgumentError(`invalid identifier "${n}"`,"value",n),n}const An=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Ja(n){n=n.trim();let e=[],t="",r=0;for(let i=0;i<n.length;i++){let o=n[i];o===","&&r===0?(e.push(t),t=""):(t+=o,o==="("?r++:o===")"&&(r--,r===-1&&ye.throwArgumentError("unbalanced parenthesis","value",n)))}return t&&e.push(t),e}const bo=new O(Mn);function hs(n){const e=[],t=function(r,i){if(Array.isArray(i))for(let o in i){const s=r.slice();s.push(o);try{t(s,i[o])}catch(c){e.push({path:s,error:c})}}};return t([],n),e}class br{constructor(e,t,r,i){this.name=e,this.type=t,this.localName=r,this.dynamic=i}_throwError(e,t){bo.throwArgumentError(e,this.localName,t)}}class io{constructor(e){Q(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return At(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(rt(e._data))}writeBytes(e){let t=Z(e);const r=t.length%this.wordSize;return r&&(t=rt([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Z(ee.from(e));return t.length>this.wordSize&&bo.throwError("value out-of-bounds",O.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=rt([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class Yn{constructor(e,t,r,i){Q(this,"_data",Z(e)),Q(this,"wordSize",t||32),Q(this,"_coerceFunc",r),Q(this,"allowLoose",i),this._offset=0}get data(){return re(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):Yn.coerce(e,t)}_peekBytes(e,t,r){let i=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?i=t:bo.throwError("data out-of-bounds",O.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new Yn(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return ee.from(this.readBytes(this.wordSize))}}var Ni={exports:{}},Wo;function Va(){return Wo||(Wo=1,(function(n){(function(){var e="input is invalid type",t="finalize already called",r=typeof window=="object",i=r?window:{};i.JS_SHA3_NO_WINDOW&&(r=!1);var o=!r&&typeof self=="object",s=!i.JS_SHA3_NO_NODE_JS&&typeof Pi=="object"&&Pi.versions&&Pi.versions.node;s?i=Aa:o&&(i=self);var c=!i.JS_SHA3_NO_COMMON_JS&&!0&&n.exports,x=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",g="0123456789abcdef".split(""),w=[31,7936,2031616,520093696],M=[4,1024,262144,67108864],C=[1,256,65536,16777216],G=[6,1536,393216,100663296],H=[0,8,16,24],k=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],S=[224,256,384,512],T=[128,256],D=["hex","buffer","arrayBuffer","array","digest"],U={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(l){return Object.prototype.toString.call(l)==="[object Array]"}),x&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(l){return typeof l=="object"&&l.buffer&&l.buffer.constructor===ArrayBuffer});for(var q=function(l,N,J){return function(K){return new f(l,N,l).update(K)[J]()}},z=function(l,N,J){return function(K,W){return new f(l,N,W).update(K)[J]()}},j=function(l,N,J){return function(K,W,oe,$){return a["cshake"+l].update(K,W,oe,$)[J]()}},Y=function(l,N,J){return function(K,W,oe,$){return a["kmac"+l].update(K,W,oe,$)[J]()}},X=function(l,N,J,K){for(var W=0;W<D.length;++W){var oe=D[W];l[oe]=N(J,K,oe)}return l},ie=function(l,N){var J=q(l,N,"hex");return J.create=function(){return new f(l,N,l)},J.update=function(K){return J.create().update(K)},X(J,q,l,N)},se=function(l,N){var J=z(l,N,"hex");return J.create=function(K){return new f(l,N,K)},J.update=function(K,W){return J.create(W).update(K)},X(J,z,l,N)},ne=function(l,N){var J=U[l],K=j(l,N,"hex");return K.create=function(W,oe,$){return!oe&&!$?a["shake"+l].create(W):new f(l,N,W).bytepad([oe,$],J)},K.update=function(W,oe,$,te){return K.create(oe,$,te).update(W)},X(K,j,l,N)},P=function(l,N){var J=U[l],K=Y(l,N,"hex");return K.create=function(W,oe,$){return new A(l,N,oe).bytepad(["KMAC",$],J).bytepad([W],J)},K.update=function(W,oe,$,te){return K.create(W,$,te).update(oe)},X(K,Y,l,N)},m=[{name:"keccak",padding:C,bits:S,createMethod:ie},{name:"sha3",padding:G,bits:S,createMethod:ie},{name:"shake",padding:w,bits:T,createMethod:se},{name:"cshake",padding:M,bits:T,createMethod:ne},{name:"kmac",padding:M,bits:T,createMethod:P}],a={},d=[],b=0;b<m.length;++b)for(var y=m[b],E=y.bits,I=0;I<E.length;++I){var R=y.name+"_"+E[I];if(d.push(R),a[R]=y.createMethod(E[I],y.padding),y.name!=="sha3"){var p=y.name+E[I];d.push(p),a[p]=a[R]}}function f(l,N,J){this.blocks=[],this.s=[],this.padding=N,this.outputBits=J,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(l<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var K=0;K<50;++K)this.s[K]=0}f.prototype.update=function(l){if(this.finalized)throw new Error(t);var N,J=typeof l;if(J!=="string"){if(J==="object"){if(l===null)throw new Error(e);if(x&&l.constructor===ArrayBuffer)l=new Uint8Array(l);else if(!Array.isArray(l)&&(!x||!ArrayBuffer.isView(l)))throw new Error(e)}else throw new Error(e);N=!0}for(var K=this.blocks,W=this.byteCount,oe=l.length,$=this.blockCount,te=0,_e=this.s,ae,ue;te<oe;){if(this.reset)for(this.reset=!1,K[0]=this.block,ae=1;ae<$+1;++ae)K[ae]=0;if(N)for(ae=this.start;te<oe&&ae<W;++te)K[ae>>2]|=l[te]<<H[ae++&3];else for(ae=this.start;te<oe&&ae<W;++te)ue=l.charCodeAt(te),ue<128?K[ae>>2]|=ue<<H[ae++&3]:ue<2048?(K[ae>>2]|=(192|ue>>6)<<H[ae++&3],K[ae>>2]|=(128|ue&63)<<H[ae++&3]):ue<55296||ue>=57344?(K[ae>>2]|=(224|ue>>12)<<H[ae++&3],K[ae>>2]|=(128|ue>>6&63)<<H[ae++&3],K[ae>>2]|=(128|ue&63)<<H[ae++&3]):(ue=65536+((ue&1023)<<10|l.charCodeAt(++te)&1023),K[ae>>2]|=(240|ue>>18)<<H[ae++&3],K[ae>>2]|=(128|ue>>12&63)<<H[ae++&3],K[ae>>2]|=(128|ue>>6&63)<<H[ae++&3],K[ae>>2]|=(128|ue&63)<<H[ae++&3]);if(this.lastByteIndex=ae,ae>=W){for(this.start=ae-W,this.block=K[$],ae=0;ae<$;++ae)_e[ae]^=K[ae];B(_e),this.reset=!0}else this.start=ae}return this},f.prototype.encode=function(l,N){var J=l&255,K=1,W=[J];for(l=l>>8,J=l&255;J>0;)W.unshift(J),l=l>>8,J=l&255,++K;return N?W.push(K):W.unshift(K),this.update(W),W.length},f.prototype.encodeString=function(l){var N,J=typeof l;if(J!=="string"){if(J==="object"){if(l===null)throw new Error(e);if(x&&l.constructor===ArrayBuffer)l=new Uint8Array(l);else if(!Array.isArray(l)&&(!x||!ArrayBuffer.isView(l)))throw new Error(e)}else throw new Error(e);N=!0}var K=0,W=l.length;if(N)K=W;else for(var oe=0;oe<l.length;++oe){var $=l.charCodeAt(oe);$<128?K+=1:$<2048?K+=2:$<55296||$>=57344?K+=3:($=65536+(($&1023)<<10|l.charCodeAt(++oe)&1023),K+=4)}return K+=this.encode(K*8),this.update(l),K},f.prototype.bytepad=function(l,N){for(var J=this.encode(N),K=0;K<l.length;++K)J+=this.encodeString(l[K]);var W=N-J%N,oe=[];return oe.length=W,this.update(oe),this},f.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var l=this.blocks,N=this.lastByteIndex,J=this.blockCount,K=this.s;if(l[N>>2]|=this.padding[N&3],this.lastByteIndex===this.byteCount)for(l[0]=l[J],N=1;N<J+1;++N)l[N]=0;for(l[J-1]|=2147483648,N=0;N<J;++N)K[N]^=l[N];B(K)}},f.prototype.toString=f.prototype.hex=function(){this.finalize();for(var l=this.blockCount,N=this.s,J=this.outputBlocks,K=this.extraBytes,W=0,oe=0,$="",te;oe<J;){for(W=0;W<l&&oe<J;++W,++oe)te=N[W],$+=g[te>>4&15]+g[te&15]+g[te>>12&15]+g[te>>8&15]+g[te>>20&15]+g[te>>16&15]+g[te>>28&15]+g[te>>24&15];oe%l===0&&(B(N),W=0)}return K&&(te=N[W],$+=g[te>>4&15]+g[te&15],K>1&&($+=g[te>>12&15]+g[te>>8&15]),K>2&&($+=g[te>>20&15]+g[te>>16&15])),$},f.prototype.arrayBuffer=function(){this.finalize();var l=this.blockCount,N=this.s,J=this.outputBlocks,K=this.extraBytes,W=0,oe=0,$=this.outputBits>>3,te;K?te=new ArrayBuffer(J+1<<2):te=new ArrayBuffer($);for(var _e=new Uint32Array(te);oe<J;){for(W=0;W<l&&oe<J;++W,++oe)_e[oe]=N[W];oe%l===0&&B(N)}return K&&(_e[W]=N[W],te=te.slice(0,$)),te},f.prototype.buffer=f.prototype.arrayBuffer,f.prototype.digest=f.prototype.array=function(){this.finalize();for(var l=this.blockCount,N=this.s,J=this.outputBlocks,K=this.extraBytes,W=0,oe=0,$=[],te,_e;oe<J;){for(W=0;W<l&&oe<J;++W,++oe)te=oe<<2,_e=N[W],$[te]=_e&255,$[te+1]=_e>>8&255,$[te+2]=_e>>16&255,$[te+3]=_e>>24&255;oe%l===0&&B(N)}return K&&(te=oe<<2,_e=N[W],$[te]=_e&255,K>1&&($[te+1]=_e>>8&255),K>2&&($[te+2]=_e>>16&255)),$};function A(l,N,J){f.call(this,l,N,J)}A.prototype=new f,A.prototype.finalize=function(){return this.encode(this.outputBits,!0),f.prototype.finalize.call(this)};var B=function(l){var N,J,K,W,oe,$,te,_e,ae,ue,pt,we,ke,Nt,Ce,Ne,Fe,be,Ae,wt,Pe,Me,Qt,Se,Oe,Yt,ze,Le,_t,Ie,He,fr,De,Ke,cr,Ge,Re,ht,Ue,Je,bt,Ve,v,u,h,_,F,L,V,xe,le,he,Be,ce,Qe,Cr,Ye,Xe,gr,mr,yr,vr,wr;for(K=0;K<48;K+=2)W=l[0]^l[10]^l[20]^l[30]^l[40],oe=l[1]^l[11]^l[21]^l[31]^l[41],$=l[2]^l[12]^l[22]^l[32]^l[42],te=l[3]^l[13]^l[23]^l[33]^l[43],_e=l[4]^l[14]^l[24]^l[34]^l[44],ae=l[5]^l[15]^l[25]^l[35]^l[45],ue=l[6]^l[16]^l[26]^l[36]^l[46],pt=l[7]^l[17]^l[27]^l[37]^l[47],we=l[8]^l[18]^l[28]^l[38]^l[48],ke=l[9]^l[19]^l[29]^l[39]^l[49],N=we^($<<1|te>>>31),J=ke^(te<<1|$>>>31),l[0]^=N,l[1]^=J,l[10]^=N,l[11]^=J,l[20]^=N,l[21]^=J,l[30]^=N,l[31]^=J,l[40]^=N,l[41]^=J,N=W^(_e<<1|ae>>>31),J=oe^(ae<<1|_e>>>31),l[2]^=N,l[3]^=J,l[12]^=N,l[13]^=J,l[22]^=N,l[23]^=J,l[32]^=N,l[33]^=J,l[42]^=N,l[43]^=J,N=$^(ue<<1|pt>>>31),J=te^(pt<<1|ue>>>31),l[4]^=N,l[5]^=J,l[14]^=N,l[15]^=J,l[24]^=N,l[25]^=J,l[34]^=N,l[35]^=J,l[44]^=N,l[45]^=J,N=_e^(we<<1|ke>>>31),J=ae^(ke<<1|we>>>31),l[6]^=N,l[7]^=J,l[16]^=N,l[17]^=J,l[26]^=N,l[27]^=J,l[36]^=N,l[37]^=J,l[46]^=N,l[47]^=J,N=ue^(W<<1|oe>>>31),J=pt^(oe<<1|W>>>31),l[8]^=N,l[9]^=J,l[18]^=N,l[19]^=J,l[28]^=N,l[29]^=J,l[38]^=N,l[39]^=J,l[48]^=N,l[49]^=J,Nt=l[0],Ce=l[1],_=l[11]<<4|l[10]>>>28,F=l[10]<<4|l[11]>>>28,Le=l[20]<<3|l[21]>>>29,_t=l[21]<<3|l[20]>>>29,mr=l[31]<<9|l[30]>>>23,yr=l[30]<<9|l[31]>>>23,Ve=l[40]<<18|l[41]>>>14,v=l[41]<<18|l[40]>>>14,Ke=l[2]<<1|l[3]>>>31,cr=l[3]<<1|l[2]>>>31,Ne=l[13]<<12|l[12]>>>20,Fe=l[12]<<12|l[13]>>>20,L=l[22]<<10|l[23]>>>22,V=l[23]<<10|l[22]>>>22,Ie=l[33]<<13|l[32]>>>19,He=l[32]<<13|l[33]>>>19,vr=l[42]<<2|l[43]>>>30,wr=l[43]<<2|l[42]>>>30,ce=l[5]<<30|l[4]>>>2,Qe=l[4]<<30|l[5]>>>2,Ge=l[14]<<6|l[15]>>>26,Re=l[15]<<6|l[14]>>>26,be=l[25]<<11|l[24]>>>21,Ae=l[24]<<11|l[25]>>>21,xe=l[34]<<15|l[35]>>>17,le=l[35]<<15|l[34]>>>17,fr=l[45]<<29|l[44]>>>3,De=l[44]<<29|l[45]>>>3,Se=l[6]<<28|l[7]>>>4,Oe=l[7]<<28|l[6]>>>4,Cr=l[17]<<23|l[16]>>>9,Ye=l[16]<<23|l[17]>>>9,ht=l[26]<<25|l[27]>>>7,Ue=l[27]<<25|l[26]>>>7,wt=l[36]<<21|l[37]>>>11,Pe=l[37]<<21|l[36]>>>11,he=l[47]<<24|l[46]>>>8,Be=l[46]<<24|l[47]>>>8,u=l[8]<<27|l[9]>>>5,h=l[9]<<27|l[8]>>>5,Yt=l[18]<<20|l[19]>>>12,ze=l[19]<<20|l[18]>>>12,Xe=l[29]<<7|l[28]>>>25,gr=l[28]<<7|l[29]>>>25,Je=l[38]<<8|l[39]>>>24,bt=l[39]<<8|l[38]>>>24,Me=l[48]<<14|l[49]>>>18,Qt=l[49]<<14|l[48]>>>18,l[0]=Nt^~Ne&be,l[1]=Ce^~Fe&Ae,l[10]=Se^~Yt&Le,l[11]=Oe^~ze&_t,l[20]=Ke^~Ge&ht,l[21]=cr^~Re&Ue,l[30]=u^~_&L,l[31]=h^~F&V,l[40]=ce^~Cr&Xe,l[41]=Qe^~Ye&gr,l[2]=Ne^~be&wt,l[3]=Fe^~Ae&Pe,l[12]=Yt^~Le&Ie,l[13]=ze^~_t&He,l[22]=Ge^~ht&Je,l[23]=Re^~Ue&bt,l[32]=_^~L&xe,l[33]=F^~V&le,l[42]=Cr^~Xe&mr,l[43]=Ye^~gr&yr,l[4]=be^~wt&Me,l[5]=Ae^~Pe&Qt,l[14]=Le^~Ie&fr,l[15]=_t^~He&De,l[24]=ht^~Je&Ve,l[25]=Ue^~bt&v,l[34]=L^~xe&he,l[35]=V^~le&Be,l[44]=Xe^~mr&vr,l[45]=gr^~yr&wr,l[6]=wt^~Me&Nt,l[7]=Pe^~Qt&Ce,l[16]=Ie^~fr&Se,l[17]=He^~De&Oe,l[26]=Je^~Ve&Ke,l[27]=bt^~v&cr,l[36]=xe^~he&u,l[37]=le^~Be&h,l[46]=mr^~vr&ce,l[47]=yr^~wr&Qe,l[8]=Me^~Nt&Ne,l[9]=Qt^~Ce&Fe,l[18]=fr^~Se&Yt,l[19]=De^~Oe&ze,l[28]=Ve^~Ke&Ge,l[29]=v^~cr&Re,l[38]=he^~u&_,l[39]=Be^~h&F,l[48]=vr^~ce&Cr,l[49]=wr^~Qe&Ye,l[0]^=k[K],l[1]^=k[K+1]};if(c)n.exports=a;else for(b=0;b<d.length;++b)i[d[b]]=a[d[b]]})()})(Ni)),Ni.exports}var Wa=Va();const ja=sn(Wa);function je(n){return"0x"+ja.keccak_256(Z(n))}const Qa="rlp/5.8.0",tr=new O(Qa);function jo(n){const e=[];for(;n;)e.unshift(n&255),n>>=8;return e}function Qo(n,e,t){let r=0;for(let i=0;i<t;i++)r=r*256+n[e+i];return r}function ls(n){if(Array.isArray(n)){let r=[];if(n.forEach(function(o){r=r.concat(ls(o))}),r.length<=55)return r.unshift(192+r.length),r;const i=jo(r.length);return i.unshift(247+i.length),i.concat(r)}Pn(n)||tr.throwArgumentError("RLP object must be BytesLike","object",n);const e=Array.prototype.slice.call(Z(n));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=jo(e.length);return t.unshift(183+t.length),t.concat(e)}function tn(n){return re(ls(n))}function Yo(n,e,t,r){const i=[];for(;t<e+1+r;){const o=ds(n,t);i.push(o.result),t+=o.consumed,t>e+1+r&&tr.throwError("child data too short",O.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function ds(n,e){if(n.length===0&&tr.throwError("data too short",O.errors.BUFFER_OVERRUN,{}),n[e]>=248){const t=n[e]-247;e+1+t>n.length&&tr.throwError("data short segment too short",O.errors.BUFFER_OVERRUN,{});const r=Qo(n,e+1,t);return e+1+t+r>n.length&&tr.throwError("data long segment too short",O.errors.BUFFER_OVERRUN,{}),Yo(n,e,e+1+t,t+r)}else if(n[e]>=192){const t=n[e]-192;return e+1+t>n.length&&tr.throwError("data array too short",O.errors.BUFFER_OVERRUN,{}),Yo(n,e,e+1,t)}else if(n[e]>=184){const t=n[e]-183;e+1+t>n.length&&tr.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const r=Qo(n,e+1,t);e+1+t+r>n.length&&tr.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const i=re(n.slice(e+1+t,e+1+t+r));return{consumed:1+t+r,result:i}}else if(n[e]>=128){const t=n[e]-128;e+1+t>n.length&&tr.throwError("data too short",O.errors.BUFFER_OVERRUN,{});const r=re(n.slice(e+1,e+1+t));return{consumed:1+t,result:r}}return{consumed:1,result:re(n[e])}}function go(n){const e=Z(n),t=ds(e,0);return t.consumed!==e.length&&tr.throwArgumentError("invalid rlp data","data",n),t.result}const Ya="address/5.8.0",jr=new O(Ya);function Xo(n){ve(n,20)||jr.throwArgumentError("invalid address","address",n),n=n.toLowerCase();const e=n.substring(2).split(""),t=new Uint8Array(40);for(let i=0;i<40;i++)t[i]=e[i].charCodeAt(0);const r=Z(je(t));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Xa=9007199254740991;function Za(n){return Math.log10?Math.log10(n):Math.log(n)/Math.LN10}const mo={};for(let n=0;n<10;n++)mo[String(n)]=String(n);for(let n=0;n<26;n++)mo[String.fromCharCode(65+n)]=String(10+n);const Zo=Math.floor(Za(Xa));function $a(n){n=n.toUpperCase(),n=n.substring(4)+n.substring(0,2)+"00";let e=n.split("").map(r=>mo[r]).join("");for(;e.length>=Zo;){let r=e.substring(0,Zo);e=parseInt(r,10)%97+e.substring(r.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}function et(n){let e=null;if(typeof n!="string"&&jr.throwArgumentError("invalid address","address",n),n.match(/^(0x)?[0-9a-fA-F]{40}$/))n.substring(0,2)!=="0x"&&(n="0x"+n),e=Xo(n),n.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==n&&jr.throwArgumentError("bad address checksum","address",n);else if(n.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(n.substring(2,4)!==$a(n)&&jr.throwArgumentError("bad icap checksum","address",n),e=Fa(n.substring(4));e.length<40;)e="0"+e;e=Xo("0x"+e)}else jr.throwArgumentError("invalid address","address",n);return e}function yo(n){let e=null;try{e=et(n.from)}catch{jr.throwArgumentError("missing from address","transaction",n)}const t=or(Z(ee.from(n.nonce).toHexString()));return et(ft(je(tn([e,t])),12))}class ef extends br{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=et(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}decode(e){return et(We(e.readValue().toHexString(),20))}}class tf extends br{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Qr=new O(Mn);function xs(n,e,t){let r=null;if(Array.isArray(t))r=t;else if(t&&typeof t=="object"){let x={};r=e.map(g=>{const w=g.localName;return w||Qr.throwError("cannot encode object for signature with missing names",O.errors.INVALID_ARGUMENT,{argument:"values",coder:g,value:t}),x[w]&&Qr.throwError("cannot encode object for signature with duplicate names",O.errors.INVALID_ARGUMENT,{argument:"values",coder:g,value:t}),x[w]=!0,t[w]})}else Qr.throwArgumentError("invalid tuple value","tuple",t);e.length!==r.length&&Qr.throwArgumentError("types/value length mismatch","tuple",t);let i=new io(n.wordSize),o=new io(n.wordSize),s=[];e.forEach((x,g)=>{let w=r[g];if(x.dynamic){let M=o.length;x.encode(o,w);let C=i.writeUpdatableValue();s.push(G=>{C(G+M)})}else x.encode(i,w)}),s.forEach(x=>{x(i.length)});let c=n.appendWriter(i);return c+=n.appendWriter(o),c}function ps(n,e){let t=[],r=n.subReader(0);e.forEach(o=>{let s=null;if(o.dynamic){let c=n.readValue(),x=r.subReader(c.toNumber());try{s=o.decode(x)}catch(g){if(g.code===O.errors.BUFFER_OVERRUN)throw g;s=g,s.baseType=o.name,s.name=o.localName,s.type=o.type}}else try{s=o.decode(n)}catch(c){if(c.code===O.errors.BUFFER_OVERRUN)throw c;s=c,s.baseType=o.name,s.name=o.localName,s.type=o.type}s!=null&&t.push(s)});const i=e.reduce((o,s)=>{const c=s.localName;return c&&(o[c]||(o[c]=0),o[c]++),o},{});e.forEach((o,s)=>{let c=o.localName;if(!c||i[c]!==1||(c==="length"&&(c="_length"),t[c]!=null))return;const x=t[s];x instanceof Error?Object.defineProperty(t,c,{enumerable:!0,get:()=>{throw x}}):t[c]=x});for(let o=0;o<t.length;o++){const s=t[o];s instanceof Error&&Object.defineProperty(t,o,{enumerable:!0,get:()=>{throw s}})}return Object.freeze(t)}class rf extends br{constructor(e,t,r){const i=e.type+"["+(t>=0?t:"")+"]",o=t===-1||e.dynamic;super("array",i,r,o),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;r===-1&&(r=t.length,e.writeValue(t.length)),Qr.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let o=0;o<t.length;o++)i.push(this.coder);return xs(e,i,t)}decode(e){let t=this.length;t===-1&&(t=e.readValue().toNumber(),t*32>e._data.length&&Qr.throwError("insufficient data length",O.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let i=0;i<t;i++)r.push(new tf(this.coder));return e.coerce(this.name,ps(e,r))}}class nf extends br{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class bs extends br{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=Z(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class of extends bs{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,re(super.decode(e)))}}class sf extends br{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,t){let r=Z(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,re(e.readBytes(this.size)))}}class af extends br{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}const ff="0x0000000000000000000000000000000000000000",cf=ee.from(-1),gs=ee.from(0),uf=ee.from(1),hf=ee.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),lf="0x0000000000000000000000000000000000000000000000000000000000000000";class df extends br{constructor(e,t,r){const i=(t?"int":"uint")+e*8;super(i,i,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=ee.from(t),i=hf.mask(e.wordSize*8);if(this.signed){let o=i.mask(this.size*8-1);(r.gt(o)||r.lt(o.add(uf).mul(cf)))&&this._throwError("value out-of-bounds",t)}else(r.lt(gs)||r.gt(i.mask(this.size*8)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(this.size*8).mask(this.size*8),this.signed&&(r=r.fromTwos(this.size*8).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(this.size*8);return this.signed&&(t=t.fromTwos(this.size*8)),e.coerce(this.name,t)}}const xf="strings/5.8.0",ms=new O(xf);var xr;(function(n){n.current="",n.NFC="NFC",n.NFD="NFD",n.NFKC="NFKC",n.NFKD="NFKD"})(xr||(xr={}));var Pt;(function(n){n.UNEXPECTED_CONTINUE="unexpected continuation byte",n.BAD_PREFIX="bad codepoint prefix",n.OVERRUN="string overrun",n.MISSING_CONTINUE="missing continuation byte",n.OUT_OF_RANGE="out of UTF-8 range",n.UTF16_SURROGATE="UTF-16 surrogate",n.OVERLONG="overlong representation"})(Pt||(Pt={}));function pf(n,e,t,r,i){return ms.throwArgumentError(`invalid codepoint at offset ${e}; ${n}`,"bytes",t)}function ys(n,e,t,r,i){if(n===Pt.BAD_PREFIX||n===Pt.UNEXPECTED_CONTINUE){let o=0;for(let s=e+1;s<t.length&&t[s]>>6===2;s++)o++;return o}return n===Pt.OVERRUN?t.length-e-1:0}function bf(n,e,t,r,i){return n===Pt.OVERLONG?(r.push(i),0):(r.push(65533),ys(n,e,t))}const vs=Object.freeze({error:pf,ignore:ys,replace:bf});function ws(n,e){e==null&&(e=vs.error),n=Z(n);const t=[];let r=0;for(;r<n.length;){const i=n[r++];if(i>>7===0){t.push(i);continue}let o=null,s=null;if((i&224)===192)o=1,s=127;else if((i&240)===224)o=2,s=2047;else if((i&248)===240)o=3,s=65535;else{(i&192)===128?r+=e(Pt.UNEXPECTED_CONTINUE,r-1,n,t):r+=e(Pt.BAD_PREFIX,r-1,n,t);continue}if(r-1+o>=n.length){r+=e(Pt.OVERRUN,r-1,n,t);continue}let c=i&(1<<8-o-1)-1;for(let x=0;x<o;x++){let g=n[r];if((g&192)!=128){r+=e(Pt.MISSING_CONTINUE,r,n,t),c=null;break}c=c<<6|g&63,r++}if(c!==null){if(c>1114111){r+=e(Pt.OUT_OF_RANGE,r-1-o,n,t,c);continue}if(c>=55296&&c<=57343){r+=e(Pt.UTF16_SURROGATE,r-1-o,n,t,c);continue}if(c<=s){r+=e(Pt.OVERLONG,r-1-o,n,t,c);continue}t.push(c)}}return t}function ut(n,e=xr.current){e!=xr.current&&(ms.checkNormalize(),n=n.normalize(e));let t=[];for(let r=0;r<n.length;r++){const i=n.charCodeAt(r);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192),t.push(i&63|128);else if((i&64512)==55296){r++;const o=n.charCodeAt(r);if(r>=n.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");const s=65536+((i&1023)<<10)+(o&1023);t.push(s>>18|240),t.push(s>>12&63|128),t.push(s>>6&63|128),t.push(s&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return Z(t)}function gf(n){return n.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function an(n,e){return gf(ws(n,e))}function As(n,e=xr.current){return ws(ut(n,e))}class mf extends bs{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,ut(t))}decode(e){return an(super.decode(e))}}class Bn extends br{constructor(e,t){let r=!1;const i=[];e.forEach(s=>{s.dynamic&&(r=!0),i.push(s.type)});const o="tuple("+i.join(",")+")";super("tuple",o,t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach(r=>{e.push(r.defaultValue())});const t=this.coders.reduce((r,i)=>{const o=i.localName;return o&&(r[o]||(r[o]=0),r[o]++),r},{});return this.coders.forEach((r,i)=>{let o=r.localName;!o||t[o]!==1||(o==="length"&&(o="_length"),e[o]==null&&(e[o]=e[i]))}),Object.freeze(e)}encode(e,t){return xs(e,this.coders,t)}decode(e){return e.coerce(this.name,ps(e,this.coders))}}const Tn=new O(Mn),yf=new RegExp(/^bytes([0-9]*)$/),vf=new RegExp(/^(u?int)([0-9]*)$/);class Es{constructor(e){Q(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new ef(e.name);case"bool":return new nf(e.name);case"string":return new mf(e.name);case"bytes":return new of(e.name);case"array":return new rf(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Bn((e.components||[]).map(r=>this._getCoder(r)),e.name);case"":return new af(e.name)}let t=e.type.match(vf);if(t){let r=parseInt(t[2]||"256");return(r===0||r>256||r%8!==0)&&Tn.throwArgumentError("invalid "+t[1]+" bit length","param",e),new df(r/8,t[1]==="int",e.name)}if(t=e.type.match(yf),t){let r=parseInt(t[1]);return(r===0||r>32)&&Tn.throwArgumentError("invalid bytes length","param",e),new sf(r,e.name)}return Tn.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Yn(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new io(this._getWordSize())}getDefaultValue(e){const t=e.map(i=>this._getCoder(ct.from(i)));return new Bn(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Tn.throwError("types/values length mismatch",O.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map(s=>this._getCoder(ct.from(s))),i=new Bn(r,"_"),o=this._getWriter();return i.encode(o,t),o.data}decode(e,t,r){const i=e.map(s=>this._getCoder(ct.from(s)));return new Bn(i,"_").decode(this._getReader(Z(t),r))}}const _s=new Es;function _r(n){return je(ut(n))}const Ss="hash/5.8.0";function Ps(n){n=atob(n);const e=[];for(let t=0;t<n.length;t++)e.push(n.charCodeAt(t));return Z(e)}function Ms(n){n=Z(n);let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return btoa(e)}function Is(n,e){e==null&&(e=1);const t=[],r=t.forEach,i=function(o,s){r.call(o,function(c){s>0&&Array.isArray(c)?i(c,s-1):t.push(c)})};return i(n,e),t}function wf(n){const e={};for(let t=0;t<n.length;t++){const r=n[t];e[r[0]]=r[1]}return e}function Af(n){let e=0;function t(){return n[e++]<<8|n[e++]}let r=t(),i=1,o=[0,1];for(let z=1;z<r;z++)o.push(i+=t());let s=t(),c=e;e+=s;let x=0,g=0;function w(){return x==0&&(g=g<<8|n[e++],x=8),g>>--x&1}const M=31,C=Math.pow(2,M),G=C>>>1,H=G>>1,k=C-1;let S=0;for(let z=0;z<M;z++)S=S<<1|w();let T=[],D=0,U=C;for(;;){let z=Math.floor(((S-D+1)*i-1)/U),j=0,Y=r;for(;Y-j>1;){let se=j+Y>>>1;z<o[se]?Y=se:j=se}if(j==0)break;T.push(j);let X=D+Math.floor(U*o[j]/i),ie=D+Math.floor(U*o[j+1]/i)-1;for(;((X^ie)&G)==0;)S=S<<1&k|w(),X=X<<1&k,ie=ie<<1&k|1;for(;X&~ie&H;)S=S&G|S<<1&k>>>1|w(),X=X<<1^G,ie=(ie^G)<<1|G|1;D=X,U=1+ie-X}let q=r-4;return T.map(z=>{switch(z-q){case 3:return q+65792+(n[c++]<<16|n[c++]<<8|n[c++]);case 2:return q+256+(n[c++]<<8|n[c++]);case 1:return q+n[c++];default:return z-1}})}function Ef(n){let e=0;return()=>n[e++]}function _f(n){return Ef(Af(n))}function Sf(n){return n&1?~n>>1:n>>1}function Pf(n,e){let t=Array(n);for(let r=0;r<n;r++)t[r]=1+e();return t}function $o(n,e){let t=Array(n);for(let r=0,i=-1;r<n;r++)t[r]=i+=1+e();return t}function Mf(n,e){let t=Array(n);for(let r=0,i=0;r<n;r++)t[r]=i+=Sf(e());return t}function Xn(n,e){let t=$o(n(),n),r=n(),i=$o(r,n),o=Pf(r,n);for(let s=0;s<r;s++)for(let c=0;c<o[s];c++)t.push(i[s]+c);return e?t.map(s=>e[s]):t}function If(n){let e=[];for(;;){let t=n();if(t==0)break;e.push(Cf(t,n))}for(;;){let t=n()-1;if(t<0)break;e.push(Nf(t,n))}return wf(Is(e))}function kf(n){let e=[];for(;;){let t=n();if(t==0)break;e.push(t)}return e}function ks(n,e,t){let r=Array(n).fill(void 0).map(()=>[]);for(let i=0;i<e;i++)Mf(n,t).forEach((o,s)=>r[s].push(o));return r}function Cf(n,e){let t=1+e(),r=e(),i=kf(e),o=ks(i.length,1+n,e);return Is(o.map((s,c)=>{const x=s[0],g=s.slice(1);return Array(i[c]).fill(void 0).map((w,M)=>{let C=M*r;return[x+M*t,g.map(G=>G+C)]})}))}function Nf(n,e){let t=1+e();return ks(t,1+n,e).map(i=>[i[0],i.slice(1)])}function Rf(n){let e=Xn(n).sort((r,i)=>r-i);return t();function t(){let r=[];for(;;){let g=Xn(n,e);if(g.length==0)break;r.push({set:new Set(g),node:t()})}r.sort((g,w)=>w.set.size-g.set.size);let i=n(),o=i%3;i=i/3|0;let s=!!(i&1);i>>=1;let c=i==1,x=i==2;return{branches:r,valid:o,fe0f:s,save:c,check:x}}}function Bf(){return _f(Ps("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const oi=Bf(),Tf=new Set(Xn(oi)),Ff=new Set(Xn(oi)),Of=If(oi),Df=Rf(oi),e0=45,t0=95;function Cs(n){return As(n)}function Uf(n){return n.filter(e=>e!=65039)}function Ns(n){for(let e of n.split(".")){let t=Cs(e);try{for(let r=t.lastIndexOf(t0)-1;r>=0;r--)if(t[r]!==t0)throw new Error("underscore only allowed at start");if(t.length>=4&&t.every(r=>r<128)&&t[2]===e0&&t[3]===e0)throw new Error("invalid label extension")}catch(r){throw new Error(`Invalid label "${e}": ${r.message}`)}}return n}function Lf(n){return Ns(Gf(n,Uf))}function Gf(n,e){let t=Cs(n).reverse(),r=[];for(;t.length;){let i=zf(t);if(i){r.push(...e(i));continue}let o=t.pop();if(Tf.has(o)){r.push(o);continue}if(Ff.has(o))continue;let s=Of[o];if(s){r.push(...s);continue}throw new Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`)}return Ns(qf(String.fromCodePoint(...r)))}function qf(n){return n.normalize("NFC")}function zf(n,e){var t;let r=Df,i,o,s=[],c=n.length;for(;c;){let x=n[--c];if(r=(t=r.branches.find(g=>g.set.has(x)))===null||t===void 0?void 0:t.node,!r)break;if(r.save)o=x;else if(r.check&&x===o)break;s.push(x),r.fe0f&&(s.push(65039),c>0&&n[c-1]==65039&&c--),r.valid&&(i=s.slice(),r.valid==2&&i.splice(1,1),n.length=c)}return i}const Hf=new O(Ss),Rs=new Uint8Array(32);Rs.fill(0);function r0(n){if(n.length===0)throw new Error("invalid ENS name; empty component");return n}function Bs(n){const e=ut(Lf(n)),t=[];if(n.length===0)return t;let r=0;for(let i=0;i<e.length;i++)e[i]===46&&(t.push(r0(e.slice(r,i))),r=i+1);if(r>=e.length)throw new Error("invalid ENS name; empty component");return t.push(r0(e.slice(r))),t}function bn(n){typeof n!="string"&&Hf.throwArgumentError("invalid ENS name; not a string","name",n);let e=Rs;const t=Bs(n);for(;t.length;)e=je(rt([e,je(t.pop())]));return re(e)}function Ts(n){return re(rt(Bs(n).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"}const Kf=`Ethereum Signed Message:
|
|
7
7
|
`;function Fs(n){return typeof n=="string"&&(n=ut(n)),je(rt([ut(Kf),ut(String(n.length)),n]))}var Jf=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const $e=new O(Ss),Os=new Uint8Array(32);Os.fill(0);const Vf=ee.from(-1),Ds=ee.from(0),Us=ee.from(1),Wf=ee.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function jf(n){const e=Z(n),t=e.length%32;return t?At([e,Os.slice(t)]):re(e)}const Qf=We(Us.toHexString(),32),Yf=We(Ds.toHexString(),32),n0={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Ri=["name","version","chainId","verifyingContract","salt"];function i0(n){return function(e){return typeof e!="string"&&$e.throwArgumentError(`invalid domain value for ${JSON.stringify(n)}`,`domain.${n}`,e),e}}const Xf={name:i0("name"),version:i0("version"),chainId:function(n){try{return ee.from(n).toString()}catch{}return $e.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",n)},verifyingContract:function(n){try{return et(n).toLowerCase()}catch{}return $e.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",n)},salt:function(n){try{const e=Z(n);if(e.length!==32)throw new Error("bad length");return re(e)}catch{}return $e.throwArgumentError('invalid domain value "salt"',"domain.salt",n)}};function Bi(n){{const e=n.match(/^(u?)int(\d*)$/);if(e){const t=e[1]==="",r=parseInt(e[2]||"256");(r%8!==0||r>256||e[2]&&e[2]!==String(r))&&$e.throwArgumentError("invalid numeric width","type",n);const i=Wf.mask(t?r-1:r),o=t?i.add(Us).mul(Vf):Ds;return function(s){const c=ee.from(s);return(c.lt(o)||c.gt(i))&&$e.throwArgumentError(`value out-of-bounds for ${n}`,"value",s),We(c.toTwos(256).toHexString(),32)}}}{const e=n.match(/^bytes(\d+)$/);if(e){const t=parseInt(e[1]);return(t===0||t>32||e[1]!==String(t))&&$e.throwArgumentError("invalid bytes width","type",n),function(r){return Z(r).length!==t&&$e.throwArgumentError(`invalid length for ${n}`,"value",r),jf(r)}}}switch(n){case"address":return function(e){return We(et(e),32)};case"bool":return function(e){return e?Qf:Yf};case"bytes":return function(e){return je(e)};case"string":return function(e){return _r(e)}}return null}function o0(n,e){return`${n}(${e.map(({name:t,type:r})=>r+" "+t).join(",")})`}class gt{constructor(e){Q(this,"types",Object.freeze(sr(e))),Q(this,"_encoderCache",{}),Q(this,"_types",{});const t={},r={},i={};Object.keys(e).forEach(c=>{t[c]={},r[c]=[],i[c]={}});for(const c in e){const x={};e[c].forEach(g=>{x[g.name]&&$e.throwArgumentError(`duplicate variable name ${JSON.stringify(g.name)} in ${JSON.stringify(c)}`,"types",e),x[g.name]=!0;const w=g.type.match(/^([^\x5b]*)(\x5b|$)/)[1];w===c&&$e.throwArgumentError(`circular type reference to ${JSON.stringify(w)}`,"types",e),!Bi(w)&&(r[w]||$e.throwArgumentError(`unknown type ${JSON.stringify(w)}`,"types",e),r[w].push(c),t[c][w]=!0)})}const o=Object.keys(r).filter(c=>r[c].length===0);o.length===0?$e.throwArgumentError("missing primary type","types",e):o.length>1&&$e.throwArgumentError(`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),Q(this,"primaryType",o[0]);function s(c,x){x[c]&&$e.throwArgumentError(`circular type reference to ${JSON.stringify(c)}`,"types",e),x[c]=!0,Object.keys(t[c]).forEach(g=>{r[g]&&(s(g,x),Object.keys(x).forEach(w=>{i[w][g]=!0}))}),delete x[c]}s(this.primaryType,{});for(const c in i){const x=Object.keys(i[c]);x.sort(),this._types[c]=o0(c,e[c])+x.map(g=>o0(g,e[g])).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const i=Bi(e);if(i)return i}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const i=t[1],o=this.getEncoder(i),s=parseInt(t[3]);return c=>{s>=0&&c.length!==s&&$e.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",c);let x=c.map(o);return this._types[i]&&(x=x.map(je)),je(At(x))}}const r=this.types[e];if(r){const i=_r(this._types[e]);return o=>{const s=r.map(({name:c,type:x})=>{const g=this.getEncoder(x)(o[c]);return this._types[x]?je(g):g});return s.unshift(i),At(s)}}return $e.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||$e.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return je(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(Bi(e))return r(e,t);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const s=i[1],c=parseInt(i[3]);return c>=0&&t.length!==c&&$e.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map(x=>this._visit(s,x,r))}const o=this.types[e];return o?o.reduce((s,{name:c,type:x})=>(s[c]=this._visit(x,t[c],r),s),{}):$e.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new gt(e)}static getPrimaryType(e){return gt.from(e).primaryType}static hashStruct(e,t,r){return gt.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const i=n0[r];i||$e.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:i})}return t.sort((r,i)=>Ri.indexOf(r.name)-Ri.indexOf(i.name)),gt.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return At(["0x1901",gt.hashDomain(e),gt.from(t).hash(r)])}static hash(e,t,r){return je(gt.encode(e,t,r))}static resolveNames(e,t,r,i){return Jf(this,void 0,void 0,function*(){e=nt(e);const o={};e.verifyingContract&&!ve(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const s=gt.from(t);s.visit(r,(c,x)=>(c==="address"&&!ve(x,20)&&(o[x]="0x"),x));for(const c in o)o[c]=yield i(c);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),r=s.visit(r,(c,x)=>c==="address"&&o[x]?o[x]:x),{domain:e,value:r}})}static getPayload(e,t,r){gt.hashDomain(e);const i={},o=[];Ri.forEach(x=>{const g=e[x];g!=null&&(i[x]=Xf[x](g),o.push({name:x,type:n0[x]}))});const s=gt.from(t),c=nt(t);return c.EIP712Domain?$e.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):c.EIP712Domain=o,s.encode(r),{types:c,domain:i,primaryType:s.primaryType,message:s.visit(r,(x,g)=>{if(x.match(/^bytes(\d*)/))return re(Z(g));if(x.match(/^u?int/))return ee.from(g).toString();switch(x){case"address":return g.toLowerCase();case"bool":return!!g;case"string":return typeof g!="string"&&$e.throwArgumentError("invalid string","value",g),g}return $e.throwArgumentError("unsupported type","type",x)})}}}const Ze=new O(Mn);class Ls extends Gr{}class Gs extends Gr{}class Zf extends Gr{}class Zn extends Gr{static isIndexed(e){return!!(e&&e._isIndexed)}}const $f={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function s0(n,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${n}`);return t.error=e,t}class oo{constructor(e){let t=[];typeof e=="string"?t=JSON.parse(e):t=e,Q(this,"fragments",t.map(r=>nr.from(r)).filter(r=>r!=null)),Q(this,"_abiCoder",Wt(new.target,"getAbiCoder")()),Q(this,"functions",{}),Q(this,"errors",{}),Q(this,"events",{}),Q(this,"structs",{}),this.fragments.forEach(r=>{let i=null;switch(r.type){case"constructor":if(this.deploy){Ze.warn("duplicate definition - constructor");return}Q(this,"deploy",r);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let o=r.format();if(i[o]){Ze.warn("duplicate definition - "+o);return}i[o]=r}),this.deploy||Q(this,"deploy",Jt.from({payable:!1,type:"constructor"})),Q(this,"_isInterface",!0)}format(e){e||(e=Ee.full),e===Ee.sighash&&Ze.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map(r=>r.format(e));return e===Ee.json?JSON.stringify(t.map(r=>JSON.parse(r))):t}static getAbiCoder(){return _s}static getAddress(e){return et(e)}static getSighash(e){return ft(_r(e.format()),0,4)}static getEventTopic(e){return _r(e.format())}getFunction(e){if(ve(e)){for(const r in this.functions)if(e===this.getSighash(r))return this.functions[r];Ze.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const r=e.trim(),i=Object.keys(this.functions).filter(o=>o.split("(")[0]===r);return i.length===0?Ze.throwArgumentError("no matching function","name",r):i.length>1&&Ze.throwArgumentError("multiple matching functions","name",r),this.functions[i[0]]}const t=this.functions[Vt.fromString(e).format()];return t||Ze.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(ve(e)){const r=e.toLowerCase();for(const i in this.events)if(r===this.getEventTopic(i))return this.events[i];Ze.throwArgumentError("no matching event","topichash",r)}if(e.indexOf("(")===-1){const r=e.trim(),i=Object.keys(this.events).filter(o=>o.split("(")[0]===r);return i.length===0?Ze.throwArgumentError("no matching event","name",r):i.length>1&&Ze.throwArgumentError("multiple matching events","name",r),this.events[i[0]]}const t=this.events[rr.fromString(e).format()];return t||Ze.throwArgumentError("no matching event","signature",e),t}getError(e){if(ve(e)){const r=Wt(this.constructor,"getSighash");for(const i in this.errors){const o=this.errors[i];if(e===r(o))return this.errors[i]}Ze.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const r=e.trim(),i=Object.keys(this.errors).filter(o=>o.split("(")[0]===r);return i.length===0?Ze.throwArgumentError("no matching error","name",r):i.length>1&&Ze.throwArgumentError("multiple matching errors","name",r),this.errors[i[0]]}const t=this.errors[Vt.fromString(e).format()];return t||Ze.throwArgumentError("no matching error","signature",e),t}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch{throw t}}return Wt(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Wt(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){typeof e=="string"&&(e=this.getError(e));const r=Z(t);return re(r.slice(0,4))!==this.getSighash(e)&&Ze.throwArgumentError(`data signature does not match error ${e.name}.`,"data",re(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return typeof e=="string"&&(e=this.getError(e)),re(rt([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){typeof e=="string"&&(e=this.getFunction(e));const r=Z(t);return re(r.slice(0,4))!==this.getSighash(e)&&Ze.throwArgumentError(`data signature does not match function ${e.name}.`,"data",re(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return typeof e=="string"&&(e=this.getFunction(e)),re(rt([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){typeof e=="string"&&(e=this.getFunction(e));let r=Z(t),i=null,o="",s=null,c=null,x=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch{}break;case 4:{const g=re(r.slice(0,4)),w=$f[g];if(w)s=this._abiCoder.decode(w.inputs,r.slice(4)),c=w.name,x=w.signature,w.reason&&(i=s[0]),c==="Error"?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:c==="Panic"&&(o=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const M=this.getError(g);s=this._abiCoder.decode(M.inputs,r.slice(4)),c=M.name,x=M.format()}catch{}break}}return Ze.throwError("call revert exception"+o,O.errors.CALL_EXCEPTION,{method:e.format(),data:re(t),errorArgs:s,errorName:c,errorSignature:x,reason:i})}encodeFunctionResult(e,t){return typeof e=="string"&&(e=this.getFunction(e)),re(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){typeof e=="string"&&(e=this.getEvent(e)),t.length>e.inputs.length&&Ze.throwError("too many arguments for "+e.format(),O.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const i=(o,s)=>o.type==="string"?_r(s):o.type==="bytes"?je(re(s)):(o.type==="bool"&&typeof s=="boolean"&&(s=s?"0x01":"0x00"),o.type.match(/^u?int/)&&(s=ee.from(s).toHexString()),o.type==="address"&&this._abiCoder.encode(["address"],[s]),We(re(s),32));for(t.forEach((o,s)=>{let c=e.inputs[s];if(!c.indexed){o!=null&&Ze.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+c.name,o);return}o==null?r.push(null):c.baseType==="array"||c.baseType==="tuple"?Ze.throwArgumentError("filtering with tuples or arrays not supported","contract."+c.name,o):Array.isArray(o)?r.push(o.map(x=>i(c,x))):r.push(i(c,o))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,t){typeof e=="string"&&(e=this.getEvent(e));const r=[],i=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Ze.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((s,c)=>{const x=t[c];if(s.indexed)if(s.type==="string")r.push(_r(x));else if(s.type==="bytes")r.push(je(x));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");r.push(this._abiCoder.encode([s.type],[x]))}else i.push(s),o.push(x)}),{data:this._abiCoder.encode(i,o),topics:r}}decodeEventLog(e,t,r){if(typeof e=="string"&&(e=this.getEvent(e)),r!=null&&!e.anonymous){let C=this.getEventTopic(e);(!ve(r[0],32)||r[0].toLowerCase()!==C)&&Ze.throwError("fragment/topic mismatch",O.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:C,value:r[0]}),r=r.slice(1)}let i=[],o=[],s=[];e.inputs.forEach((C,G)=>{C.indexed?C.type==="string"||C.type==="bytes"||C.baseType==="tuple"||C.baseType==="array"?(i.push(ct.fromObject({type:"bytes32",name:C.name})),s.push(!0)):(i.push(C),s.push(!1)):(o.push(C),s.push(!1))});let c=r!=null?this._abiCoder.decode(i,rt(r)):null,x=this._abiCoder.decode(o,t,!0),g=[],w=0,M=0;e.inputs.forEach((C,G)=>{if(C.indexed)if(c==null)g[G]=new Zn({_isIndexed:!0,hash:null});else if(s[G])g[G]=new Zn({_isIndexed:!0,hash:c[M++]});else try{g[G]=c[M++]}catch(H){g[G]=H}else try{g[G]=x[w++]}catch(H){g[G]=H}if(C.name&&g[C.name]==null){const H=g[G];H instanceof Error?Object.defineProperty(g,C.name,{enumerable:!0,get:()=>{throw s0(`property ${JSON.stringify(C.name)}`,H)}}):g[C.name]=H}});for(let C=0;C<g.length;C++){const G=g[C];G instanceof Error&&Object.defineProperty(g,C,{enumerable:!0,get:()=>{throw s0(`index ${C}`,G)}})}return Object.freeze(g)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Gs({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:ee.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Ls({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=re(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new Zf({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const ec="abstract-provider/5.8.0";var tc=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const rc=new O(ec);class nc extends Gr{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class In{constructor(){rc.checkAbstract(new.target,In),Q(this,"_isProvider",!0)}getFeeData(){return tc(this,void 0,void 0,function*(){const{block:e,gasPrice:t}=yield Te({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(s=>null)});let r=null,i=null,o=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,o=ee.from("1500000000"),i=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:r,maxFeePerGas:i,maxPriorityFeePerGas:o,gasPrice:t}})}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!!(e&&e._isProvider)}}const ic="abstract-signer/5.8.0";var Dt=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const Bt=new O(ic),oc=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],sc=[O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED];let qs=class zs{constructor(){Bt.checkAbstract(new.target,zs),Q(this,"_isSigner",!0)}getBalance(e){return Dt(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Dt(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Dt(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const t=yield Te(this.checkTransaction(e));return yield this.provider.estimateGas(t)})}call(e,t){return Dt(this,void 0,void 0,function*(){this._checkProvider("call");const r=yield Te(this.checkTransaction(e));return yield this.provider.call(r,t)})}sendTransaction(e){return Dt(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)})}getChainId(){return Dt(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Dt(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Dt(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Dt(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const r in e)oc.indexOf(r)===-1&&Bt.throwArgumentError("invalid transaction key: "+r,"transaction",e);const t=nt(e);return t.from==null?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then(r=>(r[0].toLowerCase()!==r[1].toLowerCase()&&Bt.throwArgumentError("from address mismatch","transaction",e),r[0])),t}populateTransaction(e){return Dt(this,void 0,void 0,function*(){const t=yield Te(this.checkTransaction(e));t.to!=null&&(t.to=Promise.resolve(t.to).then(i=>Dt(this,void 0,void 0,function*(){if(i==null)return null;const o=yield this.resolveName(i);return o==null&&Bt.throwArgumentError("provided ENS name resolves to null","tx.to",i),o})),t.to.catch(i=>{}));const r=t.maxFeePerGas!=null||t.maxPriorityFeePerGas!=null;if(t.gasPrice!=null&&(t.type===2||r)?Bt.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(t.type===0||t.type===1)&&r&&Bt.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(t.type===2||t.type==null)&&t.maxFeePerGas!=null&&t.maxPriorityFeePerGas!=null)t.type=2;else if(t.type===0||t.type===1)t.gasPrice==null&&(t.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(t.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(t.type=2,t.gasPrice!=null){const o=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=o,t.maxPriorityFeePerGas=o}else t.maxFeePerGas==null&&(t.maxFeePerGas=i.maxFeePerGas),t.maxPriorityFeePerGas==null&&(t.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(r&&Bt.throwError("network does not support EIP-1559",O.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),t.gasPrice==null&&(t.gasPrice=i.gasPrice),t.type=0):Bt.throwError("failed to get consistent fee data",O.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else t.type===2&&(t.maxFeePerGas==null&&(t.maxFeePerGas=i.maxFeePerGas),t.maxPriorityFeePerGas==null&&(t.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return t.nonce==null&&(t.nonce=this.getTransactionCount("pending")),t.gasLimit==null&&(t.gasLimit=this.estimateGas(t).catch(i=>{if(sc.indexOf(i.code)>=0)throw i;return Bt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:t})})),t.chainId==null?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Bt.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Te(t)})}_checkProvider(e){this.provider||Bt.throwError("missing provider",O.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};class vo extends qs{constructor(e,t){super(),Q(this,"address",e),Q(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then(()=>{Bt.throwError(e,O.errors.UNSUPPORTED_OPERATION,{operation:t})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new vo(this.address,e)}}var Ti={},qe={},Fi,a0;function kn(){if(a0)return Fi;a0=1,Fi=n;function n(e,t){if(!e)throw new Error(t||"Assertion failed")}return n.equal=function(t,r,i){if(t!=r)throw new Error(i||"Assertion failed: "+t+" != "+r)},Fi}var Fn={exports:{}},f0;function ac(){return f0||(f0=1,typeof Object.create=="function"?Fn.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Fn.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),Fn.exports}var c0;function ar(){if(c0)return qe;c0=1;var n=kn(),e=ac();qe.inherits=e;function t(P,m){return(P.charCodeAt(m)&64512)!==55296||m<0||m+1>=P.length?!1:(P.charCodeAt(m+1)&64512)===56320}function r(P,m){if(Array.isArray(P))return P.slice();if(!P)return[];var a=[];if(typeof P=="string")if(m){if(m==="hex")for(P=P.replace(/[^a-z0-9]+/ig,""),P.length%2!==0&&(P="0"+P),b=0;b<P.length;b+=2)a.push(parseInt(P[b]+P[b+1],16))}else for(var d=0,b=0;b<P.length;b++){var y=P.charCodeAt(b);y<128?a[d++]=y:y<2048?(a[d++]=y>>6|192,a[d++]=y&63|128):t(P,b)?(y=65536+((y&1023)<<10)+(P.charCodeAt(++b)&1023),a[d++]=y>>18|240,a[d++]=y>>12&63|128,a[d++]=y>>6&63|128,a[d++]=y&63|128):(a[d++]=y>>12|224,a[d++]=y>>6&63|128,a[d++]=y&63|128)}else for(b=0;b<P.length;b++)a[b]=P[b]|0;return a}qe.toArray=r;function i(P){for(var m="",a=0;a<P.length;a++)m+=c(P[a].toString(16));return m}qe.toHex=i;function o(P){var m=P>>>24|P>>>8&65280|P<<8&16711680|(P&255)<<24;return m>>>0}qe.htonl=o;function s(P,m){for(var a="",d=0;d<P.length;d++){var b=P[d];m==="little"&&(b=o(b)),a+=x(b.toString(16))}return a}qe.toHex32=s;function c(P){return P.length===1?"0"+P:P}qe.zero2=c;function x(P){return P.length===7?"0"+P:P.length===6?"00"+P:P.length===5?"000"+P:P.length===4?"0000"+P:P.length===3?"00000"+P:P.length===2?"000000"+P:P.length===1?"0000000"+P:P}qe.zero8=x;function g(P,m,a,d){var b=a-m;n(b%4===0);for(var y=new Array(b/4),E=0,I=m;E<y.length;E++,I+=4){var R;d==="big"?R=P[I]<<24|P[I+1]<<16|P[I+2]<<8|P[I+3]:R=P[I+3]<<24|P[I+2]<<16|P[I+1]<<8|P[I],y[E]=R>>>0}return y}qe.join32=g;function w(P,m){for(var a=new Array(P.length*4),d=0,b=0;d<P.length;d++,b+=4){var y=P[d];m==="big"?(a[b]=y>>>24,a[b+1]=y>>>16&255,a[b+2]=y>>>8&255,a[b+3]=y&255):(a[b+3]=y>>>24,a[b+2]=y>>>16&255,a[b+1]=y>>>8&255,a[b]=y&255)}return a}qe.split32=w;function M(P,m){return P>>>m|P<<32-m}qe.rotr32=M;function C(P,m){return P<<m|P>>>32-m}qe.rotl32=C;function G(P,m){return P+m>>>0}qe.sum32=G;function H(P,m,a){return P+m+a>>>0}qe.sum32_3=H;function k(P,m,a,d){return P+m+a+d>>>0}qe.sum32_4=k;function S(P,m,a,d,b){return P+m+a+d+b>>>0}qe.sum32_5=S;function T(P,m,a,d){var b=P[m],y=P[m+1],E=d+y>>>0,I=(E<d?1:0)+a+b;P[m]=I>>>0,P[m+1]=E}qe.sum64=T;function D(P,m,a,d){var b=m+d>>>0,y=(b<m?1:0)+P+a;return y>>>0}qe.sum64_hi=D;function U(P,m,a,d){var b=m+d;return b>>>0}qe.sum64_lo=U;function q(P,m,a,d,b,y,E,I){var R=0,p=m;p=p+d>>>0,R+=p<m?1:0,p=p+y>>>0,R+=p<y?1:0,p=p+I>>>0,R+=p<I?1:0;var f=P+a+b+E+R;return f>>>0}qe.sum64_4_hi=q;function z(P,m,a,d,b,y,E,I){var R=m+d+y+I;return R>>>0}qe.sum64_4_lo=z;function j(P,m,a,d,b,y,E,I,R,p){var f=0,A=m;A=A+d>>>0,f+=A<m?1:0,A=A+y>>>0,f+=A<y?1:0,A=A+I>>>0,f+=A<I?1:0,A=A+p>>>0,f+=A<p?1:0;var B=P+a+b+E+R+f;return B>>>0}qe.sum64_5_hi=j;function Y(P,m,a,d,b,y,E,I,R,p){var f=m+d+y+I+p;return f>>>0}qe.sum64_5_lo=Y;function X(P,m,a){var d=m<<32-a|P>>>a;return d>>>0}qe.rotr64_hi=X;function ie(P,m,a){var d=P<<32-a|m>>>a;return d>>>0}qe.rotr64_lo=ie;function se(P,m,a){return P>>>a}qe.shr64_hi=se;function ne(P,m,a){var d=P<<32-a|m>>>a;return d>>>0}return qe.shr64_lo=ne,qe}var Oi={},u0;function Cn(){if(u0)return Oi;u0=1;var n=ar(),e=kn();function t(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return Oi.BlockHash=t,t.prototype.update=function(i,o){if(i=n.toArray(i,o),this.pending?this.pending=this.pending.concat(i):this.pending=i,this.pendingTotal+=i.length,this.pending.length>=this._delta8){i=this.pending;var s=i.length%this._delta8;this.pending=i.slice(i.length-s,i.length),this.pending.length===0&&(this.pending=null),i=n.join32(i,0,i.length-s,this.endian);for(var c=0;c<i.length;c+=this._delta32)this._update(i,c,c+this._delta32)}return this},t.prototype.digest=function(i){return this.update(this._pad()),e(this.pending===null),this._digest(i)},t.prototype._pad=function(){var i=this.pendingTotal,o=this._delta8,s=o-(i+this.padLength)%o,c=new Array(s+this.padLength);c[0]=128;for(var x=1;x<s;x++)c[x]=0;if(i<<=3,this.endian==="big"){for(var g=8;g<this.padLength;g++)c[x++]=0;c[x++]=0,c[x++]=0,c[x++]=0,c[x++]=0,c[x++]=i>>>24&255,c[x++]=i>>>16&255,c[x++]=i>>>8&255,c[x++]=i&255}else for(c[x++]=i&255,c[x++]=i>>>8&255,c[x++]=i>>>16&255,c[x++]=i>>>24&255,c[x++]=0,c[x++]=0,c[x++]=0,c[x++]=0,g=8;g<this.padLength;g++)c[x++]=0;return c},Oi}var Nr={},Xt={},h0;function Hs(){if(h0)return Xt;h0=1;var n=ar(),e=n.rotr32;function t(w,M,C,G){if(w===0)return r(M,C,G);if(w===1||w===3)return o(M,C,G);if(w===2)return i(M,C,G)}Xt.ft_1=t;function r(w,M,C){return w&M^~w&C}Xt.ch32=r;function i(w,M,C){return w&M^w&C^M&C}Xt.maj32=i;function o(w,M,C){return w^M^C}Xt.p32=o;function s(w){return e(w,2)^e(w,13)^e(w,22)}Xt.s0_256=s;function c(w){return e(w,6)^e(w,11)^e(w,25)}Xt.s1_256=c;function x(w){return e(w,7)^e(w,18)^w>>>3}Xt.g0_256=x;function g(w){return e(w,17)^e(w,19)^w>>>10}return Xt.g1_256=g,Xt}var Di,l0;function fc(){if(l0)return Di;l0=1;var n=ar(),e=Cn(),t=Hs(),r=n.rotl32,i=n.sum32,o=n.sum32_5,s=t.ft_1,c=e.BlockHash,x=[1518500249,1859775393,2400959708,3395469782];function g(){if(!(this instanceof g))return new g;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return n.inherits(g,c),Di=g,g.blockSize=512,g.outSize=160,g.hmacStrength=80,g.padLength=64,g.prototype._update=function(M,C){for(var G=this.W,H=0;H<16;H++)G[H]=M[C+H];for(;H<G.length;H++)G[H]=r(G[H-3]^G[H-8]^G[H-14]^G[H-16],1);var k=this.h[0],S=this.h[1],T=this.h[2],D=this.h[3],U=this.h[4];for(H=0;H<G.length;H++){var q=~~(H/20),z=o(r(k,5),s(q,S,T,D),U,G[H],x[q]);U=D,D=T,T=r(S,30),S=k,k=z}this.h[0]=i(this.h[0],k),this.h[1]=i(this.h[1],S),this.h[2]=i(this.h[2],T),this.h[3]=i(this.h[3],D),this.h[4]=i(this.h[4],U)},g.prototype._digest=function(M){return M==="hex"?n.toHex32(this.h,"big"):n.split32(this.h,"big")},Di}var Ui,d0;function Ks(){if(d0)return Ui;d0=1;var n=ar(),e=Cn(),t=Hs(),r=kn(),i=n.sum32,o=n.sum32_4,s=n.sum32_5,c=t.ch32,x=t.maj32,g=t.s0_256,w=t.s1_256,M=t.g0_256,C=t.g1_256,G=e.BlockHash,H=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function k(){if(!(this instanceof k))return new k;G.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=H,this.W=new Array(64)}return n.inherits(k,G),Ui=k,k.blockSize=512,k.outSize=256,k.hmacStrength=192,k.padLength=64,k.prototype._update=function(T,D){for(var U=this.W,q=0;q<16;q++)U[q]=T[D+q];for(;q<U.length;q++)U[q]=o(C(U[q-2]),U[q-7],M(U[q-15]),U[q-16]);var z=this.h[0],j=this.h[1],Y=this.h[2],X=this.h[3],ie=this.h[4],se=this.h[5],ne=this.h[6],P=this.h[7];for(r(this.k.length===U.length),q=0;q<U.length;q++){var m=s(P,w(ie),c(ie,se,ne),this.k[q],U[q]),a=i(g(z),x(z,j,Y));P=ne,ne=se,se=ie,ie=i(X,m),X=Y,Y=j,j=z,z=i(m,a)}this.h[0]=i(this.h[0],z),this.h[1]=i(this.h[1],j),this.h[2]=i(this.h[2],Y),this.h[3]=i(this.h[3],X),this.h[4]=i(this.h[4],ie),this.h[5]=i(this.h[5],se),this.h[6]=i(this.h[6],ne),this.h[7]=i(this.h[7],P)},k.prototype._digest=function(T){return T==="hex"?n.toHex32(this.h,"big"):n.split32(this.h,"big")},Ui}var Li,x0;function cc(){if(x0)return Li;x0=1;var n=ar(),e=Ks();function t(){if(!(this instanceof t))return new t;e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return n.inherits(t,e),Li=t,t.blockSize=512,t.outSize=224,t.hmacStrength=192,t.padLength=64,t.prototype._digest=function(i){return i==="hex"?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")},Li}var Gi,p0;function Js(){if(p0)return Gi;p0=1;var n=ar(),e=Cn(),t=kn(),r=n.rotr64_hi,i=n.rotr64_lo,o=n.shr64_hi,s=n.shr64_lo,c=n.sum64,x=n.sum64_hi,g=n.sum64_lo,w=n.sum64_4_hi,M=n.sum64_4_lo,C=n.sum64_5_hi,G=n.sum64_5_lo,H=e.BlockHash,k=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function S(){if(!(this instanceof S))return new S;H.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=k,this.W=new Array(160)}n.inherits(S,H),Gi=S,S.blockSize=1024,S.outSize=512,S.hmacStrength=192,S.padLength=128,S.prototype._prepareBlock=function(a,d){for(var b=this.W,y=0;y<32;y++)b[y]=a[d+y];for(;y<b.length;y+=2){var E=ne(b[y-4],b[y-3]),I=P(b[y-4],b[y-3]),R=b[y-14],p=b[y-13],f=ie(b[y-30],b[y-29]),A=se(b[y-30],b[y-29]),B=b[y-32],l=b[y-31];b[y]=w(E,I,R,p,f,A,B,l),b[y+1]=M(E,I,R,p,f,A,B,l)}},S.prototype._update=function(a,d){this._prepareBlock(a,d);var b=this.W,y=this.h[0],E=this.h[1],I=this.h[2],R=this.h[3],p=this.h[4],f=this.h[5],A=this.h[6],B=this.h[7],l=this.h[8],N=this.h[9],J=this.h[10],K=this.h[11],W=this.h[12],oe=this.h[13],$=this.h[14],te=this.h[15];t(this.k.length===b.length);for(var _e=0;_e<b.length;_e+=2){var ae=$,ue=te,pt=Y(l,N),we=X(l,N),ke=T(l,N,J,K,W),Nt=D(l,N,J,K,W,oe),Ce=this.k[_e],Ne=this.k[_e+1],Fe=b[_e],be=b[_e+1],Ae=C(ae,ue,pt,we,ke,Nt,Ce,Ne,Fe,be),wt=G(ae,ue,pt,we,ke,Nt,Ce,Ne,Fe,be);ae=z(y,E),ue=j(y,E),pt=U(y,E,I,R,p),we=q(y,E,I,R,p,f);var Pe=x(ae,ue,pt,we),Me=g(ae,ue,pt,we);$=W,te=oe,W=J,oe=K,J=l,K=N,l=x(A,B,Ae,wt),N=g(B,B,Ae,wt),A=p,B=f,p=I,f=R,I=y,R=E,y=x(Ae,wt,Pe,Me),E=g(Ae,wt,Pe,Me)}c(this.h,0,y,E),c(this.h,2,I,R),c(this.h,4,p,f),c(this.h,6,A,B),c(this.h,8,l,N),c(this.h,10,J,K),c(this.h,12,W,oe),c(this.h,14,$,te)},S.prototype._digest=function(a){return a==="hex"?n.toHex32(this.h,"big"):n.split32(this.h,"big")};function T(m,a,d,b,y){var E=m&d^~m&y;return E<0&&(E+=4294967296),E}function D(m,a,d,b,y,E){var I=a&b^~a&E;return I<0&&(I+=4294967296),I}function U(m,a,d,b,y){var E=m&d^m&y^d&y;return E<0&&(E+=4294967296),E}function q(m,a,d,b,y,E){var I=a&b^a&E^b&E;return I<0&&(I+=4294967296),I}function z(m,a){var d=r(m,a,28),b=r(a,m,2),y=r(a,m,7),E=d^b^y;return E<0&&(E+=4294967296),E}function j(m,a){var d=i(m,a,28),b=i(a,m,2),y=i(a,m,7),E=d^b^y;return E<0&&(E+=4294967296),E}function Y(m,a){var d=r(m,a,14),b=r(m,a,18),y=r(a,m,9),E=d^b^y;return E<0&&(E+=4294967296),E}function X(m,a){var d=i(m,a,14),b=i(m,a,18),y=i(a,m,9),E=d^b^y;return E<0&&(E+=4294967296),E}function ie(m,a){var d=r(m,a,1),b=r(m,a,8),y=o(m,a,7),E=d^b^y;return E<0&&(E+=4294967296),E}function se(m,a){var d=i(m,a,1),b=i(m,a,8),y=s(m,a,7),E=d^b^y;return E<0&&(E+=4294967296),E}function ne(m,a){var d=r(m,a,19),b=r(a,m,29),y=o(m,a,6),E=d^b^y;return E<0&&(E+=4294967296),E}function P(m,a){var d=i(m,a,19),b=i(a,m,29),y=s(m,a,6),E=d^b^y;return E<0&&(E+=4294967296),E}return Gi}var qi,b0;function uc(){if(b0)return qi;b0=1;var n=ar(),e=Js();function t(){if(!(this instanceof t))return new t;e.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return n.inherits(t,e),qi=t,t.blockSize=1024,t.outSize=384,t.hmacStrength=192,t.padLength=128,t.prototype._digest=function(i){return i==="hex"?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")},qi}var g0;function hc(){return g0||(g0=1,Nr.sha1=fc(),Nr.sha224=cc(),Nr.sha256=Ks(),Nr.sha384=uc(),Nr.sha512=Js()),Nr}var zi={},m0;function lc(){if(m0)return zi;m0=1;var n=ar(),e=Cn(),t=n.rotl32,r=n.sum32,i=n.sum32_3,o=n.sum32_4,s=e.BlockHash;function c(){if(!(this instanceof c))return new c;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}n.inherits(c,s),zi.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(S,T){for(var D=this.h[0],U=this.h[1],q=this.h[2],z=this.h[3],j=this.h[4],Y=D,X=U,ie=q,se=z,ne=j,P=0;P<80;P++){var m=r(t(o(D,x(P,U,q,z),S[M[P]+T],g(P)),G[P]),j);D=j,j=z,z=t(q,10),q=U,U=m,m=r(t(o(Y,x(79-P,X,ie,se),S[C[P]+T],w(P)),H[P]),ne),Y=ne,ne=se,se=t(ie,10),ie=X,X=m}m=i(this.h[1],q,se),this.h[1]=i(this.h[2],z,ne),this.h[2]=i(this.h[3],j,Y),this.h[3]=i(this.h[4],D,X),this.h[4]=i(this.h[0],U,ie),this.h[0]=m},c.prototype._digest=function(S){return S==="hex"?n.toHex32(this.h,"little"):n.split32(this.h,"little")};function x(k,S,T,D){return k<=15?S^T^D:k<=31?S&T|~S&D:k<=47?(S|~T)^D:k<=63?S&D|T&~D:S^(T|~D)}function g(k){return k<=15?0:k<=31?1518500249:k<=47?1859775393:k<=63?2400959708:2840853838}function w(k){return k<=15?1352829926:k<=31?1548603684:k<=47?1836072691:k<=63?2053994217:0}var M=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],C=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],G=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],H=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return zi}var Hi,y0;function dc(){if(y0)return Hi;y0=1;var n=ar(),e=kn();function t(r,i,o){if(!(this instanceof t))return new t(r,i,o);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(i,o))}return Hi=t,t.prototype._init=function(i){i.length>this.blockSize&&(i=new this.Hash().update(i).digest()),e(i.length<=this.blockSize);for(var o=i.length;o<this.blockSize;o++)i.push(0);for(o=0;o<i.length;o++)i[o]^=54;for(this.inner=new this.Hash().update(i),o=0;o<i.length;o++)i[o]^=106;this.outer=new this.Hash().update(i)},t.prototype.update=function(i,o){return this.inner.update(i,o),this},t.prototype.digest=function(i){return this.outer.update(this.inner.digest()),this.outer.digest(i)},Hi}var v0;function xc(){return v0||(v0=1,(function(n){var e=n;e.utils=ar(),e.common=Cn(),e.sha=hc(),e.ripemd=lc(),e.hmac=dc(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160})(Ti)),Ti}var pc=xc();const Mt=sn(pc);function fn(n,e,t){return t={path:e,exports:{},require:function(r,i){return bc(r,i??t.path)}},n(t,t.exports),t.exports}function bc(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var wo=Vs;function Vs(n,e){if(!n)throw new Error(e||"Assertion failed")}Vs.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var jt=fn(function(n,e){var t=e;function r(s,c){if(Array.isArray(s))return s.slice();if(!s)return[];var x=[];if(typeof s!="string"){for(var g=0;g<s.length;g++)x[g]=s[g]|0;return x}if(c==="hex"){s=s.replace(/[^a-z0-9]+/ig,""),s.length%2!==0&&(s="0"+s);for(var g=0;g<s.length;g+=2)x.push(parseInt(s[g]+s[g+1],16))}else for(var g=0;g<s.length;g++){var w=s.charCodeAt(g),M=w>>8,C=w&255;M?x.push(M,C):x.push(C)}return x}t.toArray=r;function i(s){return s.length===1?"0"+s:s}t.zero2=i;function o(s){for(var c="",x=0;x<s.length;x++)c+=i(s[x].toString(16));return c}t.toHex=o,t.encode=function(c,x){return x==="hex"?o(c):c}}),Ct=fn(function(n,e){var t=e;t.assert=wo,t.toArray=jt.toArray,t.zero2=jt.zero2,t.toHex=jt.toHex,t.encode=jt.encode;function r(x,g,w){var M=new Array(Math.max(x.bitLength(),w)+1),C;for(C=0;C<M.length;C+=1)M[C]=0;var G=1<<g+1,H=x.clone();for(C=0;C<M.length;C++){var k,S=H.andln(G-1);H.isOdd()?(S>(G>>1)-1?k=(G>>1)-S:k=S,H.isubn(k)):k=0,M[C]=k,H.iushrn(1)}return M}t.getNAF=r;function i(x,g){var w=[[],[]];x=x.clone(),g=g.clone();for(var M=0,C=0,G;x.cmpn(-M)>0||g.cmpn(-C)>0;){var H=x.andln(3)+M&3,k=g.andln(3)+C&3;H===3&&(H=-1),k===3&&(k=-1);var S;(H&1)===0?S=0:(G=x.andln(7)+M&7,(G===3||G===5)&&k===2?S=-H:S=H),w[0].push(S);var T;(k&1)===0?T=0:(G=g.andln(7)+C&7,(G===3||G===5)&&H===2?T=-k:T=k),w[1].push(T),2*M===S+1&&(M=1-M),2*C===T+1&&(C=1-C),x.iushrn(1),g.iushrn(1)}return w}t.getJSF=i;function o(x,g,w){var M="_"+g;x.prototype[g]=function(){return this[M]!==void 0?this[M]:this[M]=w.call(this)}}t.cachedProperty=o;function s(x){return typeof x=="string"?t.toArray(x,"hex"):x}t.parseBytes=s;function c(x){return new de(x,"hex","le")}t.intFromLE=c}),$n=Ct.getNAF,gc=Ct.getJSF,ei=Ct.assert;function kr(n,e){this.type=n,this.p=new de(e.p,16),this.red=e.prime?de.red(e.prime):de.mont(this.p),this.zero=new de(0).toRed(this.red),this.one=new de(1).toRed(this.red),this.two=new de(2).toRed(this.red),this.n=e.n&&new de(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var qr=kr;kr.prototype.point=function(){throw new Error("Not implemented")};kr.prototype.validate=function(){throw new Error("Not implemented")};kr.prototype._fixedNafMul=function(e,t){ei(e.precomputed);var r=e._getDoubles(),i=$n(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2===0?2:1);o/=3;var s=[],c,x;for(c=0;c<i.length;c+=r.step){x=0;for(var g=c+r.step-1;g>=c;g--)x=(x<<1)+i[g];s.push(x)}for(var w=this.jpoint(null,null,null),M=this.jpoint(null,null,null),C=o;C>0;C--){for(c=0;c<s.length;c++)x=s[c],x===C?M=M.mixedAdd(r.points[c]):x===-C&&(M=M.mixedAdd(r.points[c].neg()));w=w.add(M)}return w.toP()};kr.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var o=i.points,s=$n(t,r,this._bitLength),c=this.jpoint(null,null,null),x=s.length-1;x>=0;x--){for(var g=0;x>=0&&s[x]===0;x--)g++;if(x>=0&&g++,c=c.dblp(g),x<0)break;var w=s[x];ei(w!==0),e.type==="affine"?w>0?c=c.mixedAdd(o[w-1>>1]):c=c.mixedAdd(o[-w-1>>1].neg()):w>0?c=c.add(o[w-1>>1]):c=c.add(o[-w-1>>1].neg())}return e.type==="affine"?c.toP():c};kr.prototype._wnafMulAdd=function(e,t,r,i,o){var s=this._wnafT1,c=this._wnafT2,x=this._wnafT3,g=0,w,M,C;for(w=0;w<i;w++){C=t[w];var G=C._getNAFPoints(e);s[w]=G.wnd,c[w]=G.points}for(w=i-1;w>=1;w-=2){var H=w-1,k=w;if(s[H]!==1||s[k]!==1){x[H]=$n(r[H],s[H],this._bitLength),x[k]=$n(r[k],s[k],this._bitLength),g=Math.max(x[H].length,g),g=Math.max(x[k].length,g);continue}var S=[t[H],null,null,t[k]];t[H].y.cmp(t[k].y)===0?(S[1]=t[H].add(t[k]),S[2]=t[H].toJ().mixedAdd(t[k].neg())):t[H].y.cmp(t[k].y.redNeg())===0?(S[1]=t[H].toJ().mixedAdd(t[k]),S[2]=t[H].add(t[k].neg())):(S[1]=t[H].toJ().mixedAdd(t[k]),S[2]=t[H].toJ().mixedAdd(t[k].neg()));var T=[-3,-1,-5,-7,0,7,5,1,3],D=gc(r[H],r[k]);for(g=Math.max(D[0].length,g),x[H]=new Array(g),x[k]=new Array(g),M=0;M<g;M++){var U=D[0][M]|0,q=D[1][M]|0;x[H][M]=T[(U+1)*3+(q+1)],x[k][M]=0,c[H]=S}}var z=this.jpoint(null,null,null),j=this._wnafT4;for(w=g;w>=0;w--){for(var Y=0;w>=0;){var X=!0;for(M=0;M<i;M++)j[M]=x[M][w]|0,j[M]!==0&&(X=!1);if(!X)break;Y++,w--}if(w>=0&&Y++,z=z.dblp(Y),w<0)break;for(M=0;M<i;M++){var ie=j[M];ie!==0&&(ie>0?C=c[M][ie-1>>1]:ie<0&&(C=c[M][-ie-1>>1].neg()),C.type==="affine"?z=z.mixedAdd(C):z=z.add(C))}}for(w=0;w<i;w++)c[w]=null;return o?z:z.toP()};function Ft(n,e){this.curve=n,this.type=e,this.precomputed=null}kr.BasePoint=Ft;Ft.prototype.eq=function(){throw new Error("Not implemented")};Ft.prototype.validate=function(){return this.curve.validate(this)};kr.prototype.decodePoint=function(e,t){e=Ct.toArray(e,t);var r=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*r){e[0]===6?ei(e[e.length-1]%2===0):e[0]===7&&ei(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));return i}else if((e[0]===2||e[0]===3)&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),e[0]===3);throw new Error("Unknown point format")};Ft.prototype.encodeCompressed=function(e){return this.encode(e,!0)};Ft.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))};Ft.prototype.encode=function(e,t){return Ct.encode(this._encode(t),e)};Ft.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this};Ft.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1};Ft.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,o=0;o<t;o+=e){for(var s=0;s<e;s++)i=i.dbl();r.push(i)}return{step:e,points:r}};Ft.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=r===1?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(i);return{wnd:e,points:t}};Ft.prototype._getBeta=function(){return null};Ft.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Ao=fn(function(n){typeof Object.create=="function"?n.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:n.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}}),mc=Ct.assert;function Ot(n){qr.call(this,"short",n),this.a=new de(n.a,16).toRed(this.red),this.b=new de(n.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(n),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Ao(Ot,qr);var yc=Ot;Ot.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,r;if(e.beta)t=new de(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)r=new de(e.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))===0?r=o[0]:(r=o[1],mc(this.g.mul(r).x.cmp(this.g.x.redMul(t))===0))}var s;return e.basis?s=e.basis.map(function(c){return{a:new de(c.a,16),b:new de(c.b,16)}}):s=this._getEndoBasis(r),{beta:t,lambda:r,basis:s}}};Ot.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:de.mont(e),r=new de(2).toRed(t).redInvm(),i=r.redNeg(),o=new de(3).toRed(t).redNeg().redSqrt().redMul(r),s=i.redAdd(o).fromRed(),c=i.redSub(o).fromRed();return[s,c]};Ot.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),r=e,i=this.n.clone(),o=new de(1),s=new de(0),c=new de(0),x=new de(1),g,w,M,C,G,H,k,S=0,T,D;r.cmpn(0)!==0;){var U=i.div(r);T=i.sub(U.mul(r)),D=c.sub(U.mul(o));var q=x.sub(U.mul(s));if(!M&&T.cmp(t)<0)g=k.neg(),w=o,M=T.neg(),C=D;else if(M&&++S===2)break;k=T,i=r,r=T,c=o,o=D,x=s,s=q}G=T.neg(),H=D;var z=M.sqr().add(C.sqr()),j=G.sqr().add(H.sqr());return j.cmp(z)>=0&&(G=g,H=w),M.negative&&(M=M.neg(),C=C.neg()),G.negative&&(G=G.neg(),H=H.neg()),[{a:M,b:C},{a:G,b:H}]};Ot.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],o=i.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),c=o.mul(r.a),x=s.mul(i.a),g=o.mul(r.b),w=s.mul(i.b),M=e.sub(c).sub(x),C=g.add(w).neg();return{k1:M,k2:C}};Ot.prototype.pointFromX=function(e,t){e=new de(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(i.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var o=i.fromRed().isOdd();return(t&&!o||!t&&o)&&(i=i.redNeg()),this.point(e,i)};Ot.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(o).cmpn(0)===0};Ot.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,o=this._endoWnafT2,s=0;s<e.length;s++){var c=this._endoSplit(t[s]),x=e[s],g=x._getBeta();c.k1.negative&&(c.k1.ineg(),x=x.neg(!0)),c.k2.negative&&(c.k2.ineg(),g=g.neg(!0)),i[s*2]=x,i[s*2+1]=g,o[s*2]=c.k1,o[s*2+1]=c.k2}for(var w=this._wnafMulAdd(1,i,o,s*2,r),M=0;M<s*2;M++)i[M]=null,o[M]=null;return w};function lt(n,e,t,r){qr.BasePoint.call(this,n,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new de(e,16),this.y=new de(t,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}Ao(lt,qr.BasePoint);Ot.prototype.point=function(e,t,r){return new lt(this,e,t,r)};Ot.prototype.pointFromJSON=function(e,t){return lt.fromJSON(this,e,t)};lt.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(o){return r.point(o.x.redMul(r.endo.beta),o.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}};lt.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};lt.fromJSON=function(e,t,r){typeof t=="string"&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function o(c){return e.point(c[0],c[1],r)}var s=t[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(o))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(o))}},i};lt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};lt.prototype.isInfinity=function(){return this.inf};lt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)};lt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),s=o.redSqr().redISub(this.x.redAdd(this.x)),c=o.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,c)};lt.prototype.getX=function(){return this.x.fromRed()};lt.prototype.getY=function(){return this.y.fromRed()};lt.prototype.mul=function(e){return e=new de(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};lt.prototype.mulAdd=function(e,t,r){var i=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,o):this.curve._wnafMulAdd(1,i,o,2)};lt.prototype.jmulAdd=function(e,t,r){var i=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,o,!0):this.curve._wnafMulAdd(1,i,o,2,!0)};lt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};lt.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(o){return o.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t};lt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function xt(n,e,t,r){qr.BasePoint.call(this,n,"jacobian"),e===null&&t===null&&r===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new de(0)):(this.x=new de(e,16),this.y=new de(t,16),this.z=new de(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Ao(xt,qr.BasePoint);Ot.prototype.jpoint=function(e,t,r){return new xt(this,e,t,r)};xt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)};xt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};xt.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),o=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),c=e.y.redMul(r.redMul(this.z)),x=i.redSub(o),g=s.redSub(c);if(x.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=x.redSqr(),M=w.redMul(x),C=i.redMul(w),G=g.redSqr().redIAdd(M).redISub(C).redISub(C),H=g.redMul(C.redISub(G)).redISub(s.redMul(M)),k=this.z.redMul(e.z).redMul(x);return this.curve.jpoint(G,H,k)};xt.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),o=this.y,s=e.y.redMul(t).redMul(this.z),c=r.redSub(i),x=o.redSub(s);if(c.cmpn(0)===0)return x.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=c.redSqr(),w=g.redMul(c),M=r.redMul(g),C=x.redSqr().redIAdd(w).redISub(M).redISub(M),G=x.redMul(M.redISub(C)).redISub(o.redMul(w)),H=this.z.redMul(c);return this.curve.jpoint(C,G,H)};xt.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,o=this.curve.tinv,s=this.x,c=this.y,x=this.z,g=x.redSqr().redSqr(),w=c.redAdd(c);for(t=0;t<e;t++){var M=s.redSqr(),C=w.redSqr(),G=C.redSqr(),H=M.redAdd(M).redIAdd(M).redIAdd(i.redMul(g)),k=s.redMul(C),S=H.redSqr().redISub(k.redAdd(k)),T=k.redISub(S),D=H.redMul(T);D=D.redIAdd(D).redISub(G);var U=w.redMul(x);t+1<e&&(g=g.redMul(G)),s=S,x=U,w=D}return this.curve.jpoint(s,w.redMul(o),x)};xt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};xt.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr(),c=this.x.redAdd(o).redSqr().redISub(i).redISub(s);c=c.redIAdd(c);var x=i.redAdd(i).redIAdd(i),g=x.redSqr().redISub(c).redISub(c),w=s.redIAdd(s);w=w.redIAdd(w),w=w.redIAdd(w),e=g,t=x.redMul(c.redISub(g)).redISub(w),r=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),C=this.y.redSqr(),G=C.redSqr(),H=this.x.redAdd(C).redSqr().redISub(M).redISub(G);H=H.redIAdd(H);var k=M.redAdd(M).redIAdd(M),S=k.redSqr(),T=G.redIAdd(G);T=T.redIAdd(T),T=T.redIAdd(T),e=S.redISub(H).redISub(H),t=k.redMul(H.redISub(e)).redISub(T),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(e,t,r)};xt.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr(),c=this.x.redAdd(o).redSqr().redISub(i).redISub(s);c=c.redIAdd(c);var x=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),g=x.redSqr().redISub(c).redISub(c);e=g;var w=s.redIAdd(s);w=w.redIAdd(w),w=w.redIAdd(w),t=x.redMul(c.redISub(g)).redISub(w),r=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),C=this.y.redSqr(),G=this.x.redMul(C),H=this.x.redSub(M).redMul(this.x.redAdd(M));H=H.redAdd(H).redIAdd(H);var k=G.redIAdd(G);k=k.redIAdd(k);var S=k.redAdd(k);e=H.redSqr().redISub(S),r=this.y.redAdd(this.z).redSqr().redISub(C).redISub(M);var T=C.redSqr();T=T.redIAdd(T),T=T.redIAdd(T),T=T.redIAdd(T),t=H.redMul(k.redISub(e)).redISub(T)}return this.curve.jpoint(e,t,r)};xt.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,o=i.redSqr().redSqr(),s=t.redSqr(),c=r.redSqr(),x=s.redAdd(s).redIAdd(s).redIAdd(e.redMul(o)),g=t.redAdd(t);g=g.redIAdd(g);var w=g.redMul(c),M=x.redSqr().redISub(w.redAdd(w)),C=w.redISub(M),G=c.redSqr();G=G.redIAdd(G),G=G.redIAdd(G),G=G.redIAdd(G);var H=x.redMul(C).redISub(G),k=r.redAdd(r).redMul(i);return this.curve.jpoint(M,H,k)};xt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),o=e.redAdd(e).redIAdd(e),s=o.redSqr(),c=this.x.redAdd(t).redSqr().redISub(e).redISub(i);c=c.redIAdd(c),c=c.redAdd(c).redIAdd(c),c=c.redISub(s);var x=c.redSqr(),g=i.redIAdd(i);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var w=o.redIAdd(c).redSqr().redISub(s).redISub(x).redISub(g),M=t.redMul(w);M=M.redIAdd(M),M=M.redIAdd(M);var C=this.x.redMul(x).redISub(M);C=C.redIAdd(C),C=C.redIAdd(C);var G=this.y.redMul(w.redMul(g.redISub(w)).redISub(c.redMul(x)));G=G.redIAdd(G),G=G.redIAdd(G),G=G.redIAdd(G);var H=this.z.redAdd(c).redSqr().redISub(r).redISub(x);return this.curve.jpoint(C,G,H)};xt.prototype.mul=function(e,t){return e=new de(e,t),this.curve._wnafMul(this,e)};xt.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var i=t.redMul(this.z),o=r.redMul(e.z);return this.y.redMul(o).redISub(e.y.redMul(i)).cmpn(0)===0};xt.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(r)===0)return!0;for(var i=e.clone(),o=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),this.x.cmp(r)===0)return!0}};xt.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};xt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Hn=fn(function(n,e){var t=e;t.base=qr,t.short=yc,t.mont=null,t.edwards=null}),Kn=fn(function(n,e){var t=e,r=Ct.assert;function i(c){c.type==="short"?this.curve=new Hn.short(c):c.type==="edwards"?this.curve=new Hn.edwards(c):this.curve=new Hn.mont(c),this.g=this.curve.g,this.n=this.curve.n,this.hash=c.hash,r(this.g.validate(),"Invalid curve"),r(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=i;function o(c,x){Object.defineProperty(t,c,{configurable:!0,enumerable:!0,get:function(){var g=new i(x);return Object.defineProperty(t,c,{configurable:!0,enumerable:!0,value:g}),g}})}o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Mt.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Mt.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Mt.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Mt.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Mt.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Mt.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Mt.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=null.crash()}catch{s=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Mt.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})});function Mr(n){if(!(this instanceof Mr))return new Mr(n);this.hash=n.hash,this.predResist=!!n.predResist,this.outLen=this.hash.outSize,this.minEntropy=n.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=jt.toArray(n.entropy,n.entropyEnc||"hex"),t=jt.toArray(n.nonce,n.nonceEnc||"hex"),r=jt.toArray(n.pers,n.persEnc||"hex");wo(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,r)}var Ws=Mr;Mr.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};Mr.prototype._hmac=function(){return new Mt.hmac(this.hash,this.K)};Mr.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};Mr.prototype.reseed=function(e,t,r,i){typeof t!="string"&&(i=r,r=t,t=null),e=jt.toArray(e,t),r=jt.toArray(r,i),wo(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1};Mr.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=r,r=t,t=null),r&&(r=jt.toArray(r,i||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,jt.encode(s,t)};var so=Ct.assert;function vt(n,e){this.ec=n,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var Eo=vt;vt.fromPublic=function(e,t,r){return t instanceof vt?t:new vt(e,{pub:t,pubEnc:r})};vt.fromPrivate=function(e,t,r){return t instanceof vt?t:new vt(e,{priv:t,privEnc:r})};vt.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};vt.prototype.getPublic=function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub};vt.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};vt.prototype._importPrivate=function(e,t){this.priv=new de(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)};vt.prototype._importPublic=function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?so(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&so(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};vt.prototype.derive=function(e){return e.validate()||so(e.validate(),"public point not validated"),e.mul(this.priv).getX()};vt.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)};vt.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)};vt.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var vc=Ct.assert;function si(n,e){if(n instanceof si)return n;this._importDER(n,e)||(vc(n.r&&n.s,"Signature without r or s"),this.r=new de(n.r,16),this.s=new de(n.s,16),n.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=n.recoveryParam)}var ai=si;function wc(){this.place=0}function Ki(n,e){var t=n[e.place++];if(!(t&128))return t;var r=t&15;if(r===0||r>4||n[e.place]===0)return!1;for(var i=0,o=0,s=e.place;o<r;o++,s++)i<<=8,i|=n[s],i>>>=0;return i<=127?!1:(e.place=s,i)}function w0(n){for(var e=0,t=n.length-1;!n[e]&&!(n[e+1]&128)&&e<t;)e++;return e===0?n:n.slice(e)}si.prototype._importDER=function(e,t){e=Ct.toArray(e,t);var r=new wc;if(e[r.place++]!==48)return!1;var i=Ki(e,r);if(i===!1||i+r.place!==e.length||e[r.place++]!==2)return!1;var o=Ki(e,r);if(o===!1||(e[r.place]&128)!==0)return!1;var s=e.slice(r.place,o+r.place);if(r.place+=o,e[r.place++]!==2)return!1;var c=Ki(e,r);if(c===!1||e.length!==c+r.place||(e[r.place]&128)!==0)return!1;var x=e.slice(r.place,c+r.place);if(s[0]===0)if(s[1]&128)s=s.slice(1);else return!1;if(x[0]===0)if(x[1]&128)x=x.slice(1);else return!1;return this.r=new de(s),this.s=new de(x),this.recoveryParam=null,!0};function Ji(n,e){if(e<128){n.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(n.push(t|128);--t;)n.push(e>>>(t<<3)&255);n.push(e)}si.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),r[0]&128&&(r=[0].concat(r)),t=w0(t),r=w0(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var i=[2];Ji(i,t.length),i=i.concat(t),i.push(2),Ji(i,r.length);var o=i.concat(r),s=[48];return Ji(s,o.length),s=s.concat(o),Ct.encode(s,e)};var Ac=(function(){throw new Error("unsupported")}),Rr=Ct.assert;function Tt(n){if(!(this instanceof Tt))return new Tt(n);typeof n=="string"&&(Rr(Object.prototype.hasOwnProperty.call(Kn,n),"Unknown curve "+n),n=Kn[n]),n instanceof Kn.PresetCurve&&(n={curve:n}),this.curve=n.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=n.curve.g,this.g.precompute(n.curve.n.bitLength()+1),this.hash=n.hash||n.curve.hash}var Ec=Tt;Tt.prototype.keyPair=function(e){return new Eo(this,e)};Tt.prototype.keyFromPrivate=function(e,t){return Eo.fromPrivate(this,e,t)};Tt.prototype.keyFromPublic=function(e,t){return Eo.fromPublic(this,e,t)};Tt.prototype.genKeyPair=function(e){e||(e={});for(var t=new Ws({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Ac(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new de(2));;){var o=new de(t.generate(r));if(!(o.cmp(i)>0))return o.iaddn(1),this.keyFromPrivate(o)}};Tt.prototype._truncateToN=function(e,t,r){var i;if(de.isBN(e)||typeof e=="number")e=new de(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new de(e,16);else{var o=e.toString();i=o.length+1>>>1,e=new de(o,16)}typeof r!="number"&&(r=i*8);var s=r-this.n.bitLength();return s>0&&(e=e.ushrn(s)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e};Tt.prototype.sign=function(e,t,r,i){if(typeof r=="object"&&(i=r,r=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!de.isBN(e)){Rr(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),Rr(e.length>>>0===e.length);for(var o=0;o<e.length;o++)Rr((e[o]&255)===e[o])}t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,i.msgBitLength),Rr(!e.isNeg(),"Can not sign a negative message");var s=this.n.byteLength(),c=t.getPrivate().toArray("be",s),x=e.toArray("be",s);Rr(new de(x).eq(e),"Can not sign message");for(var g=new Ws({hash:this.hash,entropy:c,nonce:x,pers:i.pers,persEnc:i.persEnc||"utf8"}),w=this.n.sub(new de(1)),M=0;;M++){var C=i.k?i.k(M):new de(g.generate(this.n.byteLength()));if(C=this._truncateToN(C,!0),!(C.cmpn(1)<=0||C.cmp(w)>=0)){var G=this.g.mul(C);if(!G.isInfinity()){var H=G.getX(),k=H.umod(this.n);if(k.cmpn(0)!==0){var S=C.invm(this.n).mul(k.mul(t.getPrivate()).iadd(e));if(S=S.umod(this.n),S.cmpn(0)!==0){var T=(G.getY().isOdd()?1:0)|(H.cmp(k)!==0?2:0);return i.canonical&&S.cmp(this.nh)>0&&(S=this.n.sub(S),T^=1),new ai({r:k,s:S,recoveryParam:T})}}}}}};Tt.prototype.verify=function(e,t,r,i,o){o||(o={}),e=this._truncateToN(e,!1,o.msgBitLength),r=this.keyFromPublic(r,i),t=new ai(t,"hex");var s=t.r,c=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var x=c.invm(this.n),g=x.mul(e).umod(this.n),w=x.mul(s).umod(this.n),M;return this.curve._maxwellTrick?(M=this.g.jmulAdd(g,r.getPublic(),w),M.isInfinity()?!1:M.eqXToP(s)):(M=this.g.mulAdd(g,r.getPublic(),w),M.isInfinity()?!1:M.getX().umod(this.n).cmp(s)===0)};Tt.prototype.recoverPubKey=function(n,e,t,r){Rr((3&t)===t,"The recovery param is more than two bits"),e=new ai(e,r);var i=this.n,o=new de(n),s=e.r,c=e.s,x=t&1,g=t>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?s=this.curve.pointFromX(s.add(this.curve.n),x):s=this.curve.pointFromX(s,x);var w=e.r.invm(i),M=i.sub(o).mul(w).umod(i),C=c.mul(w).umod(i);return this.g.mulAdd(M,s,C)};Tt.prototype.getKeyRecoveryParam=function(n,e,t,r){if(e=new ai(e,r),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(n,e,i)}catch{continue}if(o.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var _c=fn(function(n,e){var t=e;t.version="6.6.1",t.utils=Ct,t.rand=(function(){throw new Error("unsupported")}),t.curve=Hn,t.curves=Kn,t.ec=Ec,t.eddsa=null}),Sc=_c.ec;const Pc="signing-key/5.8.0",ao=new O(Pc);let Vi=null;function Er(){return Vi||(Vi=new Sc("secp256k1")),Vi}class Tr{constructor(e){Q(this,"curve","secp256k1"),Q(this,"privateKey",re(e)),Pr(this.privateKey)!==32&&ao.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Er().keyFromPrivate(Z(this.privateKey));Q(this,"publicKey","0x"+t.getPublic(!1,"hex")),Q(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Q(this,"_isSigningKey",!0)}_addPoint(e){const t=Er().keyFromPublic(Z(this.publicKey)),r=Er().keyFromPublic(Z(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=Er().keyFromPrivate(Z(this.privateKey)),r=Z(e);r.length!==32&&ao.throwArgumentError("bad digest length","digest",e);const i=t.sign(r,{canonical:!0});return Lr({recoveryParam:i.recoveryParam,r:We("0x"+i.r.toString(16),32),s:We("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const t=Er().keyFromPrivate(Z(this.privateKey)),r=Er().keyFromPublic(Z(_o(e)));return We("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function js(n,e){const t=Lr(e),r={r:Z(t.r),s:Z(t.s)};return"0x"+Er().recoverPubKey(Z(n),r,t.recoveryParam).encode("hex",!1)}function _o(n,e){const t=Z(n);return t.length===32?new Tr(t).publicKey:t.length===33?"0x"+Er().keyFromPublic(t).getPublic(!1,"hex"):t.length===65?re(t):ao.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Mc="transactions/5.8.0",yt=new O(Mc);var fo;(function(n){n[n.legacy=0]="legacy",n[n.eip2930=1]="eip2930",n[n.eip1559=2]="eip1559"})(fo||(fo={}));function So(n){return n==="0x"?null:et(n)}function mt(n){return n==="0x"?gs:ee.from(n)}const Ic=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],kc={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Sr(n){const e=_o(n);return et(ft(je(ft(e,1)),12))}function Po(n,e){return Sr(js(Z(n),e))}function It(n,e){const t=or(ee.from(n).toHexString());return t.length>32&&yt.throwArgumentError("invalid length for "+e,"transaction:"+e,n),t}function Wi(n,e){return{address:et(n),storageKeys:(e||[]).map((t,r)=>(Pr(t)!==32&&yt.throwArgumentError("invalid access list storageKey",`accessList[${n}:${r}]`,t),t.toLowerCase()))}}function zr(n){if(Array.isArray(n))return n.map((t,r)=>Array.isArray(t)?(t.length>2&&yt.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${r}]`,t),Wi(t[0],t[1])):Wi(t.address,t.storageKeys));const e=Object.keys(n).map(t=>{const r=n[t].reduce((i,o)=>(i[o]=!0,i),{});return Wi(t,Object.keys(r).sort())});return e.sort((t,r)=>t.address.localeCompare(r.address)),e}function Qs(n){return zr(n).map(e=>[e.address,e.storageKeys])}function Ys(n,e){if(n.gasPrice!=null){const r=ee.from(n.gasPrice),i=ee.from(n.maxFeePerGas||0);r.eq(i)||yt.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:i})}const t=[It(n.chainId||0,"chainId"),It(n.nonce||0,"nonce"),It(n.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),It(n.maxFeePerGas||0,"maxFeePerGas"),It(n.gasLimit||0,"gasLimit"),n.to!=null?et(n.to):"0x",It(n.value||0,"value"),n.data||"0x",Qs(n.accessList||[])];if(e){const r=Lr(e);t.push(It(r.recoveryParam,"recoveryParam")),t.push(or(r.r)),t.push(or(r.s))}return At(["0x02",tn(t)])}function Xs(n,e){const t=[It(n.chainId||0,"chainId"),It(n.nonce||0,"nonce"),It(n.gasPrice||0,"gasPrice"),It(n.gasLimit||0,"gasLimit"),n.to!=null?et(n.to):"0x",It(n.value||0,"value"),n.data||"0x",Qs(n.accessList||[])];if(e){const r=Lr(e);t.push(It(r.recoveryParam,"recoveryParam")),t.push(or(r.r)),t.push(or(r.s))}return At(["0x01",tn(t)])}function Cc(n,e){po(n,kc);const t=[];Ic.forEach(function(s){let c=n[s.name]||[];const x={};s.numeric&&(x.hexPad="left"),c=Z(re(c,x)),s.length&&c.length!==s.length&&c.length>0&&yt.throwArgumentError("invalid length for "+s.name,"transaction:"+s.name,c),s.maxLength&&(c=or(c),c.length>s.maxLength&&yt.throwArgumentError("invalid length for "+s.name,"transaction:"+s.name,c)),t.push(re(c))});let r=0;if(n.chainId!=null?(r=n.chainId,typeof r!="number"&&yt.throwArgumentError("invalid transaction.chainId","transaction",n)):e&&!Pn(e)&&e.v>28&&(r=Math.floor((e.v-35)/2)),r!==0&&(t.push(re(r)),t.push("0x"),t.push("0x")),!e)return tn(t);const i=Lr(e);let o=27+i.recoveryParam;return r!==0?(t.pop(),t.pop(),t.pop(),o+=r*2+8,i.v>28&&i.v!==o&&yt.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==o&&yt.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),t.push(re(o)),t.push(or(Z(i.r))),t.push(or(Z(i.s))),tn(t)}function co(n,e){if(n.type==null||n.type===0)return n.accessList!=null&&yt.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",n),Cc(n,e);switch(n.type){case 1:return Xs(n,e);case 2:return Ys(n,e)}return yt.throwError(`unsupported transaction type: ${n.type}`,O.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:n.type})}function Zs(n,e,t){try{const r=mt(e[0]).toNumber();if(r!==0&&r!==1)throw new Error("bad recid");n.v=r}catch{yt.throwArgumentError("invalid v for transaction type: 1","v",e[0])}n.r=We(e[1],32),n.s=We(e[2],32);try{const r=je(t(n));n.from=Po(r,{r:n.r,s:n.s,recoveryParam:n.v})}catch{}}function Nc(n){const e=go(n.slice(1));e.length!==9&&e.length!==12&&yt.throwArgumentError("invalid component count for transaction type: 2","payload",re(n));const t=mt(e[2]),r=mt(e[3]),i={type:2,chainId:mt(e[0]).toNumber(),nonce:mt(e[1]).toNumber(),maxPriorityFeePerGas:t,maxFeePerGas:r,gasPrice:null,gasLimit:mt(e[4]),to:So(e[5]),value:mt(e[6]),data:e[7],accessList:zr(e[8])};return e.length===9||(i.hash=je(n),Zs(i,e.slice(9),Ys)),i}function Rc(n){const e=go(n.slice(1));e.length!==8&&e.length!==11&&yt.throwArgumentError("invalid component count for transaction type: 1","payload",re(n));const t={type:1,chainId:mt(e[0]).toNumber(),nonce:mt(e[1]).toNumber(),gasPrice:mt(e[2]),gasLimit:mt(e[3]),to:So(e[4]),value:mt(e[5]),data:e[6],accessList:zr(e[7])};return e.length===8||(t.hash=je(n),Zs(t,e.slice(8),Xs)),t}function Bc(n){const e=go(n);e.length!==9&&e.length!==6&&yt.throwArgumentError("invalid raw transaction","rawTransaction",n);const t={nonce:mt(e[0]).toNumber(),gasPrice:mt(e[1]),gasLimit:mt(e[2]),to:So(e[3]),value:mt(e[4]),data:e[5],chainId:0};if(e.length===6)return t;try{t.v=ee.from(e[6]).toNumber()}catch{return t}if(t.r=We(e[7],32),t.s=We(e[8],32),ee.from(t.r).isZero()&&ee.from(t.s).isZero())t.chainId=t.v,t.v=0;else{t.chainId=Math.floor((t.v-35)/2),t.chainId<0&&(t.chainId=0);let r=t.v-27;const i=e.slice(0,6);t.chainId!==0&&(i.push(re(t.chainId)),i.push("0x"),i.push("0x"),r-=t.chainId*2+8);const o=je(tn(i));try{t.from=Po(o,{r:re(t.r),s:re(t.s),recoveryParam:r})}catch{}t.hash=je(n)}return t.type=null,t}function $s(n){const e=Z(n);if(e[0]>127)return Bc(e);switch(e[0]){case 1:return Rc(e);case 2:return Nc(e)}return yt.throwError(`unsupported transaction type: ${e[0]}`,O.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const Tc="contracts/5.8.0";var Dr=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const it=new O(Tc);function ti(n,e){return Dr(this,void 0,void 0,function*(){const t=yield e;typeof t!="string"&&it.throwArgumentError("invalid address or ENS name","name",t);try{return et(t)}catch{}n||it.throwError("a provider or signer is needed to resolve ENS names",O.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield n.resolveName(t);return r==null&&it.throwArgumentError("resolver or addr is not configured for ENS name","name",t),r})}function Jn(n,e,t){return Dr(this,void 0,void 0,function*(){return Array.isArray(t)?yield Promise.all(t.map((r,i)=>Jn(n,Array.isArray(e)?e[i]:e[r.name],r))):t.type==="address"?yield ti(n,e):t.type==="tuple"?yield Jn(n,e,t.components):t.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(r=>Jn(n,r,t.arrayChildren))):Promise.reject(it.makeError("invalid value for array",O.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function fi(n,e,t){return Dr(this,void 0,void 0,function*(){let r={};t.length===e.inputs.length+1&&typeof t[t.length-1]=="object"&&(r=nt(t.pop())),it.checkArgumentCount(t.length,e.inputs.length,"passed to contract"),n.signer?r.from?r.from=Te({override:ti(n.signer,r.from),signer:n.signer.getAddress()}).then(g=>Dr(this,void 0,void 0,function*(){return et(g.signer)!==g.override&&it.throwError("Contract with a Signer cannot override from",O.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),g.override})):r.from=n.signer.getAddress():r.from&&(r.from=ti(n.provider,r.from));const i=yield Te({args:Jn(n.signer||n.provider,t,e.inputs),address:n.resolvedAddress,overrides:Te(r)||{}}),o=n.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},c=i.overrides;if(c.nonce!=null&&(s.nonce=ee.from(c.nonce).toNumber()),c.gasLimit!=null&&(s.gasLimit=ee.from(c.gasLimit)),c.gasPrice!=null&&(s.gasPrice=ee.from(c.gasPrice)),c.maxFeePerGas!=null&&(s.maxFeePerGas=ee.from(c.maxFeePerGas)),c.maxPriorityFeePerGas!=null&&(s.maxPriorityFeePerGas=ee.from(c.maxPriorityFeePerGas)),c.from!=null&&(s.from=c.from),c.type!=null&&(s.type=c.type),c.accessList!=null&&(s.accessList=zr(c.accessList)),s.gasLimit==null&&e.gas!=null){let g=21e3;const w=Z(o);for(let M=0;M<w.length;M++)g+=4,w[M]&&(g+=64);s.gasLimit=ee.from(e.gas).add(g)}if(c.value){const g=ee.from(c.value);!g.isZero()&&!e.payable&&it.throwError("non-payable method cannot override value",O.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:r.value}),s.value=g}c.customData&&(s.customData=nt(c.customData)),c.ccipReadEnabled&&(s.ccipReadEnabled=!!c.ccipReadEnabled),delete r.nonce,delete r.gasLimit,delete r.gasPrice,delete r.from,delete r.value,delete r.type,delete r.accessList,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.customData,delete r.ccipReadEnabled;const x=Object.keys(r).filter(g=>r[g]!=null);return x.length&&it.throwError(`cannot override ${x.map(g=>JSON.stringify(g)).join(",")}`,O.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:x}),s})}function Fc(n,e){return function(...t){return fi(n,e,t)}}function Oc(n,e){const t=n.signer||n.provider;return function(...r){return Dr(this,void 0,void 0,function*(){t||it.throwError("estimate require a provider or signer",O.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield fi(n,e,r);return yield t.estimateGas(i)})}}function Dc(n,e){const t=e.wait.bind(e);e.wait=r=>t(r).then(i=>(i.events=i.logs.map(o=>{let s=sr(o),c=null;try{c=n.interface.parseLog(o)}catch{}return c&&(s.args=c.args,s.decode=(x,g)=>n.interface.decodeEventLog(c.eventFragment,x,g),s.event=c.name,s.eventSignature=c.signature),s.removeListener=()=>n.provider,s.getBlock=()=>n.provider.getBlock(i.blockHash),s.getTransaction=()=>n.provider.getTransaction(i.transactionHash),s.getTransactionReceipt=()=>Promise.resolve(i),s}),i))}function ea(n,e,t){const r=n.signer||n.provider;return function(...i){return Dr(this,void 0,void 0,function*(){let o;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const x=nt(i.pop());x.blockTag!=null&&(o=yield x.blockTag),delete x.blockTag,i.push(x)}n.deployTransaction!=null&&(yield n._deployed(o));const s=yield fi(n,e,i),c=yield r.call(s,o);try{let x=n.interface.decodeFunctionResult(e,c);return t&&e.outputs.length===1&&(x=x[0]),x}catch(x){throw x.code===O.errors.CALL_EXCEPTION&&(x.address=n.address,x.args=i,x.transaction=s),x}})}}function Uc(n,e){return function(...t){return Dr(this,void 0,void 0,function*(){n.signer||it.throwError("sending a transaction requires a signer",O.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),n.deployTransaction!=null&&(yield n._deployed());const r=yield fi(n,e,t),i=yield n.signer.sendTransaction(r);return Dc(n,i),i})}}function A0(n,e,t){return e.constant?ea(n,e,t):Uc(n,e)}function ta(n){return n.address&&(n.topics==null||n.topics.length===0)?"*":(n.address||"*")+"@"+(n.topics?n.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class En{constructor(e,t){Q(this,"tag",e),Q(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter(r=>t||r.listener!==e?!0:(t=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter(r=>{const i=e.slice();return setTimeout(()=>{r.listener.apply(this,i)},0),!r.once}),t}prepareEvent(e){}getEmit(e){return[e]}}class Lc extends En{constructor(){super("error",null)}}class E0 extends En{constructor(e,t,r,i){const o={address:e};let s=t.getEventTopic(r);i?(s!==i[0]&&it.throwArgumentError("topic mismatch","topics",i),o.topics=i.slice()):o.topics=[s],super(ta(o),o),Q(this,"address",e),Q(this,"interface",t),Q(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(t,r)=>this.interface.decodeEventLog(this.fragment,t,r);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=hs(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class _0 extends En{constructor(e,t){super("*",{address:e}),Q(this,"address",e),Q(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(r,i)=>this.interface.decodeEventLog(t.eventFragment,r,i),e.args=t.args}catch{}}}class Gc{constructor(e,t,r){Q(this,"interface",Wt(new.target,"getInterface")(t)),r==null?(Q(this,"provider",null),Q(this,"signer",null)):qs.isSigner(r)?(Q(this,"provider",r.provider||null),Q(this,"signer",r)):In.isProvider(r)?(Q(this,"provider",r),Q(this,"signer",null)):it.throwArgumentError("invalid signer or provider","signerOrProvider",r),Q(this,"callStatic",{}),Q(this,"estimateGas",{}),Q(this,"functions",{}),Q(this,"populateTransaction",{}),Q(this,"filters",{});{const s={};Object.keys(this.interface.events).forEach(c=>{const x=this.interface.events[c];Q(this.filters,c,(...g)=>({address:this.address,topics:this.interface.encodeFilterTopics(x,g)})),s[x.name]||(s[x.name]=[]),s[x.name].push(c)}),Object.keys(s).forEach(c=>{const x=s[c];x.length===1?Q(this.filters,c,this.filters[x[0]]):it.warn(`Duplicate definition of ${c} (${x.join(", ")})`)})}if(Q(this,"_runningEvents",{}),Q(this,"_wrappedEmits",{}),e==null&&it.throwArgumentError("invalid contract address or ENS name","addressOrName",e),Q(this,"address",e),this.provider)Q(this,"resolvedAddress",ti(this.provider,e));else try{Q(this,"resolvedAddress",Promise.resolve(et(e)))}catch{it.throwError("provider is required to use ENS name as contract address",O.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(s=>{});const i={},o={};Object.keys(this.interface.functions).forEach(s=>{const c=this.interface.functions[s];if(o[s]){it.warn(`Duplicate ABI entry for ${JSON.stringify(s)}`);return}o[s]=!0;{const x=c.name;i[`%${x}`]||(i[`%${x}`]=[]),i[`%${x}`].push(s)}this[s]==null&&Q(this,s,A0(this,c,!0)),this.functions[s]==null&&Q(this.functions,s,A0(this,c,!1)),this.callStatic[s]==null&&Q(this.callStatic,s,ea(this,c,!0)),this.populateTransaction[s]==null&&Q(this.populateTransaction,s,Fc(this,c)),this.estimateGas[s]==null&&Q(this.estimateGas,s,Oc(this,c))}),Object.keys(i).forEach(s=>{const c=i[s];if(c.length>1)return;s=s.substring(1);const x=c[0];try{this[s]==null&&Q(this,s,this[x])}catch{}this.functions[s]==null&&Q(this.functions,s,this.functions[x]),this.callStatic[s]==null&&Q(this.callStatic,s,this.callStatic[x]),this.populateTransaction[s]==null&&Q(this.populateTransaction,s,this.populateTransaction[x]),this.estimateGas[s]==null&&Q(this.estimateGas,s,this.estimateGas[x])})}static getContractAddress(e){return yo(e)}static getInterface(e){return oo.isInterface(e)?e:new oo(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(t=>(t==="0x"&&it.throwError("contract not deployed",O.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||it.throwError("sending a transactions require a signer",O.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=nt(e||{});return["from","to"].forEach(function(r){t[r]!=null&&it.throwError("cannot override "+r,O.errors.UNSUPPORTED_OPERATION,{operation:r})}),t.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(t))}connect(e){typeof e=="string"&&(e=new vo(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Q(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Zn.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new Lc);if(e==="event")return this._normalizeRunningEvent(new En("event",null));if(e==="*")return this._normalizeRunningEvent(new _0(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new E0(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const r=e.topics[0];if(typeof r!="string")throw new Error("invalid topic");const i=this.interface.getEvent(r);return this._normalizeRunningEvent(new E0(this.address,this.interface,i,e.topics))}catch{}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new En(ta(t),t))}return this._normalizeRunningEvent(new _0(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const i=sr(t);return i.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(t.blockHash),i.getTransaction=()=>this.provider.getTransaction(t.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(i),i}_addEventListener(e,t,r){if(this.provider||it.throwError("events require a provider or a signer with a provider",O.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=o=>{let s=this._wrapEvent(e,o,t);if(s.decodeError==null)try{const c=e.getEmit(s);this.emit(e.filter,...c)}catch(c){s.decodeError=c.error}e.filter!=null&&this.emit("event",s),s.decodeError!=null&&this.emit("error",s.decodeError,s)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,t,r){const i=this._getRunningEvent(e),o=nt(i.filter);return typeof t=="string"&&ve(t,32)?(r!=null&&it.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=t??0,o.toBlock=r??"latest"),this.provider.getLogs(o).then(s=>s.map(c=>this._wrapEvent(i,c,null)))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),i=r.run(t)>0;return this._checkRunningEvents(r),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((t,r)=>t+this._runningEvents[r].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const t=[];for(let r in this._runningEvents)this._runningEvents[r].listeners().forEach(i=>{t.push(i)});return t}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const r in this._runningEvents){const i=this._runningEvents[r];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class nh extends Gc{}const qc="abstract-signer/5.8.0";var Ut=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const Lt=new O(qc),zc=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Hc=[O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED];let Kc=class ra{constructor(){Lt.checkAbstract(new.target,ra),Q(this,"_isSigner",!0)}getBalance(e){return Ut(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Ut(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Ut(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const t=yield Te(this.checkTransaction(e));return yield this.provider.estimateGas(t)})}call(e,t){return Ut(this,void 0,void 0,function*(){this._checkProvider("call");const r=yield Te(this.checkTransaction(e));return yield this.provider.call(r,t)})}sendTransaction(e){return Ut(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)})}getChainId(){return Ut(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Ut(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Ut(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Ut(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const r in e)zc.indexOf(r)===-1&&Lt.throwArgumentError("invalid transaction key: "+r,"transaction",e);const t=nt(e);return t.from==null?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then(r=>(r[0].toLowerCase()!==r[1].toLowerCase()&&Lt.throwArgumentError("from address mismatch","transaction",e),r[0])),t}populateTransaction(e){return Ut(this,void 0,void 0,function*(){const t=yield Te(this.checkTransaction(e));t.to!=null&&(t.to=Promise.resolve(t.to).then(i=>Ut(this,void 0,void 0,function*(){if(i==null)return null;const o=yield this.resolveName(i);return o==null&&Lt.throwArgumentError("provided ENS name resolves to null","tx.to",i),o})),t.to.catch(i=>{}));const r=t.maxFeePerGas!=null||t.maxPriorityFeePerGas!=null;if(t.gasPrice!=null&&(t.type===2||r)?Lt.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(t.type===0||t.type===1)&&r&&Lt.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(t.type===2||t.type==null)&&t.maxFeePerGas!=null&&t.maxPriorityFeePerGas!=null)t.type=2;else if(t.type===0||t.type===1)t.gasPrice==null&&(t.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(t.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(t.type=2,t.gasPrice!=null){const o=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=o,t.maxPriorityFeePerGas=o}else t.maxFeePerGas==null&&(t.maxFeePerGas=i.maxFeePerGas),t.maxPriorityFeePerGas==null&&(t.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(r&&Lt.throwError("network does not support EIP-1559",O.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),t.gasPrice==null&&(t.gasPrice=i.gasPrice),t.type=0):Lt.throwError("failed to get consistent fee data",O.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else t.type===2&&(t.maxFeePerGas==null&&(t.maxFeePerGas=i.maxFeePerGas),t.maxPriorityFeePerGas==null&&(t.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return t.nonce==null&&(t.nonce=this.getTransactionCount("pending")),t.gasLimit==null&&(t.gasLimit=this.estimateGas(t).catch(i=>{if(Hc.indexOf(i.code)>=0)throw i;return Lt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:t})})),t.chainId==null?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Lt.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Te(t)})}_checkProvider(e){this.provider||Lt.throwError("missing provider",O.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};class na{constructor(e){Q(this,"alphabet",e),Q(this,"base",e.length),Q(this,"_alphabetMap",{}),Q(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=Z(e);if(t.length===0)return"";let r=[0];for(let o=0;o<t.length;++o){let s=t[o];for(let c=0;c<r.length;++c)s+=r[c]<<8,r[c]=s%this.base,s=s/this.base|0;for(;s>0;)r.push(s%this.base),s=s/this.base|0}let i="";for(let o=0;t[o]===0&&o<t.length-1;++o)i+=this._leader;for(let o=r.length-1;o>=0;--o)i+=this.alphabet[r[o]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let t=[];if(e.length===0)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let i=this._alphabetMap[e[r]];if(i===void 0)throw new Error("Non-base"+this.base+" character");let o=i;for(let s=0;s<t.length;++s)o+=t[s]*this.base,t[s]=o&255,o>>=8;for(;o>0;)t.push(o&255),o>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return Z(new Uint8Array(t.reverse()))}}new na("abcdefghijklmnopqrstuvwxyz234567");const rn=new na("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var nn;(function(n){n.sha256="sha256",n.sha512="sha512"})(nn||(nn={}));const Jc="sha2/5.8.0",Vc=new O(Jc);function ia(n){return"0x"+Mt.ripemd160().update(Z(n)).digest("hex")}function Ir(n){return"0x"+Mt.sha256().update(Z(n)).digest("hex")}function _n(n,e,t){return nn[n]||Vc.throwError("unsupported algorithm "+n,O.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:n}),"0x"+Mt.hmac(Mt[n],Z(e)).update(Z(t)).digest("hex")}function Mo(n,e,t,r,i){n=Z(n),e=Z(e);let o,s=1;const c=new Uint8Array(r),x=new Uint8Array(e.length+4);x.set(e);let g,w;for(let M=1;M<=s;M++){x[e.length]=M>>24&255,x[e.length+1]=M>>16&255,x[e.length+2]=M>>8&255,x[e.length+3]=M&255;let C=Z(_n(i,n,x));o||(o=C.length,w=new Uint8Array(o),s=Math.ceil(r/o),g=r-(s-1)*o),w.set(C);for(let k=1;k<t;k++){C=Z(_n(i,n,C));for(let S=0;S<o;S++)w[S]^=C[S]}const G=(M-1)*o,H=M===s?g:o;c.set(Z(w).slice(0,H),G)}return re(c)}const Wc="wordlists/5.8.0",jc=new O(Wc);class Nn{constructor(e){jc.checkAbstract(new.target,Nn),Q(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const i=e.getWord(r);if(r!==e.getWordIndex(i))return"0x";t.push(i)}return _r(t.join(`
|
|
8
8
|
`)+`
|
|
9
|
-
`)}static register(e,t){t||(t=e.locale)}}const Qc="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let gn=null;function S0(n){if(gn==null&&(gn=Qc.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Nn.check(n)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw gn=null,new Error("BIP39 Wordlist for en (English) FAILED")}class Yc extends Nn{constructor(){super("en")}getWord(e){return S0(this),gn[e]}getWordIndex(e){return S0(this),gn.indexOf(e)}}const oa=new Yc;Nn.register(oa);const P0={en:oa},Xc="hdnode/5.8.0",ri=new O(Xc),Zc=ee.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),$c=ut("Bitcoin seed"),cn=2147483648;function sa(n){return(1<<n)-1<<8-n}function eu(n){return(1<<n)-1}function On(n){return We(re(n),32)}function M0(n){return rn.encode(rt([n,ft(Ir(Ir(n)),0,4)]))}function Io(n){if(n==null)return P0.en;if(typeof n=="string"){const e=P0[n];return e==null&&ri.throwArgumentError("unknown locale","wordlist",n),e}return n}const Hr={},on="m/44'/60'/0'/0/0";class kt{constructor(e,t,r,i,o,s,c,x){if(e!==Hr)throw new Error("HDNode constructor cannot be called directly");if(t){const g=new Tr(t);Q(this,"privateKey",g.privateKey),Q(this,"publicKey",g.compressedPublicKey)}else Q(this,"privateKey",null),Q(this,"publicKey",re(r));Q(this,"parentFingerprint",i),Q(this,"fingerprint",ft(ia(Ir(this.publicKey)),0,4)),Q(this,"address",Sr(this.publicKey)),Q(this,"chainCode",o),Q(this,"index",s),Q(this,"depth",c),x==null?(Q(this,"mnemonic",null),Q(this,"path",null)):typeof x=="string"?(Q(this,"mnemonic",null),Q(this,"path",x)):(Q(this,"mnemonic",x),Q(this,"path",x.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return M0(rt([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",re(this.depth),this.parentFingerprint,We(re(this.index),4),this.chainCode,this.privateKey!=null?rt(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new kt(Hr,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(e&~cn));const r=new Uint8Array(37);if(e&cn){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Z(this.privateKey),1),t&&(t+="'")}else r.set(Z(this.publicKey));for(let M=24;M>=0;M-=8)r[33+(M>>3)]=e>>24-M&255;const i=Z(_n(nn.sha512,this.chainCode,r)),o=i.slice(0,32),s=i.slice(32);let c=null,x=null;this.privateKey?c=On(ee.from(o).add(this.privateKey).mod(Zc)):x=new Tr(re(o))._addPoint(this.publicKey);let g=t;const w=this.mnemonic;return w&&(g=Object.freeze({phrase:w.phrase,path:t,locale:w.locale||"en"})),new kt(Hr,c,x,this.fingerprint,On(s),e,this.depth+1,g)}derivePath(e){const t=e.split("/");if(t.length===0||t[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);t[0]==="m"&&t.shift();let r=this;for(let i=0;i<t.length;i++){const o=t[i];if(o.match(/^[0-9]+'$/)){const s=parseInt(o.substring(0,o.length-1));if(s>=cn)throw new Error("invalid path index - "+o);r=r._derive(cn+s)}else if(o.match(/^[0-9]+$/)){const s=parseInt(o);if(s>=cn)throw new Error("invalid path index - "+o);r=r._derive(s)}else throw new Error("invalid path component - "+o)}return r}static _fromSeed(e,t){const r=Z(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const i=Z(_n(nn.sha512,$c,r));return new kt(Hr,On(i.slice(0,32)),null,"0x00000000",On(i.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return r=Io(r),e=ci(ko(e,r),r),kt._fromSeed(aa(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return kt._fromSeed(e,null)}static fromExtendedKey(e){const t=rn.decode(e);(t.length!==82||M0(t.slice(0,78))!==e)&&ri.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],i=re(t.slice(5,9)),o=parseInt(re(t.slice(9,13)).substring(2),16),s=re(t.slice(13,45)),c=t.slice(45,78);switch(re(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new kt(Hr,null,re(c),i,s,o,r,null);case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new kt(Hr,re(c.slice(1)),null,i,s,o,r,null)}return ri.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function aa(n,e){e||(e="");const t=ut("mnemonic"+e,xr.NFKD);return Mo(ut(n,xr.NFKD),t,2048,64,"sha512")}function ko(n,e){e=Io(e),ri.checkNormalize();const t=e.split(n);if(t.length%3!==0)throw new Error("invalid mnemonic");const r=Z(new Uint8Array(Math.ceil(11*t.length/8)));let i=0;for(let g=0;g<t.length;g++){let w=e.getWordIndex(t[g].normalize("NFKD"));if(w===-1)throw new Error("invalid mnemonic");for(let M=0;M<11;M++)w&1<<10-M&&(r[i>>3]|=1<<7-i%8),i++}const o=32*t.length/3,s=t.length/3,c=sa(s);if((Z(Ir(r.slice(0,o/8)))[0]&c)!==(r[r.length-1]&c))throw new Error("invalid checksum");return re(r.slice(0,o/8))}function ci(n,e){if(e=Io(e),n=Z(n),n.length%4!==0||n.length<16||n.length>32)throw new Error("invalid entropy");const t=[0];let r=11;for(let s=0;s<n.length;s++)r>8?(t[t.length-1]<<=8,t[t.length-1]|=n[s],r-=8):(t[t.length-1]<<=r,t[t.length-1]|=n[s]>>8-r,t.push(n[s]&eu(8-r)),r+=3);const i=n.length/4,o=Z(Ir(n))[0]&sa(i);return t[t.length-1]<<=i,t[t.length-1]|=o>>8-i,e.join(t.map(s=>e.getWord(s)))}const tu="random/5.8.0",uo=new O(tu);function ru(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof Bo<"u")return Bo;throw new Error("unable to locate global object")}const I0=ru();let Vn=I0.crypto||I0.msCrypto;(!Vn||!Vn.getRandomValues)&&(uo.warn("WARNING: Missing strong random number source"),Vn={getRandomValues:function(n){return uo.throwError("no secure random source avaialble",O.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Yr(n){(n<=0||n>1024||n%1||n!=n)&&uo.throwArgumentError("invalid length","length",n);const e=new Uint8Array(n);return Vn.getRandomValues(e),Z(e)}var ji={exports:{}},k0;function nu(){return k0||(k0=1,(function(n,e){(function(t){function r(p){return parseInt(p)===p}function i(p){if(!r(p.length))return!1;for(var f=0;f<p.length;f++)if(!r(p[f])||p[f]<0||p[f]>255)return!1;return!0}function o(p,f){if(p.buffer&&ArrayBuffer.isView(p)&&p.name==="Uint8Array")return f&&(p.slice?p=p.slice():p=Array.prototype.slice.call(p)),p;if(Array.isArray(p)){if(!i(p))throw new Error("Array contains invalid value: "+p);return new Uint8Array(p)}if(r(p.length)&&i(p))return new Uint8Array(p);throw new Error("unsupported array-like object")}function s(p){return new Uint8Array(p)}function c(p,f,A,B,l){(B!=null||l!=null)&&(p.slice?p=p.slice(B,l):p=Array.prototype.slice.call(p,B,l)),f.set(p,A)}var x=(function(){function p(A){var B=[],l=0;for(A=encodeURI(A);l<A.length;){var N=A.charCodeAt(l++);N===37?(B.push(parseInt(A.substr(l,2),16)),l+=2):B.push(N)}return o(B)}function f(A){for(var B=[],l=0;l<A.length;){var N=A[l];N<128?(B.push(String.fromCharCode(N)),l++):N>191&&N<224?(B.push(String.fromCharCode((N&31)<<6|A[l+1]&63)),l+=2):(B.push(String.fromCharCode((N&15)<<12|(A[l+1]&63)<<6|A[l+2]&63)),l+=3)}return B.join("")}return{toBytes:p,fromBytes:f}})(),g=(function(){function p(B){for(var l=[],N=0;N<B.length;N+=2)l.push(parseInt(B.substr(N,2),16));return l}var f="0123456789abcdef";function A(B){for(var l=[],N=0;N<B.length;N++){var J=B[N];l.push(f[(J&240)>>4]+f[J&15])}return l.join("")}return{toBytes:p,fromBytes:A}})(),w={16:10,24:12,32:14},M=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],C=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],G=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],H=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],k=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],S=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],T=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],D=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],U=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],q=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],z=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],j=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Y=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],X=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],ie=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function se(p){for(var f=[],A=0;A<p.length;A+=4)f.push(p[A]<<24|p[A+1]<<16|p[A+2]<<8|p[A+3]);return f}var ne=function(p){if(!(this instanceof ne))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:o(p,!0)}),this._prepare()};ne.prototype._prepare=function(){var p=w[this.key.length];if(p==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var f=0;f<=p;f++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var A=(p+1)*4,B=this.key.length/4,l=se(this.key),N,f=0;f<B;f++)N=f>>2,this._Ke[N][f%4]=l[f],this._Kd[p-N][f%4]=l[f];for(var J=0,K=B,W;K<A;){if(W=l[B-1],l[0]^=C[W>>16&255]<<24^C[W>>8&255]<<16^C[W&255]<<8^C[W>>24&255]^M[J]<<24,J+=1,B!=8)for(var f=1;f<B;f++)l[f]^=l[f-1];else{for(var f=1;f<B/2;f++)l[f]^=l[f-1];W=l[B/2-1],l[B/2]^=C[W&255]^C[W>>8&255]<<8^C[W>>16&255]<<16^C[W>>24&255]<<24;for(var f=B/2+1;f<B;f++)l[f]^=l[f-1]}for(var f=0,oe,$;f<B&&K<A;)oe=K>>2,$=K%4,this._Ke[oe][$]=l[f],this._Kd[p-oe][$]=l[f++],K++}for(var oe=1;oe<p;oe++)for(var $=0;$<4;$++)W=this._Kd[oe][$],this._Kd[oe][$]=j[W>>24&255]^Y[W>>16&255]^X[W>>8&255]^ie[W&255]},ne.prototype.encrypt=function(p){if(p.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var f=this._Ke.length-1,A=[0,0,0,0],B=se(p),l=0;l<4;l++)B[l]^=this._Ke[0][l];for(var N=1;N<f;N++){for(var l=0;l<4;l++)A[l]=H[B[l]>>24&255]^k[B[(l+1)%4]>>16&255]^S[B[(l+2)%4]>>8&255]^T[B[(l+3)%4]&255]^this._Ke[N][l];B=A.slice()}for(var J=s(16),K,l=0;l<4;l++)K=this._Ke[f][l],J[4*l]=(C[B[l]>>24&255]^K>>24)&255,J[4*l+1]=(C[B[(l+1)%4]>>16&255]^K>>16)&255,J[4*l+2]=(C[B[(l+2)%4]>>8&255]^K>>8)&255,J[4*l+3]=(C[B[(l+3)%4]&255]^K)&255;return J},ne.prototype.decrypt=function(p){if(p.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var f=this._Kd.length-1,A=[0,0,0,0],B=se(p),l=0;l<4;l++)B[l]^=this._Kd[0][l];for(var N=1;N<f;N++){for(var l=0;l<4;l++)A[l]=D[B[l]>>24&255]^U[B[(l+3)%4]>>16&255]^q[B[(l+2)%4]>>8&255]^z[B[(l+1)%4]&255]^this._Kd[N][l];B=A.slice()}for(var J=s(16),K,l=0;l<4;l++)K=this._Kd[f][l],J[4*l]=(G[B[l]>>24&255]^K>>24)&255,J[4*l+1]=(G[B[(l+3)%4]>>16&255]^K>>16)&255,J[4*l+2]=(G[B[(l+2)%4]>>8&255]^K>>8)&255,J[4*l+3]=(G[B[(l+1)%4]&255]^K)&255;return J};var P=function(p){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new ne(p)};P.prototype.encrypt=function(p){if(p=o(p),p.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var f=s(p.length),A=s(16),B=0;B<p.length;B+=16)c(p,A,0,B,B+16),A=this._aes.encrypt(A),c(A,f,B);return f},P.prototype.decrypt=function(p){if(p=o(p),p.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var f=s(p.length),A=s(16),B=0;B<p.length;B+=16)c(p,A,0,B,B+16),A=this._aes.decrypt(A),c(A,f,B);return f};var m=function(p,f){if(!(this instanceof m))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!f)f=s(16);else if(f.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=o(f,!0),this._aes=new ne(p)};m.prototype.encrypt=function(p){if(p=o(p),p.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var f=s(p.length),A=s(16),B=0;B<p.length;B+=16){c(p,A,0,B,B+16);for(var l=0;l<16;l++)A[l]^=this._lastCipherblock[l];this._lastCipherblock=this._aes.encrypt(A),c(this._lastCipherblock,f,B)}return f},m.prototype.decrypt=function(p){if(p=o(p),p.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var f=s(p.length),A=s(16),B=0;B<p.length;B+=16){c(p,A,0,B,B+16),A=this._aes.decrypt(A);for(var l=0;l<16;l++)f[B+l]=A[l]^this._lastCipherblock[l];c(p,this._lastCipherblock,0,B,B+16)}return f};var a=function(p,f,A){if(!(this instanceof a))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!f)f=s(16);else if(f.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");A||(A=1),this.segmentSize=A,this._shiftRegister=o(f,!0),this._aes=new ne(p)};a.prototype.encrypt=function(p){if(p.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var f=o(p,!0),A,B=0;B<f.length;B+=this.segmentSize){A=this._aes.encrypt(this._shiftRegister);for(var l=0;l<this.segmentSize;l++)f[B+l]^=A[l];c(this._shiftRegister,this._shiftRegister,0,this.segmentSize),c(f,this._shiftRegister,16-this.segmentSize,B,B+this.segmentSize)}return f},a.prototype.decrypt=function(p){if(p.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var f=o(p,!0),A,B=0;B<f.length;B+=this.segmentSize){A=this._aes.encrypt(this._shiftRegister);for(var l=0;l<this.segmentSize;l++)f[B+l]^=A[l];c(this._shiftRegister,this._shiftRegister,0,this.segmentSize),c(p,this._shiftRegister,16-this.segmentSize,B,B+this.segmentSize)}return f};var d=function(p,f){if(!(this instanceof d))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!f)f=s(16);else if(f.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=o(f,!0),this._lastPrecipherIndex=16,this._aes=new ne(p)};d.prototype.encrypt=function(p){for(var f=o(p,!0),A=0;A<f.length;A++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),f[A]^=this._lastPrecipher[this._lastPrecipherIndex++];return f},d.prototype.decrypt=d.prototype.encrypt;var b=function(p){if(!(this instanceof b))throw Error("Counter must be instanitated with `new`");p!==0&&!p&&(p=1),typeof p=="number"?(this._counter=s(16),this.setValue(p)):this.setBytes(p)};b.prototype.setValue=function(p){if(typeof p!="number"||parseInt(p)!=p)throw new Error("invalid counter value (must be an integer)");for(var f=15;f>=0;--f)this._counter[f]=p%256,p=p>>8},b.prototype.setBytes=function(p){if(p=o(p,!0),p.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=p},b.prototype.increment=function(){for(var p=15;p>=0;p--)if(this._counter[p]===255)this._counter[p]=0;else{this._counter[p]++;break}};var y=function(p,f){if(!(this instanceof y))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",f instanceof b||(f=new b(f)),this._counter=f,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new ne(p)};y.prototype.encrypt=function(p){for(var f=o(p,!0),A=0;A<f.length;A++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),f[A]^=this._remainingCounter[this._remainingCounterIndex++];return f},y.prototype.decrypt=y.prototype.encrypt;function E(p){p=o(p,!0);var f=16-p.length%16,A=s(p.length+f);c(p,A);for(var B=p.length;B<A.length;B++)A[B]=f;return A}function I(p){if(p=o(p,!0),p.length<16)throw new Error("PKCS#7 invalid length");var f=p[p.length-1];if(f>16)throw new Error("PKCS#7 padding byte out of range");for(var A=p.length-f,B=0;B<f;B++)if(p[A+B]!==f)throw new Error("PKCS#7 invalid padding byte");var l=s(A);return c(p,l,0,0,A),l}var R={AES:ne,Counter:b,ModeOfOperation:{ecb:P,cbc:m,cfb:a,ofb:d,ctr:y},utils:{hex:g,utf8:x},padding:{pkcs7:{pad:E,strip:I}},_arrayTest:{coerceArray:o,createArray:s,copyArray:c}};n.exports=R})()})(ji)),ji.exports}var iu=nu();const ir=sn(iu),fa="json-wallets/5.8.0";function Fr(n){return typeof n=="string"&&n.substring(0,2)!=="0x"&&(n="0x"+n),Z(n)}function un(n,e){for(n=String(n);n.length<e;)n="0"+n;return n}function Co(n){return typeof n=="string"?ut(n,xr.NFKC):Z(n)}function ot(n,e){let t=n;const r=e.toLowerCase().split("/");for(let i=0;i<r.length;i++){let o=null;for(const s in t)if(s.toLowerCase()===r[i]){o=t[s];break}if(o===null)return null;t=o}return t}function ou(n){const e=Z(n);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=re(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}const su=new O(fa);class au extends Gr{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}}function ca(n,e){const t=JSON.parse(n);e=Co(e);const r=et(ot(t,"ethaddr")),i=Fr(ot(t,"encseed"));(!i||i.length%16!==0)&&su.throwArgumentError("invalid encseed","json",n);const o=Z(Mo(e,e,2e3,32,"sha256")).slice(0,16),s=i.slice(0,16),c=i.slice(16),x=new ir.ModeOfOperation.cbc(o,s),g=ir.padding.pkcs7.strip(Z(x.decrypt(c)));let w="";for(let G=0;G<g.length;G++)w+=String.fromCharCode(g[G]);const M=ut(w),C=je(M);return new au({_isCrowdsaleAccount:!0,address:r,privateKey:C})}function ua(n){let e=null;try{e=JSON.parse(n)}catch{return!1}return e.encseed&&e.ethaddr}function ha(n){let e=null;try{e=JSON.parse(n)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}var Qi={exports:{}},C0;function fu(){return C0||(C0=1,(function(n,e){(function(t){function i(k){const S=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);let T=1779033703,D=3144134277,U=1013904242,q=2773480762,z=1359893119,j=2600822924,Y=528734635,X=1541459225;const ie=new Uint32Array(64);function se(y){let E=0,I=y.length;for(;I>=64;){let R=T,p=D,f=U,A=q,B=z,l=j,N=Y,J=X,K,W,oe,$,te;for(W=0;W<16;W++)oe=E+W*4,ie[W]=(y[oe]&255)<<24|(y[oe+1]&255)<<16|(y[oe+2]&255)<<8|y[oe+3]&255;for(W=16;W<64;W++)K=ie[W-2],$=(K>>>17|K<<15)^(K>>>19|K<<13)^K>>>10,K=ie[W-15],te=(K>>>7|K<<25)^(K>>>18|K<<14)^K>>>3,ie[W]=($+ie[W-7]|0)+(te+ie[W-16]|0)|0;for(W=0;W<64;W++)$=(((B>>>6|B<<26)^(B>>>11|B<<21)^(B>>>25|B<<7))+(B&l^~B&N)|0)+(J+(S[W]+ie[W]|0)|0)|0,te=((R>>>2|R<<30)^(R>>>13|R<<19)^(R>>>22|R<<10))+(R&p^R&f^p&f)|0,J=N,N=l,l=B,B=A+$|0,A=f,f=p,p=R,R=$+te|0;T=T+R|0,D=D+p|0,U=U+f|0,q=q+A|0,z=z+B|0,j=j+l|0,Y=Y+N|0,X=X+J|0,E+=64,I-=64}}se(k);let ne,P=k.length%64,m=k.length/536870912|0,a=k.length<<3,d=P<56?56:120,b=k.slice(k.length-P,k.length);for(b.push(128),ne=P+1;ne<d;ne++)b.push(0);return b.push(m>>>24&255),b.push(m>>>16&255),b.push(m>>>8&255),b.push(m>>>0&255),b.push(a>>>24&255),b.push(a>>>16&255),b.push(a>>>8&255),b.push(a>>>0&255),se(b),[T>>>24&255,T>>>16&255,T>>>8&255,T>>>0&255,D>>>24&255,D>>>16&255,D>>>8&255,D>>>0&255,U>>>24&255,U>>>16&255,U>>>8&255,U>>>0&255,q>>>24&255,q>>>16&255,q>>>8&255,q>>>0&255,z>>>24&255,z>>>16&255,z>>>8&255,z>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y>>>0&255,X>>>24&255,X>>>16&255,X>>>8&255,X>>>0&255]}function o(k,S,T){k=k.length<=64?k:i(k);const D=64+S.length+4,U=new Array(D),q=new Array(64);let z,j=[];for(z=0;z<64;z++)U[z]=54;for(z=0;z<k.length;z++)U[z]^=k[z];for(z=0;z<S.length;z++)U[64+z]=S[z];for(z=D-4;z<D;z++)U[z]=0;for(z=0;z<64;z++)q[z]=92;for(z=0;z<k.length;z++)q[z]^=k[z];function Y(){for(let X=D-1;X>=D-4;X--){if(U[X]++,U[X]<=255)return;U[X]=0}}for(;T>=32;)Y(),j=j.concat(i(q.concat(i(U)))),T-=32;return T>0&&(Y(),j=j.concat(i(q.concat(i(U))).slice(0,T))),j}function s(k,S,T,D,U){let q;for(w(k,(2*T-1)*16,U,0,16),q=0;q<2*T;q++)g(k,q*16,U,16),x(U,D),w(U,0,k,S+q*16,16);for(q=0;q<T;q++)w(k,S+q*2*16,k,q*16,16);for(q=0;q<T;q++)w(k,S+(q*2+1)*16,k,(q+T)*16,16)}function c(k,S){return k<<S|k>>>32-S}function x(k,S){w(k,0,S,0,16);for(let T=8;T>0;T-=2)S[4]^=c(S[0]+S[12],7),S[8]^=c(S[4]+S[0],9),S[12]^=c(S[8]+S[4],13),S[0]^=c(S[12]+S[8],18),S[9]^=c(S[5]+S[1],7),S[13]^=c(S[9]+S[5],9),S[1]^=c(S[13]+S[9],13),S[5]^=c(S[1]+S[13],18),S[14]^=c(S[10]+S[6],7),S[2]^=c(S[14]+S[10],9),S[6]^=c(S[2]+S[14],13),S[10]^=c(S[6]+S[2],18),S[3]^=c(S[15]+S[11],7),S[7]^=c(S[3]+S[15],9),S[11]^=c(S[7]+S[3],13),S[15]^=c(S[11]+S[7],18),S[1]^=c(S[0]+S[3],7),S[2]^=c(S[1]+S[0],9),S[3]^=c(S[2]+S[1],13),S[0]^=c(S[3]+S[2],18),S[6]^=c(S[5]+S[4],7),S[7]^=c(S[6]+S[5],9),S[4]^=c(S[7]+S[6],13),S[5]^=c(S[4]+S[7],18),S[11]^=c(S[10]+S[9],7),S[8]^=c(S[11]+S[10],9),S[9]^=c(S[8]+S[11],13),S[10]^=c(S[9]+S[8],18),S[12]^=c(S[15]+S[14],7),S[13]^=c(S[12]+S[15],9),S[14]^=c(S[13]+S[12],13),S[15]^=c(S[14]+S[13],18);for(let T=0;T<16;++T)k[T]+=S[T]}function g(k,S,T,D){for(let U=0;U<D;U++)T[U]^=k[S+U]}function w(k,S,T,D,U){for(;U--;)T[D++]=k[S++]}function M(k){if(!k||typeof k.length!="number")return!1;for(let S=0;S<k.length;S++){const T=k[S];if(typeof T!="number"||T%1||T<0||T>=256)return!1}return!0}function C(k,S){if(typeof k!="number"||k%1)throw new Error("invalid "+S);return k}function G(k,S,T,D,U,q,z){if(T=C(T,"N"),D=C(D,"r"),U=C(U,"p"),q=C(q,"dkLen"),T===0||(T&T-1)!==0)throw new Error("N must be power of 2");if(T>2147483647/128/D)throw new Error("N too large");if(D>2147483647/128/U)throw new Error("r too large");if(!M(k))throw new Error("password must be an array or buffer");if(k=Array.prototype.slice.call(k),!M(S))throw new Error("salt must be an array or buffer");S=Array.prototype.slice.call(S);let j=o(k,S,U*128*D);const Y=new Uint32Array(U*32*D);for(let B=0;B<Y.length;B++){const l=B*4;Y[B]=(j[l+3]&255)<<24|(j[l+2]&255)<<16|(j[l+1]&255)<<8|(j[l+0]&255)<<0}const X=new Uint32Array(64*D),ie=new Uint32Array(32*D*T),se=32*D,ne=new Uint32Array(16),P=new Uint32Array(16),m=U*T*2;let a=0,d=null,b=!1,y=0,E=0,I,R;const p=z?parseInt(1e3/D):4294967295,f=typeof setImmediate<"u"?setImmediate:setTimeout,A=function(){if(b)return z(new Error("cancelled"),a/m);let B;switch(y){case 0:R=E*32*D,w(Y,R,X,0,se),y=1,I=0;case 1:B=T-I,B>p&&(B=p);for(let N=0;N<B;N++)w(X,0,ie,(I+N)*se,se),s(X,se,D,ne,P);if(I+=B,a+=B,z){const N=parseInt(1e3*a/m);if(N!==d){if(b=z(null,a/m),b)break;d=N}}if(I<T)break;I=0,y=2;case 2:B=T-I,B>p&&(B=p);for(let N=0;N<B;N++){const J=(2*D-1)*16,K=X[J]&T-1;g(ie,K*se,X,se),s(X,se,D,ne,P)}if(I+=B,a+=B,z){const N=parseInt(1e3*a/m);if(N!==d){if(b=z(null,a/m),b)break;d=N}}if(I<T)break;if(w(X,0,Y,R,se),E++,E<U){y=0;break}j=[];for(let N=0;N<Y.length;N++)j.push(Y[N]>>0&255),j.push(Y[N]>>8&255),j.push(Y[N]>>16&255),j.push(Y[N]>>24&255);const l=o(k,j,q);return z&&z(null,1,l),l}z&&f(A)};if(!z)for(;;){const B=A();if(B!=null)return B}A()}const H={scrypt:function(k,S,T,D,U,q,z){return new Promise(function(j,Y){let X=0;z&&z(0),G(k,S,T,D,U,q,function(ie,se,ne){if(ie)Y(ie);else if(ne)z&&X!==1&&z(1),j(new Uint8Array(ne));else if(z&&se!==X)return X=se,z(se)})})},syncScrypt:function(k,S,T,D,U,q){return new Uint8Array(G(k,S,T,D,U,q))}};n.exports=H})()})(Qi)),Qi.exports}var cu=fu();const No=sn(cu);var uu=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const ho=new O(fa);function N0(n){return n!=null&&n.mnemonic&&n.mnemonic.phrase}class hu extends Gr{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}}function lu(n,e,t){if(ot(n,"crypto/cipher")==="aes-128-ctr"){const i=Fr(ot(n,"crypto/cipherparams/iv")),o=new ir.Counter(i),s=new ir.ModeOfOperation.ctr(e,o);return Z(s.decrypt(t))}return null}function la(n,e){const t=Fr(ot(n,"crypto/ciphertext"));if(re(je(rt([e.slice(16,32),t]))).substring(2)!==ot(n,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=lu(n,e.slice(0,16),t);i||ho.throwError("unsupported cipher",O.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const o=e.slice(32,64),s=Sr(i);if(n.address){let x=n.address.toLowerCase();if(x.substring(0,2)!=="0x"&&(x="0x"+x),et(x)!==s)throw new Error("address mismatch")}const c={_isKeystoreAccount:!0,address:s,privateKey:re(i)};if(ot(n,"x-ethers/version")==="0.1"){const x=Fr(ot(n,"x-ethers/mnemonicCiphertext")),g=Fr(ot(n,"x-ethers/mnemonicCounter")),w=new ir.Counter(g),M=new ir.ModeOfOperation.ctr(o,w),C=ot(n,"x-ethers/path")||on,G=ot(n,"x-ethers/locale")||"en",H=Z(M.decrypt(x));try{const k=ci(H,G),S=kt.fromMnemonic(k,null,G).derivePath(C);if(S.privateKey!=c.privateKey)throw new Error("mnemonic mismatch");c.mnemonic=S.mnemonic}catch(k){if(k.code!==O.errors.INVALID_ARGUMENT||k.argument!=="wordlist")throw k}}return new hu(c)}function da(n,e,t,r,i){return Z(Mo(n,e,t,r,i))}function du(n,e,t,r,i){return Promise.resolve(da(n,e,t,r,i))}function xa(n,e,t,r,i){const o=Co(e),s=ot(n,"crypto/kdf");if(s&&typeof s=="string"){const c=function(x,g){return ho.throwArgumentError("invalid key-derivation function parameters",x,g)};if(s.toLowerCase()==="scrypt"){const x=Fr(ot(n,"crypto/kdfparams/salt")),g=parseInt(ot(n,"crypto/kdfparams/n")),w=parseInt(ot(n,"crypto/kdfparams/r")),M=parseInt(ot(n,"crypto/kdfparams/p"));(!g||!w||!M)&&c("kdf",s),(g&g-1)!==0&&c("N",g);const C=parseInt(ot(n,"crypto/kdfparams/dklen"));return C!==32&&c("dklen",C),r(o,x,g,w,M,64,i)}else if(s.toLowerCase()==="pbkdf2"){const x=Fr(ot(n,"crypto/kdfparams/salt"));let g=null;const w=ot(n,"crypto/kdfparams/prf");w==="hmac-sha256"?g="sha256":w==="hmac-sha512"?g="sha512":c("prf",w);const M=parseInt(ot(n,"crypto/kdfparams/c")),C=parseInt(ot(n,"crypto/kdfparams/dklen"));return C!==32&&c("dklen",C),t(o,x,M,C,g)}}return ho.throwArgumentError("unsupported key-derivation function","kdf",s)}function xu(n,e){const t=JSON.parse(n),r=xa(t,e,da,No.syncScrypt);return la(t,r)}function pu(n,e,t){return uu(this,void 0,void 0,function*(){const r=JSON.parse(n),i=yield xa(r,e,du,No.scrypt,t);return la(r,i)})}function bu(n,e,t,r){try{if(et(n.address)!==Sr(n.privateKey))throw new Error("address/privateKey mismatch");if(N0(n)){const S=n.mnemonic;if(kt.fromMnemonic(S.phrase,null,S.locale).derivePath(S.path||on).privateKey!=n.privateKey)throw new Error("mnemonic mismatch")}}catch(S){return Promise.reject(S)}typeof t=="function"&&!r&&(r=t,t={}),t||(t={});const i=Z(n.privateKey),o=Co(e);let s=null,c=null,x=null;if(N0(n)){const S=n.mnemonic;s=Z(ko(S.phrase,S.locale||"en")),c=S.path||on,x=S.locale||"en"}let g=t.client;g||(g="ethers.js");let w=null;t.salt?w=Z(t.salt):w=Yr(32);let M=null;if(t.iv){if(M=Z(t.iv),M.length!==16)throw new Error("invalid iv")}else M=Yr(16);let C=null;if(t.uuid){if(C=Z(t.uuid),C.length!==16)throw new Error("invalid uuid")}else C=Yr(16);let G=1<<17,H=8,k=1;return t.scrypt&&(t.scrypt.N&&(G=t.scrypt.N),t.scrypt.r&&(H=t.scrypt.r),t.scrypt.p&&(k=t.scrypt.p)),No.scrypt(o,w,G,H,k,64,r).then(S=>{S=Z(S);const T=S.slice(0,16),D=S.slice(16,32),U=S.slice(32,64),q=new ir.Counter(M),z=new ir.ModeOfOperation.ctr(T,q),j=Z(z.encrypt(i)),Y=je(rt([D,j])),X={address:n.address.substring(2).toLowerCase(),id:ou(C),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:re(M).substring(2)},ciphertext:re(j).substring(2),kdf:"scrypt",kdfparams:{salt:re(w).substring(2),n:G,dklen:32,p:k,r:H},mac:Y.substring(2)}};if(s){const ie=Yr(16),se=new ir.Counter(ie),ne=new ir.ModeOfOperation.ctr(U,se),P=Z(ne.encrypt(s)),m=new Date,a=m.getUTCFullYear()+"-"+un(m.getUTCMonth()+1,2)+"-"+un(m.getUTCDate(),2)+"T"+un(m.getUTCHours(),2)+"-"+un(m.getUTCMinutes(),2)+"-"+un(m.getUTCSeconds(),2)+".0Z";X["x-ethers"]={client:g,gethFilename:"UTC--"+a+"--"+X.address,mnemonicCounter:re(ie).substring(2),mnemonicCiphertext:re(P).substring(2),path:c,locale:x,version:"0.1"}}return JSON.stringify(X)})}function gu(n,e,t){if(ua(n)){t&&t(0);const r=ca(n,e);return t&&t(1),Promise.resolve(r)}return ha(n)?pu(n,e,t):Promise.reject(new Error("invalid JSON wallet"))}function mu(n,e){if(ua(n))return ca(n,e);if(ha(n))return xu(n,e);throw new Error("invalid JSON wallet")}const yu="wallet/5.8.0";var R0=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const Kr=new O(yu);function vu(n){return n!=null&&ve(n.privateKey,32)&&n.address!=null}function wu(n){const e=n.mnemonic;return e&&e.phrase}class Wr extends Kc{constructor(e,t){if(super(),vu(e)){const r=new Tr(e.privateKey);if(Q(this,"_signingKey",()=>r),Q(this,"address",Sr(this.publicKey)),this.address!==et(e.address)&&Kr.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),wu(e)){const i=e.mnemonic;Q(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||on,locale:i.locale||"en"}));const o=this.mnemonic,s=kt.fromMnemonic(o.phrase,null,o.locale).derivePath(o.path);Sr(s.privateKey)!==this.address&&Kr.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else Q(this,"_mnemonic",()=>null)}else{if(Tr.isSigningKey(e))e.curve!=="secp256k1"&&Kr.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),Q(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);const r=new Tr(e);Q(this,"_signingKey",()=>r)}Q(this,"_mnemonic",()=>null),Q(this,"address",Sr(this.publicKey))}t&&!In.isProvider(t)&&Kr.throwArgumentError("invalid provider","provider",t),Q(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new Wr(this,e)}signTransaction(e){return Te(e).then(t=>{t.from!=null&&(et(t.from)!==this.address&&Kr.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(je(co(t)));return co(t,r)})}signMessage(e){return R0(this,void 0,void 0,function*(){return no(this._signingKey().signDigest(Fs(e)))})}_signTypedData(e,t,r){return R0(this,void 0,void 0,function*(){const i=yield gt.resolveNames(e,t,r,o=>(this.provider==null&&Kr.throwError("cannot resolve ENS names without a provider",O.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:o}),this.provider.resolveName(o)));return no(this._signingKey().signDigest(gt.hash(i.domain,t,i.value)))})}encrypt(e,t,r){if(typeof t=="function"&&!r&&(r=t,t={}),r&&typeof r!="function")throw new Error("invalid callback");return t||(t={}),bu(this,e,t,r)}static createRandom(e){let t=Yr(16);e||(e={}),e.extraEntropy&&(t=Z(ft(je(rt([t,e.extraEntropy])),0,16)));const r=ci(t,e.locale);return Wr.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return gu(e,t,r).then(i=>new Wr(i))}static fromEncryptedJsonSync(e,t){return new Wr(mu(e,t))}static fromMnemonic(e,t,r){return t||(t=on),new Wr(kt.fromMnemonic(e,null,r).derivePath(t))}}const Au="networks/5.8.0",B0=new O(Au);function Eu(n){return n&&typeof n.renetwork=="function"}function Kt(n){const e=function(t,r){r==null&&(r={});const i=[];if(t.InfuraProvider&&r.infura!=="-")try{i.push(new t.InfuraProvider(n,r.infura))}catch{}if(t.EtherscanProvider&&r.etherscan!=="-")try{i.push(new t.EtherscanProvider(n,r.etherscan))}catch{}if(t.AlchemyProvider&&r.alchemy!=="-")try{i.push(new t.AlchemyProvider(n,r.alchemy))}catch{}if(t.PocketProvider&&r.pocket!=="-"){const o=["goerli","ropsten","rinkeby","sepolia"];try{const s=new t.PocketProvider(n,r.pocket);s.network&&o.indexOf(s.network.name)===-1&&i.push(s)}catch{}}if(t.CloudflareProvider&&r.cloudflare!=="-")try{i.push(new t.CloudflareProvider(n))}catch{}if(t.AnkrProvider&&r.ankr!=="-")try{const o=["ropsten"],s=new t.AnkrProvider(n,r.ankr);s.network&&o.indexOf(s.network.name)===-1&&i.push(s)}catch{}if(t.QuickNodeProvider&&r.quicknode!=="-")try{i.push(new t.QuickNodeProvider(n,r.quicknode))}catch{}if(i.length===0)return null;if(t.FallbackProvider){let o=1;return r.quorum!=null?o=r.quorum:n==="homestead"&&(o=2),new t.FallbackProvider(i,o)}return i[0]};return e.renetwork=function(t){return Kt(t)},e}function ni(n,e){const t=function(r,i){return r.JsonRpcProvider?new r.JsonRpcProvider(n,e):null};return t.renetwork=function(r){return ni(n,r)},t}const T0={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Kt("homestead")},F0={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Kt("ropsten")},O0={chainId:63,name:"classicMordor",_defaultProvider:ni("https://www.ethercluster.com/mordor","classicMordor")},Dn={unspecified:{chainId:0,name:"unspecified"},homestead:T0,mainnet:T0,morden:{chainId:2,name:"morden"},ropsten:F0,testnet:F0,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Kt("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Kt("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Kt("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"sepolia",_defaultProvider:Kt("sepolia")},holesky:{chainId:17e3,name:"holesky",_defaultProvider:Kt("holesky")},classic:{chainId:61,name:"classic",_defaultProvider:ni("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:O0,classicTestnet:O0,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ni("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Kt("matic")},maticmum:{chainId:80001,name:"maticmum",_defaultProvider:Kt("maticmum")},optimism:{chainId:10,name:"optimism",_defaultProvider:Kt("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},"optimism-sepolia":{chainId:11155420,name:"optimism-sepolia"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},"arbitrum-sepolia":{chainId:421614,name:"arbitrum-sepolia"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function _u(n){if(n==null)return null;if(typeof n=="number"){for(const r in Dn){const i=Dn[r];if(i.chainId===n)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:n,name:"unknown"}}if(typeof n=="string"){const r=Dn[n];return r==null?null:{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress,_defaultProvider:r._defaultProvider||null}}const e=Dn[n.name];if(!e)return typeof n.chainId!="number"&&B0.throwArgumentError("invalid network chainId","network",n),n;n.chainId!==0&&n.chainId!==e.chainId&&B0.throwArgumentError("network chainId mismatch","network",n);let t=n._defaultProvider||null;return t==null&&e._defaultProvider&&(Eu(e._defaultProvider)?t=e._defaultProvider.renetwork(n):t=e._defaultProvider),{name:n.name,chainId:e.chainId,ensAddress:n.ensAddress||e.ensAddress||null,_defaultProvider:t}}const Su="web/5.8.0";var Pu=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};function Mu(n,e){return Pu(this,void 0,void 0,function*(){e==null&&(e={});const t={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(t.mode="cors",t.cache="no-cache",t.credentials="same-origin",t.redirect="follow",t.referrer="client"),e.fetchOptions!=null){const s=e.fetchOptions;s.mode&&(t.mode=s.mode),s.cache&&(t.cache=s.cache),s.credentials&&(t.credentials=s.credentials),s.redirect&&(t.redirect=s.redirect),s.referrer&&(t.referrer=s.referrer)}const r=yield fetch(n,t),i=yield r.arrayBuffer(),o={};return r.headers.forEach?r.headers.forEach((s,c)=>{o[c.toLowerCase()]=s}):r.headers.keys().forEach(s=>{o[s.toLowerCase()]=r.headers.get(s)}),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:Z(new Uint8Array(i))}})}var Iu=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const zt=new O(Su);function D0(n){return new Promise(e=>{setTimeout(e,n)})}function Ar(n,e){if(n==null)return null;if(typeof n=="string")return n;if(Pn(n)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return an(n)}catch{}return re(n)}return n}function ku(n){return ut(n.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function pa(n,e,t){const r=typeof n=="object"&&n.throttleLimit!=null?n.throttleLimit:12;zt.assertArgument(r>0&&r%1===0,"invalid connection throttle limit","connection.throttleLimit",r);const i=typeof n=="object"?n.throttleCallback:null,o=typeof n=="object"&&typeof n.throttleSlotInterval=="number"?n.throttleSlotInterval:100;zt.assertArgument(o>0&&o%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s=typeof n=="object"?!!n.errorPassThrough:!1,c={};let x=null;const g={method:"GET"};let w=!1,M=120*1e3;if(typeof n=="string")x=n;else if(typeof n=="object"){if((n==null||n.url==null)&&zt.throwArgumentError("missing URL","connection.url",n),x=n.url,typeof n.timeout=="number"&&n.timeout>0&&(M=n.timeout),n.headers)for(const T in n.headers)c[T.toLowerCase()]={key:T,value:String(n.headers[T])},["if-none-match","if-modified-since"].indexOf(T.toLowerCase())>=0&&(w=!0);if(g.allowGzip=!!n.allowGzip,n.user!=null&&n.password!=null){x.substring(0,6)!=="https:"&&n.allowInsecureAuthentication!==!0&&zt.throwError("basic authentication requires a secure https url",O.errors.INVALID_ARGUMENT,{argument:"url",url:x,user:n.user,password:"[REDACTED]"});const T=n.user+":"+n.password;c.authorization={key:"Authorization",value:"Basic "+Ms(ut(T))}}n.skipFetchSetup!=null&&(g.skipFetchSetup=!!n.skipFetchSetup),n.fetchOptions!=null&&(g.fetchOptions=nt(n.fetchOptions))}const C=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),G=x?x.match(C):null;if(G)try{const T={statusCode:200,statusMessage:"OK",headers:{"content-type":G[1]||"text/plain"},body:G[2]?Ps(G[3]):ku(G[3])};let D=T.body;return t&&(D=t(T.body,T)),Promise.resolve(D)}catch(T){zt.throwError("processing response error",O.errors.SERVER_ERROR,{body:Ar(G[1],G[2]),error:T,requestBody:null,requestMethod:"GET",url:x})}e&&(g.method="POST",g.body=e,c["content-type"]==null&&(c["content-type"]={key:"Content-Type",value:"application/octet-stream"}),c["content-length"]==null&&(c["content-length"]={key:"Content-Length",value:String(e.length)}));const H={};Object.keys(c).forEach(T=>{const D=c[T];H[D.key]=D.value}),g.headers=H;const k=(function(){let T=null;return{promise:new Promise(function(q,z){M&&(T=setTimeout(()=>{T!=null&&(T=null,z(zt.makeError("timeout",O.errors.TIMEOUT,{requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,timeout:M,url:x})))},M))}),cancel:function(){T!=null&&(clearTimeout(T),T=null)}}})(),S=(function(){return Iu(this,void 0,void 0,function*(){for(let T=0;T<r;T++){let D=null;try{if(D=yield Mu(x,g),T<r){if(D.statusCode===301||D.statusCode===302){const q=D.headers.location||"";if(g.method==="GET"&&q.match(/^https:/)){x=D.headers.location;continue}}else if(D.statusCode===429){let q=!0;if(i&&(q=yield i(T,x)),q){let z=0;const j=D.headers["retry-after"];typeof j=="string"&&j.match(/^[1-9][0-9]*$/)?z=parseInt(j)*1e3:z=o*parseInt(String(Math.random()*Math.pow(2,T))),yield D0(z);continue}}}}catch(q){D=q.response,D==null&&(k.cancel(),zt.throwError("missing response",O.errors.SERVER_ERROR,{requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,serverError:q,url:x}))}let U=D.body;if(w&&D.statusCode===304?U=null:!s&&(D.statusCode<200||D.statusCode>=300)&&(k.cancel(),zt.throwError("bad response",O.errors.SERVER_ERROR,{status:D.statusCode,headers:D.headers,body:Ar(U,D.headers?D.headers["content-type"]:null),requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,url:x})),t)try{const q=yield t(U,D);return k.cancel(),q}catch(q){if(q.throttleRetry&&T<r){let z=!0;if(i&&(z=yield i(T,x)),z){const j=o*parseInt(String(Math.random()*Math.pow(2,T)));yield D0(j);continue}}k.cancel(),zt.throwError("processing response error",O.errors.SERVER_ERROR,{body:Ar(U,D.headers?D.headers["content-type"]:null),error:q,requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,url:x})}return k.cancel(),U}return zt.throwError("failed response",O.errors.SERVER_ERROR,{requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,url:x})})})();return Promise.race([k.promise,S])}function ui(n,e,t){let r=(o,s)=>{let c=null;if(o!=null)try{c=JSON.parse(an(o))}catch(x){zt.throwError("invalid JSON",O.errors.SERVER_ERROR,{body:o,error:x})}return t&&(c=t(c,s)),c},i=null;if(e!=null){i=ut(e);const o=typeof n=="string"?{url:n}:nt(n);o.headers?Object.keys(o.headers).filter(c=>c.toLowerCase()==="content-type").length!==0||(o.headers=nt(o.headers),o.headers["content-type"]="application/json"):o.headers={"content-type":"application/json"},n=o}return pa(n,i,r)}function Xr(n,e){return e||(e={}),e=nt(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(t,r){let i=null,o=!1;const s=()=>o?!1:(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{s()&&r(new Error("timeout"))},e.timeout));const c=e.retryLimit;let x=0;function g(){return n().then(function(w){if(w!==void 0)s()&&t(w);else if(e.oncePoll)e.oncePoll.once("poll",g);else if(e.onceBlock)e.onceBlock.once("block",g);else if(!o){if(x++,x>c){s()&&r(new Error("retry limit reached"));return}let M=e.interval*parseInt(String(Math.random()*Math.pow(2,x)));M<e.floor&&(M=e.floor),M>e.ceiling&&(M=e.ceiling),setTimeout(g,M)}return null},function(w){s()&&r(w)})}g()})}var Yi,U0;function Cu(){if(U0)return Yi;U0=1;for(var n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",e={},t=0;t<n.length;t++){var r=n.charAt(t);if(e[r]!==void 0)throw new TypeError(r+" is ambiguous");e[r]=t}function i(k){var S=k>>25;return(k&33554431)<<5^-(S>>0&1)&996825010^-(S>>1&1)&642813549^-(S>>2&1)&513874426^-(S>>3&1)&1027748829^-(S>>4&1)&705979059}function o(k){for(var S=1,T=0;T<k.length;++T){var D=k.charCodeAt(T);if(D<33||D>126)return"Invalid prefix ("+k+")";S=i(S)^D>>5}for(S=i(S),T=0;T<k.length;++T){var U=k.charCodeAt(T);S=i(S)^U&31}return S}function s(k,S,T){if(T=T||90,k.length+7+S.length>T)throw new TypeError("Exceeds length limit");k=k.toLowerCase();var D=o(k);if(typeof D=="string")throw new Error(D);for(var U=k+"1",q=0;q<S.length;++q){var z=S[q];if(z>>5!==0)throw new Error("Non 5-bit word");D=i(D)^z,U+=n.charAt(z)}for(q=0;q<6;++q)D=i(D);for(D^=1,q=0;q<6;++q){var j=D>>(5-q)*5&31;U+=n.charAt(j)}return U}function c(k,S){if(S=S||90,k.length<8)return k+" too short";if(k.length>S)return"Exceeds length limit";var T=k.toLowerCase(),D=k.toUpperCase();if(k!==T&&k!==D)return"Mixed-case string "+k;k=T;var U=k.lastIndexOf("1");if(U===-1)return"No separator character for "+k;if(U===0)return"Missing prefix for "+k;var q=k.slice(0,U),z=k.slice(U+1);if(z.length<6)return"Data too short";var j=o(q);if(typeof j=="string")return j;for(var Y=[],X=0;X<z.length;++X){var ie=z.charAt(X),se=e[ie];if(se===void 0)return"Unknown character "+ie;j=i(j)^se,!(X+6>=z.length)&&Y.push(se)}return j!==1?"Invalid checksum for "+k:{prefix:q,words:Y}}function x(){var k=c.apply(null,arguments);if(typeof k=="object")return k}function g(k){var S=c.apply(null,arguments);if(typeof S=="object")return S;throw new Error(S)}function w(k,S,T,D){for(var U=0,q=0,z=(1<<T)-1,j=[],Y=0;Y<k.length;++Y)for(U=U<<S|k[Y],q+=S;q>=T;)q-=T,j.push(U>>q&z);if(D)q>0&&j.push(U<<T-q&z);else{if(q>=S)return"Excess padding";if(U<<T-q&z)return"Non-zero padding"}return j}function M(k){var S=w(k,8,5,!0);if(Array.isArray(S))return S}function C(k){var S=w(k,8,5,!0);if(Array.isArray(S))return S;throw new Error(S)}function G(k){var S=w(k,5,8,!1);if(Array.isArray(S))return S}function H(k){var S=w(k,5,8,!1);if(Array.isArray(S))return S;throw new Error(S)}return Yi={decodeUnsafe:x,decode:g,encode:s,toWordsUnsafe:M,toWords:C,fromWordsUnsafe:G,fromWords:H},Yi}var Nu=Cu();const L0=sn(Nu),hi="providers/5.8.0",hn=new O(hi);class fe{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),i=this.blockTag.bind(this),o=this.data.bind(this),s=this.hash.bind(this),c=this.hex.bind(this),x=this.number.bind(this),g=this.type.bind(this),w=M=>this.data(M,!0);return e.transaction={hash:s,type:g,accessList:fe.allowNull(this.accessList.bind(this),null),blockHash:fe.allowNull(s,null),blockNumber:fe.allowNull(x,null),transactionIndex:fe.allowNull(x,null),confirmations:fe.allowNull(x,null),from:t,gasPrice:fe.allowNull(r),maxPriorityFeePerGas:fe.allowNull(r),maxFeePerGas:fe.allowNull(r),gasLimit:r,to:fe.allowNull(t,null),value:r,nonce:x,data:o,r:fe.allowNull(this.uint256),s:fe.allowNull(this.uint256),v:fe.allowNull(x),creates:fe.allowNull(t,null),raw:fe.allowNull(o)},e.transactionRequest={from:fe.allowNull(t),nonce:fe.allowNull(x),gasLimit:fe.allowNull(r),gasPrice:fe.allowNull(r),maxPriorityFeePerGas:fe.allowNull(r),maxFeePerGas:fe.allowNull(r),to:fe.allowNull(t),value:fe.allowNull(r),data:fe.allowNull(w),type:fe.allowNull(x),accessList:fe.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:x,blockNumber:x,transactionHash:s,address:t,topics:fe.arrayOf(s),data:o,logIndex:x,blockHash:s},e.receipt={to:fe.allowNull(this.address,null),from:fe.allowNull(this.address,null),contractAddress:fe.allowNull(t,null),transactionIndex:x,root:fe.allowNull(c),gasUsed:r,logsBloom:fe.allowNull(o),blockHash:s,transactionHash:s,logs:fe.arrayOf(this.receiptLog.bind(this)),blockNumber:x,confirmations:fe.allowNull(x,null),cumulativeGasUsed:r,effectiveGasPrice:fe.allowNull(r),status:fe.allowNull(x),type:g},e.block={hash:fe.allowNull(s),parentHash:s,number:x,timestamp:x,nonce:fe.allowNull(c),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:fe.allowNull(t),extraData:o,transactions:fe.allowNull(fe.arrayOf(s)),baseFeePerGas:fe.allowNull(r)},e.blockWithTransactions=nt(e.block),e.blockWithTransactions.transactions=fe.allowNull(fe.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:fe.allowNull(i,void 0),toBlock:fe.allowNull(i,void 0),blockHash:fe.allowNull(s,void 0),address:fe.allowNull(t,void 0),topics:fe.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:fe.allowNull(x),blockHash:fe.allowNull(s),transactionIndex:x,removed:fe.allowNull(this.boolean.bind(this)),address:t,data:fe.allowFalsish(o,"0x"),topics:fe.arrayOf(s),transactionHash:s,logIndex:x},e}accessList(e){return zr(e||[])}number(e){return e==="0x"?0:ee.from(e).toNumber()}type(e){return e==="0x"||e==null?0:ee.from(e).toNumber()}bigNumber(e){return ee.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return typeof e=="string"&&(!t&&e.substring(0,2)!=="0x"&&(e="0x"+e),ve(e))?e.toLowerCase():hn.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!==0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return et(e)}callAddress(e){if(!ve(e,32))return null;const t=et(ft(e,12));return t===ff?null:t}contractAddress(e){return yo(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||ve(e))return ii(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return Pr(r)!==32?hn.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(e==null)return null;const t=ee.from(e);try{return t.toNumber()}catch{}return null}uint256(e){if(!ve(e))throw new Error("invalid uint256");return We(e,32)}_block(e,t){e.author!=null&&e.miner==null&&(e.miner=e.author);const r=e._difficulty!=null?e._difficulty:e.difficulty,i=fe.check(t,e);return i._difficulty=r==null?null:ee.from(r),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return fe.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&ee.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const t=fe.check(this.formats.transaction,e);if(e.chainId!=null){let r=e.chainId;ve(r)&&(r=ee.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;r==null&&t.v==null&&(r=e.chainId),ve(r)&&(r=ee.from(r).toNumber()),typeof r!="number"&&t.v!=null&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),typeof r!="number"&&(r=0),t.chainId=r}return t.blockHash&&t.blockHash.replace(/0/g,"")==="x"&&(t.blockHash=null),t}transaction(e){return $s(e)}receiptLog(e){return fe.check(this.formats.receiptLog,e)}receipt(e){const t=fe.check(this.formats.receipt,e);if(t.root!=null)if(t.root.length<=4){const r=ee.from(t.root).toNumber();r===0||r===1?(t.status!=null&&t.status!==r&&hn.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=r,delete t.root):hn.throwArgumentError("invalid alt-root-status","value.root",t.root)}else t.root.length!==66&&hn.throwArgumentError("invalid root hash","value.root",t.root);return t.status!=null&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map(t=>this.topics(t)):e!=null?this.hash(e,!0):null}filter(e){return fe.check(this.formats.filter,e)}filterLog(e){return fe.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const i in e)try{const o=e[i](t[i]);o!==void 0&&(r[i]=o)}catch(o){throw o.checkKey=i,o.checkValue=t[i],o}return r}static allowNull(e,t){return(function(r){return r==null?t:e(r)})}static allowFalsish(e,t){return(function(r){return r?e(r):t})}static arrayOf(e){return(function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach(function(i){r.push(e(i))}),r})}}var pe=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const ge=new O(hi),Ru=10;function G0(n){return n==null?"null":(Pr(n)!==32&&ge.throwArgumentError("invalid topic","topic",n),n.toLowerCase())}function q0(n){for(n=n.slice();n.length>0&&n[n.length-1]==null;)n.pop();return n.map(e=>{if(Array.isArray(e)){const t={};e.forEach(i=>{t[G0(i)]=!0});const r=Object.keys(t);return r.sort(),r.join("|")}else return G0(e)}).join("&")}function Bu(n){return n===""?[]:n.split(/&/g).map(e=>{if(e==="")return[];const t=e.split("|").map(r=>r==="null"?null:r);return t.length===1?t[0]:t})}function Jr(n){if(typeof n=="string"){if(n=n.toLowerCase(),Pr(n)===32)return"tx:"+n;if(n.indexOf(":")===-1)return n}else{if(Array.isArray(n))return"filter:*:"+q0(n);if(nc.isForkEvent(n))throw ge.warn("not implemented"),new Error("not implemented");if(n&&typeof n=="object")return"filter:"+(n.address||"*")+":"+q0(n.topics||[])}throw new Error("invalid event - "+n)}function ln(){return new Date().getTime()}function z0(n){return new Promise(e=>{setTimeout(e,n)})}const Tu=["block","network","pending","poll"];class Fu{constructor(e,t,r){Q(this,"tag",e),Q(this,"listener",t),Q(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const t=e[1],r=Bu(e[2]),i={};return r.length>0&&(i.topics=r),t&&t!=="*"&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||Tu.indexOf(this.tag)>=0}}const Ou={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Xi(n){return We(ee.from(n).toHexString(),32)}function H0(n){return rn.encode(rt([n,ft(Ir(Ir(n)),0,4)]))}const ba=new RegExp("^(ipfs)://(.*)$","i"),K0=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ba,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Wn(n,e){try{return an(Sn(n,e))}catch{}return null}function Sn(n,e){if(n==="0x")return null;const t=ee.from(ft(n,e,e+32)).toNumber(),r=ee.from(ft(n,t,t+32)).toNumber();return ft(n,t+32,t+32+r)}function Zi(n){return n.match(/^ipfs:\/\/ipfs\//i)?n=n.substring(12):n.match(/^ipfs:\/\//i)?n=n.substring(7):ge.throwArgumentError("unsupported IPFS format","link",n),`https://gateway.ipfs.io/ipfs/${n}`}function J0(n){const e=Z(n);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function Du(n){if(n.length%32===0)return n;const e=new Uint8Array(Math.ceil(n.length/32)*32);return e.set(n),e}function ga(n){const e=[];let t=0;for(let r=0;r<n.length;r++)e.push(null),t+=32;for(let r=0;r<n.length;r++){const i=Z(n[r]);e[r]=J0(t),e.push(J0(i.length)),e.push(Du(i)),t+=32+Math.ceil(i.length/32)*32}return At(e)}class V0{constructor(e,t,r,i){Q(this,"provider",e),Q(this,"name",r),Q(this,"address",e.formatter.address(t)),Q(this,"_resolvedAddress",i)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>ee.from(e).eq(1)).catch(e=>{if(e.code===O.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,t){return pe(this,void 0,void 0,function*(){const r={to:this.address,ccipReadEnabled:!0,data:At([e,bn(this.name),t||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,r.data=At(["0x9061b923",ga([Ts(this.name),r.data])]));try{let o=yield this.provider.call(r);return Z(o).length%32===4&&ge.throwError("resolver threw error",O.errors.CALL_EXCEPTION,{transaction:r,data:o}),i&&(o=Sn(o,0)),o}catch(o){if(o.code===O.errors.CALL_EXCEPTION)return null;throw o}})}_fetchBytes(e,t){return pe(this,void 0,void 0,function*(){const r=yield this._fetch(e,t);return r!=null?Sn(r,0):null})}_getAddress(e,t){const r=Ou[String(e)];if(r==null&&ge.throwError(`unsupported coin type: ${e}`,O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),r.ilk==="eth")return this.provider.formatter.address(t);const i=Z(t);if(r.p2pkh!=null){const o=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){const s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return H0(rt([[r.p2pkh],"0x"+o[2]]))}}if(r.p2sh!=null){const o=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(o){const s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return H0(rt([[r.p2sh],"0x"+o[2]]))}}if(r.prefix!=null){const o=i[1];let s=i[0];if(s===0?o!==20&&o!==32&&(s=-1):s=-1,s>=0&&i.length===2+o&&o>=1&&o<=75){const c=L0.toWords(i.slice(2));return c.unshift(s),L0.encode(r.prefix,c)}}return null}getAddress(e){return pe(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===lf?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===O.errors.CALL_EXCEPTION)return null;throw i}const t=yield this._fetchBytes("0xf1cb7e06",Xi(e));if(t==null||t==="0x")return null;const r=this._getAddress(e,t);return r==null&&ge.throwError("invalid or unsupported coin data",O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r})}getAvatar(){return pe(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(t==null)return null;for(let r=0;r<K0.length;r++){const i=t.match(K0[r]);if(i==null)continue;const o=i[1].toLowerCase();switch(o){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:Zi(t)};case"erc721":case"erc1155":{const s=o==="erc721"?"0xc87b56dd":"0x0e89341c";e.push({type:o,content:t});const c=this._resolvedAddress||(yield this.getAddress()),x=(i[2]||"").split("/");if(x.length!==2)return null;const g=yield this.provider.formatter.address(x[0]),w=We(ee.from(x[1]).toHexString(),32);if(o==="erc721"){const k=this.provider.formatter.callAddress(yield this.provider.call({to:g,data:At(["0x6352211e",w])}));if(c!==k)return null;e.push({type:"owner",content:k})}else if(o==="erc1155"){const k=ee.from(yield this.provider.call({to:g,data:At(["0x00fdd58e",We(c,32),w])}));if(k.isZero())return null;e.push({type:"balance",content:k.toString()})}const M={to:this.provider.formatter.address(x[0]),data:At([s,w])};let C=Wn(yield this.provider.call(M),0);if(C==null)return null;e.push({type:"metadata-url-base",content:C}),o==="erc1155"&&(C=C.replace("{id}",w.substring(2)),e.push({type:"metadata-url-expanded",content:C})),C.match(/^ipfs:/i)&&(C=Zi(C)),e.push({type:"metadata-url",content:C});const G=yield ui(C);if(!G)return null;e.push({type:"metadata",content:JSON.stringify(G)});let H=G.image;if(typeof H!="string")return null;if(!H.match(/^(https:\/\/|data:)/i)){if(H.match(ba)==null)return null;e.push({type:"url-ipfs",content:H}),H=Zi(H)}return e.push({type:"url",content:H}),{linkage:e,url:H}}}}}catch{}return null})}getContentHash(){return pe(this,void 0,void 0,function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(e==null||e==="0x")return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const s=parseInt(t[3],16);if(t[4].length===s*2)return"ipfs://"+rn.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const s=parseInt(r[3],16);if(r[4].length===s*2)return"ipns://"+rn.encode("0x"+r[1])}const i=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(i&&i[1].length===64)return"bzz://"+i[1];const o=e.match(/^0x90b2c605([0-9a-f]*)$/);if(o&&o[1].length===68){const s={"=":"","+":"-","/":"_"};return"sia://"+Ms("0x"+o[1]).replace(/[=+\/]/g,x=>s[x])}return ge.throwError("invalid or unsupported content hash data",O.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return pe(this,void 0,void 0,function*(){let t=ut(e);t=rt([Xi(64),Xi(t.length),t]),t.length%32!==0&&(t=rt([t,We("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",re(t));return r==null||r==="0x"?null:an(r)})}}let $i=null,Uu=1;class Lu extends In{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Q(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(t=>{}),this._ready().catch(t=>{});else{const t=Wt(new.target,"getNetwork")(e);t?(Q(this,"_network",t),this.emit("network",t,null)):ge.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return pe(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||ge.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:Q(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Xr(()=>this._ready().then(e=>e,e=>{if(!(e.code===O.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return $i==null&&($i=new fe),$i}static getNetwork(e){return _u(e??"homestead")}ccipReadFetch(e,t,r){return pe(this,void 0,void 0,function*(){if(this.disableCcipRead||r.length===0)return null;const i=e.to.toLowerCase(),o=t.toLowerCase(),s=[];for(let c=0;c<r.length;c++){const x=r[c],g=x.replace("{sender}",i).replace("{data}",o),w=x.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:i}),M=yield ui({url:g,errorPassThrough:!0},w,(G,H)=>(G.status=H.statusCode,G));if(M.data)return M.data;const C=M.message||"unknown error";if(M.status>=400&&M.status<500)return ge.throwError(`response not found during CCIP fetch: ${C}`,O.errors.SERVER_ERROR,{url:x,errorMessage:C});s.push(C)}return ge.throwError(`error encountered during CCIP fetch: ${s.map(c=>JSON.stringify(c)).join(", ")}`,O.errors.SERVER_ERROR,{urls:r,errorMessages:s})})}_getInternalBlockNumber(e){return pe(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const o=yield i;if(ln()-o.respTime<=e)return o.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const t=ln(),r=Te({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:o})=>{if(o)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),o;const s=ln();return i=ee.from(i).toNumber(),i<this._maxInternalBlockNumber&&(i=this._maxInternalBlockNumber),this._maxInternalBlockNumber=i,this._setFastBlockNumber(i),{blockNumber:i,reqTime:t,respTime:s}});return this._internalBlockNumber=r,r.catch(i=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)}),(yield r).blockNumber})}poll(){return pe(this,void 0,void 0,function*(){const e=Uu++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)ge.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",ge.makeError("network block skew detected",O.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let i=this._emitted.block+1;i<=r;i++)this.emit("block",i);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const o=this._emitted[i];o!=="pending"&&r-o>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=r-1),this._events.forEach(i=>{switch(i.type){case"tx":{const o=i.hash;let s=this.getTransactionReceipt(o).then(c=>(!c||c.blockNumber==null||(this._emitted["t:"+o]=c.blockNumber,this.emit(o,c)),null)).catch(c=>{this.emit("error",c)});t.push(s);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=r-1);const o=i.filter;o.fromBlock=i._lastBlockNumber+1,o.toBlock=r;const s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);const c=this.getLogs(o).then(x=>{i._inflight=!1,x.length!==0&&x.forEach(g=>{g.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=g.blockNumber),this._emitted["b:"+g.blockHash]=g.blockNumber,this._emitted["t:"+g.transactionHash]=g.blockNumber,this.emit(o,g)})}).catch(x=>{this.emit("error",x),i._inflight=!1});t.push(c)}break}}}),this._lastBlockNumber=r,Promise.all(t).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return pe(this,void 0,void 0,function*(){return ge.throwError("provider does not support network detection",O.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return pe(this,void 0,void 0,function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield z0(0),this._network;const r=ge.makeError("underlying network changed",O.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=ln();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(t=>((this._fastBlockNumber==null||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&e<this._fastBlockNumber||(this._fastQueryDate=ln(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return pe(this,void 0,void 0,function*(){return this._waitForTransaction(e,t??1,r||0,null)})}_waitForTransaction(e,t,r,i){return pe(this,void 0,void 0,function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise((s,c)=>{const x=[];let g=!1;const w=function(){return g?!0:(g=!0,x.forEach(C=>{C()}),!1)},M=C=>{C.confirmations<t||w()||s(C)};if(this.on(e,M),x.push(()=>{this.removeListener(e,M)}),i){let C=i.startBlock,G=null;const H=k=>pe(this,void 0,void 0,function*(){g||(yield z0(1e3),this.getTransactionCount(i.from).then(S=>pe(this,void 0,void 0,function*(){if(!g){if(S<=i.nonce)C=k;else{{const T=yield this.getTransaction(e);if(T&&T.blockNumber!=null)return}for(G==null&&(G=C-3,G<i.startBlock&&(G=i.startBlock));G<=k;){if(g)return;const T=yield this.getBlockWithTransactions(G);for(let D=0;D<T.transactions.length;D++){const U=T.transactions[D];if(U.hash===e)return;if(U.from===i.from&&U.nonce===i.nonce){if(g)return;const q=yield this.waitForTransaction(U.hash,t);if(w())return;let z="replaced";U.data===i.data&&U.to===i.to&&U.value.eq(i.value)?z="repriced":U.data==="0x"&&U.from===U.to&&U.value.isZero()&&(z="cancelled"),c(ge.makeError("transaction was replaced",O.errors.TRANSACTION_REPLACED,{cancelled:z==="replaced"||z==="cancelled",reason:z,replacement:this._wrapTransaction(U),hash:e,receipt:q}));return}}G++}}g||this.once("block",H)}}),S=>{g||this.once("block",H)}))});if(g)return;this.once("block",H),x.push(()=>{this.removeListener("block",H)})}if(typeof r=="number"&&r>0){const C=setTimeout(()=>{w()||c(ge.makeError("timeout exceeded",O.errors.TIMEOUT,{timeout:r}))},r);C.unref&&C.unref(),x.push(()=>{clearTimeout(C)})}})})}getBlockNumber(){return pe(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return ee.from(e)}catch(t){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}})}getBalance(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Te({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),i=yield this.perform("getBalance",r);try{return ee.from(i)}catch(o){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getBalance",params:r,result:i,error:o})}})}getTransactionCount(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Te({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),i=yield this.perform("getTransactionCount",r);try{return ee.from(i).toNumber()}catch(o){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:i,error:o})}})}getCode(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Te({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),i=yield this.perform("getCode",r);try{return re(i)}catch(o){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getCode",params:r,result:i,error:o})}})}getStorageAt(e,t,r){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield Te({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then(s=>ii(s))}),o=yield this.perform("getStorageAt",i);try{return re(o)}catch(s){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:s})}})}_wrapTransaction(e,t,r){if(t!=null&&Pr(t)!==32)throw new Error("invalid response - sendTransaction");const i=e;return t!=null&&e.hash!==t&&ge.throwError("Transaction hash mismatch from Provider.sendTransaction.",O.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=(o,s)=>pe(this,void 0,void 0,function*(){o==null&&(o=1),s==null&&(s=0);let c;o!==0&&r!=null&&(c={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const x=yield this._waitForTransaction(e.hash,o,s,c);return x==null&&o===0?null:(this._emitted["t:"+e.hash]=x.blockNumber,x.status===0&&ge.throwError("transaction failed",O.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:x}),x)}),i}sendTransaction(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then(o=>re(o)),r=this.formatter.transaction(e);r.confirmations==null&&(r.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const o=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,o,i)}catch(o){throw o.transaction=r,o.transactionHash=r.hash,o}})}_getTransactionRequest(e){return pe(this,void 0,void 0,function*(){const t=yield e,r={};return["from","to"].forEach(i=>{t[i]!=null&&(r[i]=Promise.resolve(t[i]).then(o=>o?this._getAddress(o):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{t[i]!=null&&(r[i]=Promise.resolve(t[i]).then(o=>o?ee.from(o):null))}),["type"].forEach(i=>{t[i]!=null&&(r[i]=Promise.resolve(t[i]).then(o=>o??null))}),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach(i=>{t[i]!=null&&(r[i]=Promise.resolve(t[i]).then(o=>o?re(o):null))}),this.formatter.transactionRequest(yield Te(r))})}_getFilter(e){return pe(this,void 0,void 0,function*(){e=yield e;const t={};return e.address!=null&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach(r=>{e[r]!=null&&(t[r]=e[r])}),["fromBlock","toBlock"].forEach(r=>{e[r]!=null&&(t[r]=this._getBlockTag(e[r]))}),this.formatter.filter(yield Te(t))})}_call(e,t,r){return pe(this,void 0,void 0,function*(){r>=Ru&&ge.throwError("CCIP read exceeded maximum redirections",O.errors.SERVER_ERROR,{redirects:r,transaction:e});const i=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&t==="latest"&&i!=null&&o.substring(0,10)==="0x556f1830"&&Pr(o)%32===4)try{const s=ft(o,4),c=ft(s,0,32);ee.from(c).eq(i)||ge.throwError("CCIP Read sender did not match",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const x=[],g=ee.from(ft(s,32,64)).toNumber(),w=ee.from(ft(s,g,g+32)).toNumber(),M=ft(s,g+32);for(let T=0;T<w;T++){const D=Wn(M,T*32);D==null&&ge.throwError("CCIP Read contained corrupt URL string",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),x.push(D)}const C=Sn(s,64);ee.from(ft(s,100,128)).isZero()||ge.throwError("CCIP Read callback selector included junk",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const G=ft(s,96,100),H=Sn(s,128),k=yield this.ccipReadFetch(e,C,x);k==null&&ge.throwError("CCIP Read disabled or provided no URLs",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const S={to:i,data:At([G,ga([k,H])])};return this._call(S,t,r+1)}catch(s){if(s.code===O.errors.SERVER_ERROR)throw s}try{return re(o)}catch(s){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:s})}})}call(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Te({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)})}estimateGas(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield Te({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return ee.from(r)}catch(i){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:i})}})}_getAddress(e){return pe(this,void 0,void 0,function*(){e=yield e,typeof e!="string"&&ge.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return t==null&&ge.throwError("ENS name not configured",O.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t})}_getBlock(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let r=-128;const i={includeTransactions:!!t};if(ve(e,32))i.blockHash=e;else try{i.blockTag=yield this._getBlockTag(e),ve(i.blockTag)&&(r=parseInt(i.blockTag.substring(2),16))}catch{ge.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return Xr(()=>pe(this,void 0,void 0,function*(){const o=yield this.perform("getBlock",i);if(o==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&r>this._emitted.block?null:void 0;if(t){let s=null;for(let x=0;x<o.transactions.length;x++){const g=o.transactions[x];if(g.blockNumber==null)g.confirmations=0;else if(g.confirmations==null){s==null&&(s=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let w=s-g.blockNumber+1;w<=0&&(w=1),g.confirmations=w}}const c=this.formatter.blockWithTransactions(o);return c.transactions=c.transactions.map(x=>this._wrapTransaction(x)),c}return this.formatter.block(o)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Xr(()=>pe(this,void 0,void 0,function*(){const r=yield this.perform("getTransaction",t);if(r==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(r);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Xr(()=>pe(this,void 0,void 0,function*(){const r=yield this.perform("getTransactionReceipt",t);if(r==null)return this._emitted["t:"+e]==null?null:void 0;if(r.blockHash==null)return;const i=this.formatter.receipt(r);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return i}),{oncePoll:this})})}getLogs(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield Te({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach(i=>{i.removed==null&&(i.removed=!1)}),fe.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return pe(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return pe(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&ge.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)})}getResolver(e){return pe(this,void 0,void 0,function*(){let t=e;for(;;){if(t===""||t==="."||e!=="eth"&&t==="eth")return null;const r=yield this._getResolver(t,"getResolver");if(r!=null){const i=new V0(this,r,e);return t!==e&&!(yield i.supportsWildcard())?null:i}t=t.split(".").slice(1).join(".")}})}_getResolver(e,t){return pe(this,void 0,void 0,function*(){t==null&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||ge.throwError("network does not support ENS",O.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const i=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+bn(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return pe(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(r){if(ve(e))throw r}typeof e!="string"&&ge.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null})}lookupAddress(e){return pe(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const t=e.substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(r==null)return null;const i=Wn(yield this.call({to:r,data:"0x691f3431"+bn(t).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return pe(this,void 0,void 0,function*(){let t=null;if(ve(e)){const o=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",s=yield this._getResolver(o,"getAvatar");if(!s)return null;t=new V0(this,s,o);try{const c=yield t.getAvatar();if(c)return c.url}catch(c){if(c.code!==O.errors.CALL_EXCEPTION)throw c}try{const c=Wn(yield this.call({to:s,data:"0x691f3431"+bn(o).substring(2)}),0);t=yield this.getResolver(c)}catch(c){if(c.code!==O.errors.CALL_EXCEPTION)throw c;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return r==null?null:r.url})}perform(e,t){return ge.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(t=>t.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(t=>t.pollable()).length>0}_addEventListener(e,t,r){const i=new Fu(Jr(e),t,r);return this._events.push(i),this._startEvent(i),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,i=[],o=Jr(e);return this._events=this._events.filter(s=>s.tag!==o?!0:(setTimeout(()=>{s.listener.apply(this,t)},0),r=!0,s.once?(i.push(s),!1):!0)),i.forEach(s=>{this._stopEvent(s)}),r}listenerCount(e){if(!e)return this._events.length;let t=Jr(e);return this._events.filter(r=>r.tag===t).length}listeners(e){if(e==null)return this._events.map(r=>r.listener);let t=Jr(e);return this._events.filter(r=>r.tag===t).map(r=>r.listener)}off(e,t){if(t==null)return this.removeAllListeners(e);const r=[];let i=!1,o=Jr(e);return this._events=this._events.filter(s=>s.tag!==o||s.listener!=t||i?!0:(i=!0,r.push(s),!1)),r.forEach(s=>{this._stopEvent(s)}),this}removeAllListeners(e){let t=[];if(e==null)t=this._events,this._events=[];else{const r=Jr(e);this._events=this._events.filter(i=>i.tag!==r?!0:(t.push(i),!1))}return t.forEach(r=>{this._stopEvent(r)}),this}}const Gu="abstract-signer/5.8.0";var Gt=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const qt=new O(Gu),qu=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],zu=[O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED];class Ro{constructor(){qt.checkAbstract(new.target,Ro),Q(this,"_isSigner",!0)}getBalance(e){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Gt(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const t=yield Te(this.checkTransaction(e));return yield this.provider.estimateGas(t)})}call(e,t){return Gt(this,void 0,void 0,function*(){this._checkProvider("call");const r=yield Te(this.checkTransaction(e));return yield this.provider.call(r,t)})}sendTransaction(e){return Gt(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)})}getChainId(){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Gt(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const r in e)qu.indexOf(r)===-1&&qt.throwArgumentError("invalid transaction key: "+r,"transaction",e);const t=nt(e);return t.from==null?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then(r=>(r[0].toLowerCase()!==r[1].toLowerCase()&&qt.throwArgumentError("from address mismatch","transaction",e),r[0])),t}populateTransaction(e){return Gt(this,void 0,void 0,function*(){const t=yield Te(this.checkTransaction(e));t.to!=null&&(t.to=Promise.resolve(t.to).then(i=>Gt(this,void 0,void 0,function*(){if(i==null)return null;const o=yield this.resolveName(i);return o==null&&qt.throwArgumentError("provided ENS name resolves to null","tx.to",i),o})),t.to.catch(i=>{}));const r=t.maxFeePerGas!=null||t.maxPriorityFeePerGas!=null;if(t.gasPrice!=null&&(t.type===2||r)?qt.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(t.type===0||t.type===1)&&r&&qt.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(t.type===2||t.type==null)&&t.maxFeePerGas!=null&&t.maxPriorityFeePerGas!=null)t.type=2;else if(t.type===0||t.type===1)t.gasPrice==null&&(t.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(t.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(t.type=2,t.gasPrice!=null){const o=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=o,t.maxPriorityFeePerGas=o}else t.maxFeePerGas==null&&(t.maxFeePerGas=i.maxFeePerGas),t.maxPriorityFeePerGas==null&&(t.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(r&&qt.throwError("network does not support EIP-1559",O.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),t.gasPrice==null&&(t.gasPrice=i.gasPrice),t.type=0):qt.throwError("failed to get consistent fee data",O.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else t.type===2&&(t.maxFeePerGas==null&&(t.maxFeePerGas=i.maxFeePerGas),t.maxPriorityFeePerGas==null&&(t.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return t.nonce==null&&(t.nonce=this.getTransactionCount("pending")),t.gasLimit==null&&(t.gasLimit=this.estimateGas(t).catch(i=>{if(zu.indexOf(i.code)>=0)throw i;return qt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:t})})),t.chainId==null?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&qt.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Te(t)})}_checkProvider(e){this.provider||qt.throwError("missing provider",O.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}var hr=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const at=new O(hi),Hu=["call","estimateGas"];function mn(n,e){if(n==null)return null;if(typeof n.message=="string"&&n.message.match("reverted")){const t=ve(n.data)?n.data:null;if(!e||t)return{message:n.message,data:t}}if(typeof n=="object"){for(const t in n){const r=mn(n[t],e);if(r)return r}return null}if(typeof n=="string")try{return mn(JSON.parse(n),e)}catch{}return null}function ma(n,e,t){const r=t.transaction||t.signedTransaction;if(n==="call"){const o=mn(e,!0);if(o)return o.data;at.throwError("missing revert data in call exception; Transaction reverted without a reason string",O.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:e})}if(n==="estimateGas"){let o=mn(e.body,!1);o==null&&(o=mn(e,!1)),o&&at.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:n,transaction:r,error:e})}let i=e.message;throw e.code===O.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&at.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:n,transaction:r}),i.match(/nonce (is )?too low/i)&&at.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:n,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&at.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:n,transaction:r}),i.match(/only replay-protected/i)&&at.throwError("legacy pre-eip-155 transactions not supported",O.errors.UNSUPPORTED_OPERATION,{error:e,method:n,transaction:r}),Hu.indexOf(n)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&at.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:n,transaction:r}),e}function W0(n){return new Promise(function(e){setTimeout(e,n)})}function Ku(n){if(n.error){const e=new Error(n.error.message);throw e.code=n.error.code,e.data=n.error.data,e}return n.result}function dn(n){return n&&n.toLowerCase()}const lo={};class ya extends Ro{constructor(e,t,r){if(super(),e!==lo)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Q(this,"provider",t),r==null&&(r=0),typeof r=="string"?(Q(this,"_address",this.provider.formatter.address(r)),Q(this,"_index",null)):typeof r=="number"?(Q(this,"_index",r),Q(this,"_address",null)):at.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return at.throwError("cannot alter JSON-RPC Signer connection",O.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Ju(lo,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&at.throwError("unknown account #"+this._index,O.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=nt(e);const t=this.getAddress().then(r=>(r&&(r=r.toLowerCase()),r));if(e.gasLimit==null){const r=nt(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(r=>hr(this,void 0,void 0,function*(){if(r==null)return null;const i=yield this.provider.resolveName(r);return i==null&&at.throwArgumentError("provided ENS name resolves to null","tx.to",r),i}))),Te({tx:Te(e),sender:t}).then(({tx:r,sender:i})=>{r.from!=null?r.from.toLowerCase()!==i&&at.throwArgumentError("from address mismatch","transaction",e):r.from=i;const o=this.provider.constructor.hexlifyTransaction(r,{from:!0});return this.provider.send("eth_sendTransaction",[o]).then(s=>s,s=>(typeof s.message=="string"&&s.message.match(/user denied/i)&&at.throwError("user rejected transaction",O.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),ma("sendTransaction",s,o)))})}signTransaction(e){return at.throwError("signing transactions is unsupported",O.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return hr(this,void 0,void 0,function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Xr(()=>hr(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(r);if(i!==null)return this.provider._wrapTransaction(i,r,t)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=r,i}})}signMessage(e){return hr(this,void 0,void 0,function*(){const t=typeof e=="string"?ut(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[re(t),r.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&at.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),i}})}_legacySignMessage(e){return hr(this,void 0,void 0,function*(){const t=typeof e=="string"?ut(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),re(t)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&at.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),i}})}_signTypedData(e,t,r){return hr(this,void 0,void 0,function*(){const i=yield gt.resolveNames(e,t,r,s=>this.provider.resolveName(s)),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(gt.getPayload(i.domain,t,i.value))])}catch(s){throw typeof s.message=="string"&&s.message.match(/user denied/i)&&at.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:t,value:i.value}}),s}})}unlock(e){return hr(this,void 0,void 0,function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])})}}class Ju extends ya{sendTransaction(e){return this.sendUncheckedTransaction(e).then(t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:r=>this.provider.waitForTransaction(t,r)}))}}const Vu={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Wu extends Lu{constructor(e,t){let r=t;r==null&&(r=new Promise((i,o)=>{setTimeout(()=>{this.detectNetwork().then(s=>{i(s)},s=>{o(s)})},0)})),super(r),e||(e=Wt(this.constructor,"defaultUrl")()),typeof e=="string"?Q(this,"connection",Object.freeze({url:e})):Q(this,"connection",Object.freeze(nt(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return hr(this,void 0,void 0,function*(){yield W0(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const t=Wt(this.constructor,"getNetwork");try{return t(ee.from(e).toNumber())}catch(r){return at.throwError("could not detect network",O.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:r})}}return at.throwError("could not detect network",O.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new ya(lo,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(t=>this.formatter.address(t)))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:sr(r),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const o=ui(this.connection,JSON.stringify(r),Ku).then(s=>(this.emit("debug",{action:"response",request:r,response:s,provider:this}),s),s=>{throw this.emit("debug",{action:"response",error:s,request:r,provider:this}),s});return i&&(this._cache[e]=o,setTimeout(()=>{this._cache[e]=null},0)),o}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[dn(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[dn(t.address),t.blockTag]];case"getCode":return["eth_getCode",[dn(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[dn(t.address),We(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[Wt(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[Wt(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&t.filter.address!=null&&(t.filter.address=dn(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return hr(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=t.transaction;if(i&&i.type!=null&&ee.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const o=yield this.getFeeData();o.maxFeePerGas==null&&o.maxPriorityFeePerGas==null&&(t=nt(t),t.transaction=nt(i),delete t.transaction.type)}}const r=this.prepareRequest(e,t);r==null&&at.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(i){return ma(e,i,t)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then(function(r){function i(){e.send("eth_getFilterChanges",[r]).then(function(o){if(e._pendingFilter!=t)return null;let s=Promise.resolve();return o.forEach(function(c){e._emitted["t:"+c.toLowerCase()]="pending",s=s.then(function(){return e.getTransaction(c).then(function(x){return e.emit("pending",x),null})})}),s.then(function(){return W0(1e3)})}).then(function(){if(e._pendingFilter!=t){e.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){i()},0),null}).catch(o=>{})}return i(),r}).catch(r=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=nt(Vu);if(t)for(const o in t)t[o]&&(r[o]=!0);po(e,r);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(o){if(e[o]==null)return;const s=ii(ee.from(e[o]));o==="gasLimit"&&(o="gas"),i[o]=s}),["from","to","data"].forEach(function(o){e[o]!=null&&(i[o]=re(e[o]))}),e.accessList&&(i.accessList=zr(e.accessList)),i}}const j0=new O(hi);let ju=1;function Q0(n,e){const t="Web3LegacyFetcher";return function(r,i){const o={method:r,params:i,id:ju++,jsonrpc:"2.0"};return new Promise((s,c)=>{this.emit("debug",{action:"request",fetcher:t,request:sr(o),provider:this}),e(o,(x,g)=>{if(x)return this.emit("debug",{action:"response",fetcher:t,error:x,request:o,provider:this}),c(x);if(this.emit("debug",{action:"response",fetcher:t,request:o,response:g,provider:this}),g.error){const w=new Error(g.error.message);return w.code=g.error.code,w.data=g.error.data,c(w)}s(g.result)})})}}function Qu(n){return function(e,t){t==null&&(t=[]);const r={method:e,params:t};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:sr(r),provider:this}),n.request(r).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:i,provider:this}),i})}}class ih extends Wu{constructor(e,t){e==null&&j0.throwArgumentError("missing provider","provider",e);let r=null,i=null,o=null;typeof e=="function"?(r="unknown:",i=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),o=e,e.request?(r===""&&(r="eip-1193:"),i=Qu(e)):e.sendAsync?i=Q0(e,e.sendAsync.bind(e)):e.send?i=Q0(e,e.send.bind(e)):j0.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),Q(this,"jsonRpcFetchFunc",i),Q(this,"provider",o)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const Yu="units/5.8.0",Xu=new O(Yu),Zu=["wei","kwei","mwei","gwei","szabo","finney","ether"];function va(n,e){return qn(n,e)}function wa(n,e){if(typeof n!="string"&&Xu.throwArgumentError("value must be a string","value",n),typeof e=="string"){const t=Zu.indexOf(e);t!==-1&&(e=3*t)}return Zt(n,e??18)}function $u(n){return va(n,18)}function eh(n){return wa(n,18)}const oh=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:Es,ConstructorFragment:Jt,ErrorFragment:lr,EventFragment:rr,FormatTypes:Ee,Fragment:nr,FunctionFragment:Vt,HDNode:kt,Indexed:Zn,Interface:oo,LogDescription:Ls,Logger:O,ParamType:ct,SigningKey:Tr,get SupportedAlgorithm(){return nn},TransactionDescription:Gs,get TransactionTypes(){return fo},get UnicodeNormalizationForm(){return xr},Utf8ErrorFuncs:vs,get Utf8ErrorReason(){return Pt},_TypedDataEncoder:gt,_fetchData:pa,accessListify:zr,arrayify:Z,base58:rn,checkProperties:po,checkResultErrors:hs,computeAddress:Sr,computeHmac:_n,computePublicKey:_o,concat:rt,deepCopy:sr,defaultAbiCoder:_s,defaultPath:on,defineReadOnly:Q,dnsEncode:Ts,entropyToMnemonic:ci,fetchJson:ui,formatEther:$u,formatUnits:va,getAddress:et,getContractAddress:yo,getStatic:Wt,hashMessage:Fs,hexConcat:At,hexDataLength:Pr,hexDataSlice:ft,hexStripZeros:rs,hexValue:ii,hexZeroPad:We,hexlify:re,id:_r,isBytes:Ur,isBytesLike:Pn,isHexString:ve,joinSignature:no,keccak256:je,mnemonicToEntropy:ko,mnemonicToSeed:aa,namehash:bn,parseEther:eh,parseTransaction:$s,parseUnits:wa,poll:Xr,randomBytes:Yr,recoverAddress:Po,recoverPublicKey:js,resolveProperties:Te,ripemd160:ia,serializeTransaction:co,sha256:Ir,shallowCopy:nt,splitSignature:Lr,stripZeros:or,toUtf8Bytes:ut,toUtf8CodePoints:As,toUtf8String:an,zeroPad:ts},Symbol.toStringTag,{value:"Module"}));export{ee as B,nh as C,Wu as J,ih as W,eh as a,We as b,ii as c,wa as d,Ma as e,$u as f,Bo as g,re as h,ac as i,kn as j,ka as k,xc as l,Wr as m,Pi as p,Yr as r,oh as u};
|
|
9
|
+
`)}static register(e,t){t||(t=e.locale)}}const Qc="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let gn=null;function S0(n){if(gn==null&&(gn=Qc.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Nn.check(n)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw gn=null,new Error("BIP39 Wordlist for en (English) FAILED")}class Yc extends Nn{constructor(){super("en")}getWord(e){return S0(this),gn[e]}getWordIndex(e){return S0(this),gn.indexOf(e)}}const oa=new Yc;Nn.register(oa);const P0={en:oa},Xc="hdnode/5.8.0",ri=new O(Xc),Zc=ee.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),$c=ut("Bitcoin seed"),cn=2147483648;function sa(n){return(1<<n)-1<<8-n}function eu(n){return(1<<n)-1}function On(n){return We(re(n),32)}function M0(n){return rn.encode(rt([n,ft(Ir(Ir(n)),0,4)]))}function Io(n){if(n==null)return P0.en;if(typeof n=="string"){const e=P0[n];return e==null&&ri.throwArgumentError("unknown locale","wordlist",n),e}return n}const Hr={},on="m/44'/60'/0'/0/0";class kt{constructor(e,t,r,i,o,s,c,x){if(e!==Hr)throw new Error("HDNode constructor cannot be called directly");if(t){const g=new Tr(t);Q(this,"privateKey",g.privateKey),Q(this,"publicKey",g.compressedPublicKey)}else Q(this,"privateKey",null),Q(this,"publicKey",re(r));Q(this,"parentFingerprint",i),Q(this,"fingerprint",ft(ia(Ir(this.publicKey)),0,4)),Q(this,"address",Sr(this.publicKey)),Q(this,"chainCode",o),Q(this,"index",s),Q(this,"depth",c),x==null?(Q(this,"mnemonic",null),Q(this,"path",null)):typeof x=="string"?(Q(this,"mnemonic",null),Q(this,"path",x)):(Q(this,"mnemonic",x),Q(this,"path",x.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return M0(rt([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",re(this.depth),this.parentFingerprint,We(re(this.index),4),this.chainCode,this.privateKey!=null?rt(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new kt(Hr,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(e&~cn));const r=new Uint8Array(37);if(e&cn){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Z(this.privateKey),1),t&&(t+="'")}else r.set(Z(this.publicKey));for(let M=24;M>=0;M-=8)r[33+(M>>3)]=e>>24-M&255;const i=Z(_n(nn.sha512,this.chainCode,r)),o=i.slice(0,32),s=i.slice(32);let c=null,x=null;this.privateKey?c=On(ee.from(o).add(this.privateKey).mod(Zc)):x=new Tr(re(o))._addPoint(this.publicKey);let g=t;const w=this.mnemonic;return w&&(g=Object.freeze({phrase:w.phrase,path:t,locale:w.locale||"en"})),new kt(Hr,c,x,this.fingerprint,On(s),e,this.depth+1,g)}derivePath(e){const t=e.split("/");if(t.length===0||t[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);t[0]==="m"&&t.shift();let r=this;for(let i=0;i<t.length;i++){const o=t[i];if(o.match(/^[0-9]+'$/)){const s=parseInt(o.substring(0,o.length-1));if(s>=cn)throw new Error("invalid path index - "+o);r=r._derive(cn+s)}else if(o.match(/^[0-9]+$/)){const s=parseInt(o);if(s>=cn)throw new Error("invalid path index - "+o);r=r._derive(s)}else throw new Error("invalid path component - "+o)}return r}static _fromSeed(e,t){const r=Z(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const i=Z(_n(nn.sha512,$c,r));return new kt(Hr,On(i.slice(0,32)),null,"0x00000000",On(i.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return r=Io(r),e=ci(ko(e,r),r),kt._fromSeed(aa(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return kt._fromSeed(e,null)}static fromExtendedKey(e){const t=rn.decode(e);(t.length!==82||M0(t.slice(0,78))!==e)&&ri.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],i=re(t.slice(5,9)),o=parseInt(re(t.slice(9,13)).substring(2),16),s=re(t.slice(13,45)),c=t.slice(45,78);switch(re(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new kt(Hr,null,re(c),i,s,o,r,null);case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new kt(Hr,re(c.slice(1)),null,i,s,o,r,null)}return ri.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function aa(n,e){e||(e="");const t=ut("mnemonic"+e,xr.NFKD);return Mo(ut(n,xr.NFKD),t,2048,64,"sha512")}function ko(n,e){e=Io(e),ri.checkNormalize();const t=e.split(n);if(t.length%3!==0)throw new Error("invalid mnemonic");const r=Z(new Uint8Array(Math.ceil(11*t.length/8)));let i=0;for(let g=0;g<t.length;g++){let w=e.getWordIndex(t[g].normalize("NFKD"));if(w===-1)throw new Error("invalid mnemonic");for(let M=0;M<11;M++)w&1<<10-M&&(r[i>>3]|=1<<7-i%8),i++}const o=32*t.length/3,s=t.length/3,c=sa(s);if((Z(Ir(r.slice(0,o/8)))[0]&c)!==(r[r.length-1]&c))throw new Error("invalid checksum");return re(r.slice(0,o/8))}function ci(n,e){if(e=Io(e),n=Z(n),n.length%4!==0||n.length<16||n.length>32)throw new Error("invalid entropy");const t=[0];let r=11;for(let s=0;s<n.length;s++)r>8?(t[t.length-1]<<=8,t[t.length-1]|=n[s],r-=8):(t[t.length-1]<<=r,t[t.length-1]|=n[s]>>8-r,t.push(n[s]&eu(8-r)),r+=3);const i=n.length/4,o=Z(Ir(n))[0]&sa(i);return t[t.length-1]<<=i,t[t.length-1]|=o>>8-i,e.join(t.map(s=>e.getWord(s)))}const tu="random/5.8.0",uo=new O(tu);function ru(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof Bo<"u")return Bo;throw new Error("unable to locate global object")}const I0=ru();let Vn=I0.crypto||I0.msCrypto;(!Vn||!Vn.getRandomValues)&&(uo.warn("WARNING: Missing strong random number source"),Vn={getRandomValues:function(n){return uo.throwError("no secure random source avaialble",O.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Yr(n){(n<=0||n>1024||n%1||n!=n)&&uo.throwArgumentError("invalid length","length",n);const e=new Uint8Array(n);return Vn.getRandomValues(e),Z(e)}var ji={exports:{}},k0;function nu(){return k0||(k0=1,(function(n,e){(function(t){function r(p){return parseInt(p)===p}function i(p){if(!r(p.length))return!1;for(var f=0;f<p.length;f++)if(!r(p[f])||p[f]<0||p[f]>255)return!1;return!0}function o(p,f){if(p.buffer&&ArrayBuffer.isView(p)&&p.name==="Uint8Array")return f&&(p.slice?p=p.slice():p=Array.prototype.slice.call(p)),p;if(Array.isArray(p)){if(!i(p))throw new Error("Array contains invalid value: "+p);return new Uint8Array(p)}if(r(p.length)&&i(p))return new Uint8Array(p);throw new Error("unsupported array-like object")}function s(p){return new Uint8Array(p)}function c(p,f,A,B,l){(B!=null||l!=null)&&(p.slice?p=p.slice(B,l):p=Array.prototype.slice.call(p,B,l)),f.set(p,A)}var x=(function(){function p(A){var B=[],l=0;for(A=encodeURI(A);l<A.length;){var N=A.charCodeAt(l++);N===37?(B.push(parseInt(A.substr(l,2),16)),l+=2):B.push(N)}return o(B)}function f(A){for(var B=[],l=0;l<A.length;){var N=A[l];N<128?(B.push(String.fromCharCode(N)),l++):N>191&&N<224?(B.push(String.fromCharCode((N&31)<<6|A[l+1]&63)),l+=2):(B.push(String.fromCharCode((N&15)<<12|(A[l+1]&63)<<6|A[l+2]&63)),l+=3)}return B.join("")}return{toBytes:p,fromBytes:f}})(),g=(function(){function p(B){for(var l=[],N=0;N<B.length;N+=2)l.push(parseInt(B.substr(N,2),16));return l}var f="0123456789abcdef";function A(B){for(var l=[],N=0;N<B.length;N++){var J=B[N];l.push(f[(J&240)>>4]+f[J&15])}return l.join("")}return{toBytes:p,fromBytes:A}})(),w={16:10,24:12,32:14},M=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],C=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],G=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],H=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],k=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],S=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],T=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],D=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],U=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],q=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],z=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],j=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Y=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],X=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],ie=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function se(p){for(var f=[],A=0;A<p.length;A+=4)f.push(p[A]<<24|p[A+1]<<16|p[A+2]<<8|p[A+3]);return f}var ne=function(p){if(!(this instanceof ne))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:o(p,!0)}),this._prepare()};ne.prototype._prepare=function(){var p=w[this.key.length];if(p==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var f=0;f<=p;f++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var A=(p+1)*4,B=this.key.length/4,l=se(this.key),N,f=0;f<B;f++)N=f>>2,this._Ke[N][f%4]=l[f],this._Kd[p-N][f%4]=l[f];for(var J=0,K=B,W;K<A;){if(W=l[B-1],l[0]^=C[W>>16&255]<<24^C[W>>8&255]<<16^C[W&255]<<8^C[W>>24&255]^M[J]<<24,J+=1,B!=8)for(var f=1;f<B;f++)l[f]^=l[f-1];else{for(var f=1;f<B/2;f++)l[f]^=l[f-1];W=l[B/2-1],l[B/2]^=C[W&255]^C[W>>8&255]<<8^C[W>>16&255]<<16^C[W>>24&255]<<24;for(var f=B/2+1;f<B;f++)l[f]^=l[f-1]}for(var f=0,oe,$;f<B&&K<A;)oe=K>>2,$=K%4,this._Ke[oe][$]=l[f],this._Kd[p-oe][$]=l[f++],K++}for(var oe=1;oe<p;oe++)for(var $=0;$<4;$++)W=this._Kd[oe][$],this._Kd[oe][$]=j[W>>24&255]^Y[W>>16&255]^X[W>>8&255]^ie[W&255]},ne.prototype.encrypt=function(p){if(p.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var f=this._Ke.length-1,A=[0,0,0,0],B=se(p),l=0;l<4;l++)B[l]^=this._Ke[0][l];for(var N=1;N<f;N++){for(var l=0;l<4;l++)A[l]=H[B[l]>>24&255]^k[B[(l+1)%4]>>16&255]^S[B[(l+2)%4]>>8&255]^T[B[(l+3)%4]&255]^this._Ke[N][l];B=A.slice()}for(var J=s(16),K,l=0;l<4;l++)K=this._Ke[f][l],J[4*l]=(C[B[l]>>24&255]^K>>24)&255,J[4*l+1]=(C[B[(l+1)%4]>>16&255]^K>>16)&255,J[4*l+2]=(C[B[(l+2)%4]>>8&255]^K>>8)&255,J[4*l+3]=(C[B[(l+3)%4]&255]^K)&255;return J},ne.prototype.decrypt=function(p){if(p.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var f=this._Kd.length-1,A=[0,0,0,0],B=se(p),l=0;l<4;l++)B[l]^=this._Kd[0][l];for(var N=1;N<f;N++){for(var l=0;l<4;l++)A[l]=D[B[l]>>24&255]^U[B[(l+3)%4]>>16&255]^q[B[(l+2)%4]>>8&255]^z[B[(l+1)%4]&255]^this._Kd[N][l];B=A.slice()}for(var J=s(16),K,l=0;l<4;l++)K=this._Kd[f][l],J[4*l]=(G[B[l]>>24&255]^K>>24)&255,J[4*l+1]=(G[B[(l+3)%4]>>16&255]^K>>16)&255,J[4*l+2]=(G[B[(l+2)%4]>>8&255]^K>>8)&255,J[4*l+3]=(G[B[(l+1)%4]&255]^K)&255;return J};var P=function(p){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new ne(p)};P.prototype.encrypt=function(p){if(p=o(p),p.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var f=s(p.length),A=s(16),B=0;B<p.length;B+=16)c(p,A,0,B,B+16),A=this._aes.encrypt(A),c(A,f,B);return f},P.prototype.decrypt=function(p){if(p=o(p),p.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var f=s(p.length),A=s(16),B=0;B<p.length;B+=16)c(p,A,0,B,B+16),A=this._aes.decrypt(A),c(A,f,B);return f};var m=function(p,f){if(!(this instanceof m))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!f)f=s(16);else if(f.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=o(f,!0),this._aes=new ne(p)};m.prototype.encrypt=function(p){if(p=o(p),p.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var f=s(p.length),A=s(16),B=0;B<p.length;B+=16){c(p,A,0,B,B+16);for(var l=0;l<16;l++)A[l]^=this._lastCipherblock[l];this._lastCipherblock=this._aes.encrypt(A),c(this._lastCipherblock,f,B)}return f},m.prototype.decrypt=function(p){if(p=o(p),p.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var f=s(p.length),A=s(16),B=0;B<p.length;B+=16){c(p,A,0,B,B+16),A=this._aes.decrypt(A);for(var l=0;l<16;l++)f[B+l]=A[l]^this._lastCipherblock[l];c(p,this._lastCipherblock,0,B,B+16)}return f};var a=function(p,f,A){if(!(this instanceof a))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!f)f=s(16);else if(f.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");A||(A=1),this.segmentSize=A,this._shiftRegister=o(f,!0),this._aes=new ne(p)};a.prototype.encrypt=function(p){if(p.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var f=o(p,!0),A,B=0;B<f.length;B+=this.segmentSize){A=this._aes.encrypt(this._shiftRegister);for(var l=0;l<this.segmentSize;l++)f[B+l]^=A[l];c(this._shiftRegister,this._shiftRegister,0,this.segmentSize),c(f,this._shiftRegister,16-this.segmentSize,B,B+this.segmentSize)}return f},a.prototype.decrypt=function(p){if(p.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var f=o(p,!0),A,B=0;B<f.length;B+=this.segmentSize){A=this._aes.encrypt(this._shiftRegister);for(var l=0;l<this.segmentSize;l++)f[B+l]^=A[l];c(this._shiftRegister,this._shiftRegister,0,this.segmentSize),c(p,this._shiftRegister,16-this.segmentSize,B,B+this.segmentSize)}return f};var d=function(p,f){if(!(this instanceof d))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!f)f=s(16);else if(f.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=o(f,!0),this._lastPrecipherIndex=16,this._aes=new ne(p)};d.prototype.encrypt=function(p){for(var f=o(p,!0),A=0;A<f.length;A++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),f[A]^=this._lastPrecipher[this._lastPrecipherIndex++];return f},d.prototype.decrypt=d.prototype.encrypt;var b=function(p){if(!(this instanceof b))throw Error("Counter must be instanitated with `new`");p!==0&&!p&&(p=1),typeof p=="number"?(this._counter=s(16),this.setValue(p)):this.setBytes(p)};b.prototype.setValue=function(p){if(typeof p!="number"||parseInt(p)!=p)throw new Error("invalid counter value (must be an integer)");for(var f=15;f>=0;--f)this._counter[f]=p%256,p=p>>8},b.prototype.setBytes=function(p){if(p=o(p,!0),p.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=p},b.prototype.increment=function(){for(var p=15;p>=0;p--)if(this._counter[p]===255)this._counter[p]=0;else{this._counter[p]++;break}};var y=function(p,f){if(!(this instanceof y))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",f instanceof b||(f=new b(f)),this._counter=f,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new ne(p)};y.prototype.encrypt=function(p){for(var f=o(p,!0),A=0;A<f.length;A++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),f[A]^=this._remainingCounter[this._remainingCounterIndex++];return f},y.prototype.decrypt=y.prototype.encrypt;function E(p){p=o(p,!0);var f=16-p.length%16,A=s(p.length+f);c(p,A);for(var B=p.length;B<A.length;B++)A[B]=f;return A}function I(p){if(p=o(p,!0),p.length<16)throw new Error("PKCS#7 invalid length");var f=p[p.length-1];if(f>16)throw new Error("PKCS#7 padding byte out of range");for(var A=p.length-f,B=0;B<f;B++)if(p[A+B]!==f)throw new Error("PKCS#7 invalid padding byte");var l=s(A);return c(p,l,0,0,A),l}var R={AES:ne,Counter:b,ModeOfOperation:{ecb:P,cbc:m,cfb:a,ofb:d,ctr:y},utils:{hex:g,utf8:x},padding:{pkcs7:{pad:E,strip:I}},_arrayTest:{coerceArray:o,createArray:s,copyArray:c}};n.exports=R})()})(ji)),ji.exports}var iu=nu();const ir=sn(iu),fa="json-wallets/5.8.0";function Fr(n){return typeof n=="string"&&n.substring(0,2)!=="0x"&&(n="0x"+n),Z(n)}function un(n,e){for(n=String(n);n.length<e;)n="0"+n;return n}function Co(n){return typeof n=="string"?ut(n,xr.NFKC):Z(n)}function ot(n,e){let t=n;const r=e.toLowerCase().split("/");for(let i=0;i<r.length;i++){let o=null;for(const s in t)if(s.toLowerCase()===r[i]){o=t[s];break}if(o===null)return null;t=o}return t}function ou(n){const e=Z(n);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=re(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}const su=new O(fa);class au extends Gr{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}}function ca(n,e){const t=JSON.parse(n);e=Co(e);const r=et(ot(t,"ethaddr")),i=Fr(ot(t,"encseed"));(!i||i.length%16!==0)&&su.throwArgumentError("invalid encseed","json",n);const o=Z(Mo(e,e,2e3,32,"sha256")).slice(0,16),s=i.slice(0,16),c=i.slice(16),x=new ir.ModeOfOperation.cbc(o,s),g=ir.padding.pkcs7.strip(Z(x.decrypt(c)));let w="";for(let G=0;G<g.length;G++)w+=String.fromCharCode(g[G]);const M=ut(w),C=je(M);return new au({_isCrowdsaleAccount:!0,address:r,privateKey:C})}function ua(n){let e=null;try{e=JSON.parse(n)}catch{return!1}return e.encseed&&e.ethaddr}function ha(n){let e=null;try{e=JSON.parse(n)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}var Qi={exports:{}},C0;function fu(){return C0||(C0=1,(function(n,e){(function(t){function i(k){const S=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);let T=1779033703,D=3144134277,U=1013904242,q=2773480762,z=1359893119,j=2600822924,Y=528734635,X=1541459225;const ie=new Uint32Array(64);function se(y){let E=0,I=y.length;for(;I>=64;){let R=T,p=D,f=U,A=q,B=z,l=j,N=Y,J=X,K,W,oe,$,te;for(W=0;W<16;W++)oe=E+W*4,ie[W]=(y[oe]&255)<<24|(y[oe+1]&255)<<16|(y[oe+2]&255)<<8|y[oe+3]&255;for(W=16;W<64;W++)K=ie[W-2],$=(K>>>17|K<<15)^(K>>>19|K<<13)^K>>>10,K=ie[W-15],te=(K>>>7|K<<25)^(K>>>18|K<<14)^K>>>3,ie[W]=($+ie[W-7]|0)+(te+ie[W-16]|0)|0;for(W=0;W<64;W++)$=(((B>>>6|B<<26)^(B>>>11|B<<21)^(B>>>25|B<<7))+(B&l^~B&N)|0)+(J+(S[W]+ie[W]|0)|0)|0,te=((R>>>2|R<<30)^(R>>>13|R<<19)^(R>>>22|R<<10))+(R&p^R&f^p&f)|0,J=N,N=l,l=B,B=A+$|0,A=f,f=p,p=R,R=$+te|0;T=T+R|0,D=D+p|0,U=U+f|0,q=q+A|0,z=z+B|0,j=j+l|0,Y=Y+N|0,X=X+J|0,E+=64,I-=64}}se(k);let ne,P=k.length%64,m=k.length/536870912|0,a=k.length<<3,d=P<56?56:120,b=k.slice(k.length-P,k.length);for(b.push(128),ne=P+1;ne<d;ne++)b.push(0);return b.push(m>>>24&255),b.push(m>>>16&255),b.push(m>>>8&255),b.push(m>>>0&255),b.push(a>>>24&255),b.push(a>>>16&255),b.push(a>>>8&255),b.push(a>>>0&255),se(b),[T>>>24&255,T>>>16&255,T>>>8&255,T>>>0&255,D>>>24&255,D>>>16&255,D>>>8&255,D>>>0&255,U>>>24&255,U>>>16&255,U>>>8&255,U>>>0&255,q>>>24&255,q>>>16&255,q>>>8&255,q>>>0&255,z>>>24&255,z>>>16&255,z>>>8&255,z>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y>>>0&255,X>>>24&255,X>>>16&255,X>>>8&255,X>>>0&255]}function o(k,S,T){k=k.length<=64?k:i(k);const D=64+S.length+4,U=new Array(D),q=new Array(64);let z,j=[];for(z=0;z<64;z++)U[z]=54;for(z=0;z<k.length;z++)U[z]^=k[z];for(z=0;z<S.length;z++)U[64+z]=S[z];for(z=D-4;z<D;z++)U[z]=0;for(z=0;z<64;z++)q[z]=92;for(z=0;z<k.length;z++)q[z]^=k[z];function Y(){for(let X=D-1;X>=D-4;X--){if(U[X]++,U[X]<=255)return;U[X]=0}}for(;T>=32;)Y(),j=j.concat(i(q.concat(i(U)))),T-=32;return T>0&&(Y(),j=j.concat(i(q.concat(i(U))).slice(0,T))),j}function s(k,S,T,D,U){let q;for(w(k,(2*T-1)*16,U,0,16),q=0;q<2*T;q++)g(k,q*16,U,16),x(U,D),w(U,0,k,S+q*16,16);for(q=0;q<T;q++)w(k,S+q*2*16,k,q*16,16);for(q=0;q<T;q++)w(k,S+(q*2+1)*16,k,(q+T)*16,16)}function c(k,S){return k<<S|k>>>32-S}function x(k,S){w(k,0,S,0,16);for(let T=8;T>0;T-=2)S[4]^=c(S[0]+S[12],7),S[8]^=c(S[4]+S[0],9),S[12]^=c(S[8]+S[4],13),S[0]^=c(S[12]+S[8],18),S[9]^=c(S[5]+S[1],7),S[13]^=c(S[9]+S[5],9),S[1]^=c(S[13]+S[9],13),S[5]^=c(S[1]+S[13],18),S[14]^=c(S[10]+S[6],7),S[2]^=c(S[14]+S[10],9),S[6]^=c(S[2]+S[14],13),S[10]^=c(S[6]+S[2],18),S[3]^=c(S[15]+S[11],7),S[7]^=c(S[3]+S[15],9),S[11]^=c(S[7]+S[3],13),S[15]^=c(S[11]+S[7],18),S[1]^=c(S[0]+S[3],7),S[2]^=c(S[1]+S[0],9),S[3]^=c(S[2]+S[1],13),S[0]^=c(S[3]+S[2],18),S[6]^=c(S[5]+S[4],7),S[7]^=c(S[6]+S[5],9),S[4]^=c(S[7]+S[6],13),S[5]^=c(S[4]+S[7],18),S[11]^=c(S[10]+S[9],7),S[8]^=c(S[11]+S[10],9),S[9]^=c(S[8]+S[11],13),S[10]^=c(S[9]+S[8],18),S[12]^=c(S[15]+S[14],7),S[13]^=c(S[12]+S[15],9),S[14]^=c(S[13]+S[12],13),S[15]^=c(S[14]+S[13],18);for(let T=0;T<16;++T)k[T]+=S[T]}function g(k,S,T,D){for(let U=0;U<D;U++)T[U]^=k[S+U]}function w(k,S,T,D,U){for(;U--;)T[D++]=k[S++]}function M(k){if(!k||typeof k.length!="number")return!1;for(let S=0;S<k.length;S++){const T=k[S];if(typeof T!="number"||T%1||T<0||T>=256)return!1}return!0}function C(k,S){if(typeof k!="number"||k%1)throw new Error("invalid "+S);return k}function G(k,S,T,D,U,q,z){if(T=C(T,"N"),D=C(D,"r"),U=C(U,"p"),q=C(q,"dkLen"),T===0||(T&T-1)!==0)throw new Error("N must be power of 2");if(T>2147483647/128/D)throw new Error("N too large");if(D>2147483647/128/U)throw new Error("r too large");if(!M(k))throw new Error("password must be an array or buffer");if(k=Array.prototype.slice.call(k),!M(S))throw new Error("salt must be an array or buffer");S=Array.prototype.slice.call(S);let j=o(k,S,U*128*D);const Y=new Uint32Array(U*32*D);for(let B=0;B<Y.length;B++){const l=B*4;Y[B]=(j[l+3]&255)<<24|(j[l+2]&255)<<16|(j[l+1]&255)<<8|(j[l+0]&255)<<0}const X=new Uint32Array(64*D),ie=new Uint32Array(32*D*T),se=32*D,ne=new Uint32Array(16),P=new Uint32Array(16),m=U*T*2;let a=0,d=null,b=!1,y=0,E=0,I,R;const p=z?parseInt(1e3/D):4294967295,f=typeof setImmediate<"u"?setImmediate:setTimeout,A=function(){if(b)return z(new Error("cancelled"),a/m);let B;switch(y){case 0:R=E*32*D,w(Y,R,X,0,se),y=1,I=0;case 1:B=T-I,B>p&&(B=p);for(let N=0;N<B;N++)w(X,0,ie,(I+N)*se,se),s(X,se,D,ne,P);if(I+=B,a+=B,z){const N=parseInt(1e3*a/m);if(N!==d){if(b=z(null,a/m),b)break;d=N}}if(I<T)break;I=0,y=2;case 2:B=T-I,B>p&&(B=p);for(let N=0;N<B;N++){const J=(2*D-1)*16,K=X[J]&T-1;g(ie,K*se,X,se),s(X,se,D,ne,P)}if(I+=B,a+=B,z){const N=parseInt(1e3*a/m);if(N!==d){if(b=z(null,a/m),b)break;d=N}}if(I<T)break;if(w(X,0,Y,R,se),E++,E<U){y=0;break}j=[];for(let N=0;N<Y.length;N++)j.push(Y[N]>>0&255),j.push(Y[N]>>8&255),j.push(Y[N]>>16&255),j.push(Y[N]>>24&255);const l=o(k,j,q);return z&&z(null,1,l),l}z&&f(A)};if(!z)for(;;){const B=A();if(B!=null)return B}A()}const H={scrypt:function(k,S,T,D,U,q,z){return new Promise(function(j,Y){let X=0;z&&z(0),G(k,S,T,D,U,q,function(ie,se,ne){if(ie)Y(ie);else if(ne)z&&X!==1&&z(1),j(new Uint8Array(ne));else if(z&&se!==X)return X=se,z(se)})})},syncScrypt:function(k,S,T,D,U,q){return new Uint8Array(G(k,S,T,D,U,q))}};n.exports=H})()})(Qi)),Qi.exports}var cu=fu();const No=sn(cu);var uu=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const ho=new O(fa);function N0(n){return n!=null&&n.mnemonic&&n.mnemonic.phrase}class hu extends Gr{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}}function lu(n,e,t){if(ot(n,"crypto/cipher")==="aes-128-ctr"){const i=Fr(ot(n,"crypto/cipherparams/iv")),o=new ir.Counter(i),s=new ir.ModeOfOperation.ctr(e,o);return Z(s.decrypt(t))}return null}function la(n,e){const t=Fr(ot(n,"crypto/ciphertext"));if(re(je(rt([e.slice(16,32),t]))).substring(2)!==ot(n,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=lu(n,e.slice(0,16),t);i||ho.throwError("unsupported cipher",O.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const o=e.slice(32,64),s=Sr(i);if(n.address){let x=n.address.toLowerCase();if(x.substring(0,2)!=="0x"&&(x="0x"+x),et(x)!==s)throw new Error("address mismatch")}const c={_isKeystoreAccount:!0,address:s,privateKey:re(i)};if(ot(n,"x-ethers/version")==="0.1"){const x=Fr(ot(n,"x-ethers/mnemonicCiphertext")),g=Fr(ot(n,"x-ethers/mnemonicCounter")),w=new ir.Counter(g),M=new ir.ModeOfOperation.ctr(o,w),C=ot(n,"x-ethers/path")||on,G=ot(n,"x-ethers/locale")||"en",H=Z(M.decrypt(x));try{const k=ci(H,G),S=kt.fromMnemonic(k,null,G).derivePath(C);if(S.privateKey!=c.privateKey)throw new Error("mnemonic mismatch");c.mnemonic=S.mnemonic}catch(k){if(k.code!==O.errors.INVALID_ARGUMENT||k.argument!=="wordlist")throw k}}return new hu(c)}function da(n,e,t,r,i){return Z(Mo(n,e,t,r,i))}function du(n,e,t,r,i){return Promise.resolve(da(n,e,t,r,i))}function xa(n,e,t,r,i){const o=Co(e),s=ot(n,"crypto/kdf");if(s&&typeof s=="string"){const c=function(x,g){return ho.throwArgumentError("invalid key-derivation function parameters",x,g)};if(s.toLowerCase()==="scrypt"){const x=Fr(ot(n,"crypto/kdfparams/salt")),g=parseInt(ot(n,"crypto/kdfparams/n")),w=parseInt(ot(n,"crypto/kdfparams/r")),M=parseInt(ot(n,"crypto/kdfparams/p"));(!g||!w||!M)&&c("kdf",s),(g&g-1)!==0&&c("N",g);const C=parseInt(ot(n,"crypto/kdfparams/dklen"));return C!==32&&c("dklen",C),r(o,x,g,w,M,64,i)}else if(s.toLowerCase()==="pbkdf2"){const x=Fr(ot(n,"crypto/kdfparams/salt"));let g=null;const w=ot(n,"crypto/kdfparams/prf");w==="hmac-sha256"?g="sha256":w==="hmac-sha512"?g="sha512":c("prf",w);const M=parseInt(ot(n,"crypto/kdfparams/c")),C=parseInt(ot(n,"crypto/kdfparams/dklen"));return C!==32&&c("dklen",C),t(o,x,M,C,g)}}return ho.throwArgumentError("unsupported key-derivation function","kdf",s)}function xu(n,e){const t=JSON.parse(n),r=xa(t,e,da,No.syncScrypt);return la(t,r)}function pu(n,e,t){return uu(this,void 0,void 0,function*(){const r=JSON.parse(n),i=yield xa(r,e,du,No.scrypt,t);return la(r,i)})}function bu(n,e,t,r){try{if(et(n.address)!==Sr(n.privateKey))throw new Error("address/privateKey mismatch");if(N0(n)){const S=n.mnemonic;if(kt.fromMnemonic(S.phrase,null,S.locale).derivePath(S.path||on).privateKey!=n.privateKey)throw new Error("mnemonic mismatch")}}catch(S){return Promise.reject(S)}typeof t=="function"&&!r&&(r=t,t={}),t||(t={});const i=Z(n.privateKey),o=Co(e);let s=null,c=null,x=null;if(N0(n)){const S=n.mnemonic;s=Z(ko(S.phrase,S.locale||"en")),c=S.path||on,x=S.locale||"en"}let g=t.client;g||(g="ethers.js");let w=null;t.salt?w=Z(t.salt):w=Yr(32);let M=null;if(t.iv){if(M=Z(t.iv),M.length!==16)throw new Error("invalid iv")}else M=Yr(16);let C=null;if(t.uuid){if(C=Z(t.uuid),C.length!==16)throw new Error("invalid uuid")}else C=Yr(16);let G=1<<17,H=8,k=1;return t.scrypt&&(t.scrypt.N&&(G=t.scrypt.N),t.scrypt.r&&(H=t.scrypt.r),t.scrypt.p&&(k=t.scrypt.p)),No.scrypt(o,w,G,H,k,64,r).then(S=>{S=Z(S);const T=S.slice(0,16),D=S.slice(16,32),U=S.slice(32,64),q=new ir.Counter(M),z=new ir.ModeOfOperation.ctr(T,q),j=Z(z.encrypt(i)),Y=je(rt([D,j])),X={address:n.address.substring(2).toLowerCase(),id:ou(C),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:re(M).substring(2)},ciphertext:re(j).substring(2),kdf:"scrypt",kdfparams:{salt:re(w).substring(2),n:G,dklen:32,p:k,r:H},mac:Y.substring(2)}};if(s){const ie=Yr(16),se=new ir.Counter(ie),ne=new ir.ModeOfOperation.ctr(U,se),P=Z(ne.encrypt(s)),m=new Date,a=m.getUTCFullYear()+"-"+un(m.getUTCMonth()+1,2)+"-"+un(m.getUTCDate(),2)+"T"+un(m.getUTCHours(),2)+"-"+un(m.getUTCMinutes(),2)+"-"+un(m.getUTCSeconds(),2)+".0Z";X["x-ethers"]={client:g,gethFilename:"UTC--"+a+"--"+X.address,mnemonicCounter:re(ie).substring(2),mnemonicCiphertext:re(P).substring(2),path:c,locale:x,version:"0.1"}}return JSON.stringify(X)})}function gu(n,e,t){if(ua(n)){t&&t(0);const r=ca(n,e);return t&&t(1),Promise.resolve(r)}return ha(n)?pu(n,e,t):Promise.reject(new Error("invalid JSON wallet"))}function mu(n,e){if(ua(n))return ca(n,e);if(ha(n))return xu(n,e);throw new Error("invalid JSON wallet")}const yu="wallet/5.8.0";var R0=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const Kr=new O(yu);function vu(n){return n!=null&&ve(n.privateKey,32)&&n.address!=null}function wu(n){const e=n.mnemonic;return e&&e.phrase}class Wr extends Kc{constructor(e,t){if(super(),vu(e)){const r=new Tr(e.privateKey);if(Q(this,"_signingKey",()=>r),Q(this,"address",Sr(this.publicKey)),this.address!==et(e.address)&&Kr.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),wu(e)){const i=e.mnemonic;Q(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||on,locale:i.locale||"en"}));const o=this.mnemonic,s=kt.fromMnemonic(o.phrase,null,o.locale).derivePath(o.path);Sr(s.privateKey)!==this.address&&Kr.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else Q(this,"_mnemonic",()=>null)}else{if(Tr.isSigningKey(e))e.curve!=="secp256k1"&&Kr.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),Q(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);const r=new Tr(e);Q(this,"_signingKey",()=>r)}Q(this,"_mnemonic",()=>null),Q(this,"address",Sr(this.publicKey))}t&&!In.isProvider(t)&&Kr.throwArgumentError("invalid provider","provider",t),Q(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new Wr(this,e)}signTransaction(e){return Te(e).then(t=>{t.from!=null&&(et(t.from)!==this.address&&Kr.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(je(co(t)));return co(t,r)})}signMessage(e){return R0(this,void 0,void 0,function*(){return no(this._signingKey().signDigest(Fs(e)))})}_signTypedData(e,t,r){return R0(this,void 0,void 0,function*(){const i=yield gt.resolveNames(e,t,r,o=>(this.provider==null&&Kr.throwError("cannot resolve ENS names without a provider",O.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:o}),this.provider.resolveName(o)));return no(this._signingKey().signDigest(gt.hash(i.domain,t,i.value)))})}encrypt(e,t,r){if(typeof t=="function"&&!r&&(r=t,t={}),r&&typeof r!="function")throw new Error("invalid callback");return t||(t={}),bu(this,e,t,r)}static createRandom(e){let t=Yr(16);e||(e={}),e.extraEntropy&&(t=Z(ft(je(rt([t,e.extraEntropy])),0,16)));const r=ci(t,e.locale);return Wr.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return gu(e,t,r).then(i=>new Wr(i))}static fromEncryptedJsonSync(e,t){return new Wr(mu(e,t))}static fromMnemonic(e,t,r){return t||(t=on),new Wr(kt.fromMnemonic(e,null,r).derivePath(t))}}const Au="networks/5.8.0",B0=new O(Au);function Eu(n){return n&&typeof n.renetwork=="function"}function Kt(n){const e=function(t,r){r==null&&(r={});const i=[];if(t.InfuraProvider&&r.infura!=="-")try{i.push(new t.InfuraProvider(n,r.infura))}catch{}if(t.EtherscanProvider&&r.etherscan!=="-")try{i.push(new t.EtherscanProvider(n,r.etherscan))}catch{}if(t.AlchemyProvider&&r.alchemy!=="-")try{i.push(new t.AlchemyProvider(n,r.alchemy))}catch{}if(t.PocketProvider&&r.pocket!=="-"){const o=["goerli","ropsten","rinkeby","sepolia"];try{const s=new t.PocketProvider(n,r.pocket);s.network&&o.indexOf(s.network.name)===-1&&i.push(s)}catch{}}if(t.CloudflareProvider&&r.cloudflare!=="-")try{i.push(new t.CloudflareProvider(n))}catch{}if(t.AnkrProvider&&r.ankr!=="-")try{const o=["ropsten"],s=new t.AnkrProvider(n,r.ankr);s.network&&o.indexOf(s.network.name)===-1&&i.push(s)}catch{}if(t.QuickNodeProvider&&r.quicknode!=="-")try{i.push(new t.QuickNodeProvider(n,r.quicknode))}catch{}if(i.length===0)return null;if(t.FallbackProvider){let o=1;return r.quorum!=null?o=r.quorum:n==="homestead"&&(o=2),new t.FallbackProvider(i,o)}return i[0]};return e.renetwork=function(t){return Kt(t)},e}function ni(n,e){const t=function(r,i){return r.JsonRpcProvider?new r.JsonRpcProvider(n,e):null};return t.renetwork=function(r){return ni(n,r)},t}const T0={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Kt("homestead")},F0={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Kt("ropsten")},O0={chainId:63,name:"classicMordor",_defaultProvider:ni("https://www.ethercluster.com/mordor","classicMordor")},Dn={unspecified:{chainId:0,name:"unspecified"},homestead:T0,mainnet:T0,morden:{chainId:2,name:"morden"},ropsten:F0,testnet:F0,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Kt("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Kt("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Kt("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"sepolia",_defaultProvider:Kt("sepolia")},holesky:{chainId:17e3,name:"holesky",_defaultProvider:Kt("holesky")},classic:{chainId:61,name:"classic",_defaultProvider:ni("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:O0,classicTestnet:O0,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ni("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Kt("matic")},maticmum:{chainId:80001,name:"maticmum",_defaultProvider:Kt("maticmum")},optimism:{chainId:10,name:"optimism",_defaultProvider:Kt("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},"optimism-sepolia":{chainId:11155420,name:"optimism-sepolia"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},"arbitrum-sepolia":{chainId:421614,name:"arbitrum-sepolia"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function _u(n){if(n==null)return null;if(typeof n=="number"){for(const r in Dn){const i=Dn[r];if(i.chainId===n)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:n,name:"unknown"}}if(typeof n=="string"){const r=Dn[n];return r==null?null:{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress,_defaultProvider:r._defaultProvider||null}}const e=Dn[n.name];if(!e)return typeof n.chainId!="number"&&B0.throwArgumentError("invalid network chainId","network",n),n;n.chainId!==0&&n.chainId!==e.chainId&&B0.throwArgumentError("network chainId mismatch","network",n);let t=n._defaultProvider||null;return t==null&&e._defaultProvider&&(Eu(e._defaultProvider)?t=e._defaultProvider.renetwork(n):t=e._defaultProvider),{name:n.name,chainId:e.chainId,ensAddress:n.ensAddress||e.ensAddress||null,_defaultProvider:t}}const Su="web/5.8.0";var Pu=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};function Mu(n,e){return Pu(this,void 0,void 0,function*(){e==null&&(e={});const t={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(t.mode="cors",t.cache="no-cache",t.credentials="same-origin",t.redirect="follow",t.referrer="client"),e.fetchOptions!=null){const s=e.fetchOptions;s.mode&&(t.mode=s.mode),s.cache&&(t.cache=s.cache),s.credentials&&(t.credentials=s.credentials),s.redirect&&(t.redirect=s.redirect),s.referrer&&(t.referrer=s.referrer)}const r=yield fetch(n,t),i=yield r.arrayBuffer(),o={};return r.headers.forEach?r.headers.forEach((s,c)=>{o[c.toLowerCase()]=s}):r.headers.keys().forEach(s=>{o[s.toLowerCase()]=r.headers.get(s)}),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:Z(new Uint8Array(i))}})}var Iu=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const zt=new O(Su);function D0(n){return new Promise(e=>{setTimeout(e,n)})}function Ar(n,e){if(n==null)return null;if(typeof n=="string")return n;if(Pn(n)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return an(n)}catch{}return re(n)}return n}function ku(n){return ut(n.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function pa(n,e,t){const r=typeof n=="object"&&n.throttleLimit!=null?n.throttleLimit:12;zt.assertArgument(r>0&&r%1===0,"invalid connection throttle limit","connection.throttleLimit",r);const i=typeof n=="object"?n.throttleCallback:null,o=typeof n=="object"&&typeof n.throttleSlotInterval=="number"?n.throttleSlotInterval:100;zt.assertArgument(o>0&&o%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s=typeof n=="object"?!!n.errorPassThrough:!1,c={};let x=null;const g={method:"GET"};let w=!1,M=120*1e3;if(typeof n=="string")x=n;else if(typeof n=="object"){if((n==null||n.url==null)&&zt.throwArgumentError("missing URL","connection.url",n),x=n.url,typeof n.timeout=="number"&&n.timeout>0&&(M=n.timeout),n.headers)for(const T in n.headers)c[T.toLowerCase()]={key:T,value:String(n.headers[T])},["if-none-match","if-modified-since"].indexOf(T.toLowerCase())>=0&&(w=!0);if(g.allowGzip=!!n.allowGzip,n.user!=null&&n.password!=null){x.substring(0,6)!=="https:"&&n.allowInsecureAuthentication!==!0&&zt.throwError("basic authentication requires a secure https url",O.errors.INVALID_ARGUMENT,{argument:"url",url:x,user:n.user,password:"[REDACTED]"});const T=n.user+":"+n.password;c.authorization={key:"Authorization",value:"Basic "+Ms(ut(T))}}n.skipFetchSetup!=null&&(g.skipFetchSetup=!!n.skipFetchSetup),n.fetchOptions!=null&&(g.fetchOptions=nt(n.fetchOptions))}const C=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),G=x?x.match(C):null;if(G)try{const T={statusCode:200,statusMessage:"OK",headers:{"content-type":G[1]||"text/plain"},body:G[2]?Ps(G[3]):ku(G[3])};let D=T.body;return t&&(D=t(T.body,T)),Promise.resolve(D)}catch(T){zt.throwError("processing response error",O.errors.SERVER_ERROR,{body:Ar(G[1],G[2]),error:T,requestBody:null,requestMethod:"GET",url:x})}e&&(g.method="POST",g.body=e,c["content-type"]==null&&(c["content-type"]={key:"Content-Type",value:"application/octet-stream"}),c["content-length"]==null&&(c["content-length"]={key:"Content-Length",value:String(e.length)}));const H={};Object.keys(c).forEach(T=>{const D=c[T];H[D.key]=D.value}),g.headers=H;const k=(function(){let T=null;return{promise:new Promise(function(q,z){M&&(T=setTimeout(()=>{T!=null&&(T=null,z(zt.makeError("timeout",O.errors.TIMEOUT,{requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,timeout:M,url:x})))},M))}),cancel:function(){T!=null&&(clearTimeout(T),T=null)}}})(),S=(function(){return Iu(this,void 0,void 0,function*(){for(let T=0;T<r;T++){let D=null;try{if(D=yield Mu(x,g),T<r){if(D.statusCode===301||D.statusCode===302){const q=D.headers.location||"";if(g.method==="GET"&&q.match(/^https:/)){x=D.headers.location;continue}}else if(D.statusCode===429){let q=!0;if(i&&(q=yield i(T,x)),q){let z=0;const j=D.headers["retry-after"];typeof j=="string"&&j.match(/^[1-9][0-9]*$/)?z=parseInt(j)*1e3:z=o*parseInt(String(Math.random()*Math.pow(2,T))),yield D0(z);continue}}}}catch(q){D=q.response,D==null&&(k.cancel(),zt.throwError("missing response",O.errors.SERVER_ERROR,{requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,serverError:q,url:x}))}let U=D.body;if(w&&D.statusCode===304?U=null:!s&&(D.statusCode<200||D.statusCode>=300)&&(k.cancel(),zt.throwError("bad response",O.errors.SERVER_ERROR,{status:D.statusCode,headers:D.headers,body:Ar(U,D.headers?D.headers["content-type"]:null),requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,url:x})),t)try{const q=yield t(U,D);return k.cancel(),q}catch(q){if(q.throttleRetry&&T<r){let z=!0;if(i&&(z=yield i(T,x)),z){const j=o*parseInt(String(Math.random()*Math.pow(2,T)));yield D0(j);continue}}k.cancel(),zt.throwError("processing response error",O.errors.SERVER_ERROR,{body:Ar(U,D.headers?D.headers["content-type"]:null),error:q,requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,url:x})}return k.cancel(),U}return zt.throwError("failed response",O.errors.SERVER_ERROR,{requestBody:Ar(g.body,H["content-type"]),requestMethod:g.method,url:x})})})();return Promise.race([k.promise,S])}function ui(n,e,t){let r=(o,s)=>{let c=null;if(o!=null)try{c=JSON.parse(an(o))}catch(x){zt.throwError("invalid JSON",O.errors.SERVER_ERROR,{body:o,error:x})}return t&&(c=t(c,s)),c},i=null;if(e!=null){i=ut(e);const o=typeof n=="string"?{url:n}:nt(n);o.headers?Object.keys(o.headers).filter(c=>c.toLowerCase()==="content-type").length!==0||(o.headers=nt(o.headers),o.headers["content-type"]="application/json"):o.headers={"content-type":"application/json"},n=o}return pa(n,i,r)}function Xr(n,e){return e||(e={}),e=nt(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(t,r){let i=null,o=!1;const s=()=>o?!1:(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{s()&&r(new Error("timeout"))},e.timeout));const c=e.retryLimit;let x=0;function g(){return n().then(function(w){if(w!==void 0)s()&&t(w);else if(e.oncePoll)e.oncePoll.once("poll",g);else if(e.onceBlock)e.onceBlock.once("block",g);else if(!o){if(x++,x>c){s()&&r(new Error("retry limit reached"));return}let M=e.interval*parseInt(String(Math.random()*Math.pow(2,x)));M<e.floor&&(M=e.floor),M>e.ceiling&&(M=e.ceiling),setTimeout(g,M)}return null},function(w){s()&&r(w)})}g()})}var Yi,U0;function Cu(){if(U0)return Yi;U0=1;for(var n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",e={},t=0;t<n.length;t++){var r=n.charAt(t);if(e[r]!==void 0)throw new TypeError(r+" is ambiguous");e[r]=t}function i(k){var S=k>>25;return(k&33554431)<<5^-(S>>0&1)&996825010^-(S>>1&1)&642813549^-(S>>2&1)&513874426^-(S>>3&1)&1027748829^-(S>>4&1)&705979059}function o(k){for(var S=1,T=0;T<k.length;++T){var D=k.charCodeAt(T);if(D<33||D>126)return"Invalid prefix ("+k+")";S=i(S)^D>>5}for(S=i(S),T=0;T<k.length;++T){var U=k.charCodeAt(T);S=i(S)^U&31}return S}function s(k,S,T){if(T=T||90,k.length+7+S.length>T)throw new TypeError("Exceeds length limit");k=k.toLowerCase();var D=o(k);if(typeof D=="string")throw new Error(D);for(var U=k+"1",q=0;q<S.length;++q){var z=S[q];if(z>>5!==0)throw new Error("Non 5-bit word");D=i(D)^z,U+=n.charAt(z)}for(q=0;q<6;++q)D=i(D);for(D^=1,q=0;q<6;++q){var j=D>>(5-q)*5&31;U+=n.charAt(j)}return U}function c(k,S){if(S=S||90,k.length<8)return k+" too short";if(k.length>S)return"Exceeds length limit";var T=k.toLowerCase(),D=k.toUpperCase();if(k!==T&&k!==D)return"Mixed-case string "+k;k=T;var U=k.lastIndexOf("1");if(U===-1)return"No separator character for "+k;if(U===0)return"Missing prefix for "+k;var q=k.slice(0,U),z=k.slice(U+1);if(z.length<6)return"Data too short";var j=o(q);if(typeof j=="string")return j;for(var Y=[],X=0;X<z.length;++X){var ie=z.charAt(X),se=e[ie];if(se===void 0)return"Unknown character "+ie;j=i(j)^se,!(X+6>=z.length)&&Y.push(se)}return j!==1?"Invalid checksum for "+k:{prefix:q,words:Y}}function x(){var k=c.apply(null,arguments);if(typeof k=="object")return k}function g(k){var S=c.apply(null,arguments);if(typeof S=="object")return S;throw new Error(S)}function w(k,S,T,D){for(var U=0,q=0,z=(1<<T)-1,j=[],Y=0;Y<k.length;++Y)for(U=U<<S|k[Y],q+=S;q>=T;)q-=T,j.push(U>>q&z);if(D)q>0&&j.push(U<<T-q&z);else{if(q>=S)return"Excess padding";if(U<<T-q&z)return"Non-zero padding"}return j}function M(k){var S=w(k,8,5,!0);if(Array.isArray(S))return S}function C(k){var S=w(k,8,5,!0);if(Array.isArray(S))return S;throw new Error(S)}function G(k){var S=w(k,5,8,!1);if(Array.isArray(S))return S}function H(k){var S=w(k,5,8,!1);if(Array.isArray(S))return S;throw new Error(S)}return Yi={decodeUnsafe:x,decode:g,encode:s,toWordsUnsafe:M,toWords:C,fromWordsUnsafe:G,fromWords:H},Yi}var Nu=Cu();const L0=sn(Nu),hi="providers/5.8.0",hn=new O(hi);class fe{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),i=this.blockTag.bind(this),o=this.data.bind(this),s=this.hash.bind(this),c=this.hex.bind(this),x=this.number.bind(this),g=this.type.bind(this),w=M=>this.data(M,!0);return e.transaction={hash:s,type:g,accessList:fe.allowNull(this.accessList.bind(this),null),blockHash:fe.allowNull(s,null),blockNumber:fe.allowNull(x,null),transactionIndex:fe.allowNull(x,null),confirmations:fe.allowNull(x,null),from:t,gasPrice:fe.allowNull(r),maxPriorityFeePerGas:fe.allowNull(r),maxFeePerGas:fe.allowNull(r),gasLimit:r,to:fe.allowNull(t,null),value:r,nonce:x,data:o,r:fe.allowNull(this.uint256),s:fe.allowNull(this.uint256),v:fe.allowNull(x),creates:fe.allowNull(t,null),raw:fe.allowNull(o)},e.transactionRequest={from:fe.allowNull(t),nonce:fe.allowNull(x),gasLimit:fe.allowNull(r),gasPrice:fe.allowNull(r),maxPriorityFeePerGas:fe.allowNull(r),maxFeePerGas:fe.allowNull(r),to:fe.allowNull(t),value:fe.allowNull(r),data:fe.allowNull(w),type:fe.allowNull(x),accessList:fe.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:x,blockNumber:x,transactionHash:s,address:t,topics:fe.arrayOf(s),data:o,logIndex:x,blockHash:s},e.receipt={to:fe.allowNull(this.address,null),from:fe.allowNull(this.address,null),contractAddress:fe.allowNull(t,null),transactionIndex:x,root:fe.allowNull(c),gasUsed:r,logsBloom:fe.allowNull(o),blockHash:s,transactionHash:s,logs:fe.arrayOf(this.receiptLog.bind(this)),blockNumber:x,confirmations:fe.allowNull(x,null),cumulativeGasUsed:r,effectiveGasPrice:fe.allowNull(r),status:fe.allowNull(x),type:g},e.block={hash:fe.allowNull(s),parentHash:s,number:x,timestamp:x,nonce:fe.allowNull(c),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:fe.allowNull(t),extraData:o,transactions:fe.allowNull(fe.arrayOf(s)),baseFeePerGas:fe.allowNull(r)},e.blockWithTransactions=nt(e.block),e.blockWithTransactions.transactions=fe.allowNull(fe.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:fe.allowNull(i,void 0),toBlock:fe.allowNull(i,void 0),blockHash:fe.allowNull(s,void 0),address:fe.allowNull(t,void 0),topics:fe.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:fe.allowNull(x),blockHash:fe.allowNull(s),transactionIndex:x,removed:fe.allowNull(this.boolean.bind(this)),address:t,data:fe.allowFalsish(o,"0x"),topics:fe.arrayOf(s),transactionHash:s,logIndex:x},e}accessList(e){return zr(e||[])}number(e){return e==="0x"?0:ee.from(e).toNumber()}type(e){return e==="0x"||e==null?0:ee.from(e).toNumber()}bigNumber(e){return ee.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return typeof e=="string"&&(!t&&e.substring(0,2)!=="0x"&&(e="0x"+e),ve(e))?e.toLowerCase():hn.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!==0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return et(e)}callAddress(e){if(!ve(e,32))return null;const t=et(ft(e,12));return t===ff?null:t}contractAddress(e){return yo(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||ve(e))return ii(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return Pr(r)!==32?hn.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(e==null)return null;const t=ee.from(e);try{return t.toNumber()}catch{}return null}uint256(e){if(!ve(e))throw new Error("invalid uint256");return We(e,32)}_block(e,t){e.author!=null&&e.miner==null&&(e.miner=e.author);const r=e._difficulty!=null?e._difficulty:e.difficulty,i=fe.check(t,e);return i._difficulty=r==null?null:ee.from(r),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return fe.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&ee.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const t=fe.check(this.formats.transaction,e);if(e.chainId!=null){let r=e.chainId;ve(r)&&(r=ee.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;r==null&&t.v==null&&(r=e.chainId),ve(r)&&(r=ee.from(r).toNumber()),typeof r!="number"&&t.v!=null&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),typeof r!="number"&&(r=0),t.chainId=r}return t.blockHash&&t.blockHash.replace(/0/g,"")==="x"&&(t.blockHash=null),t}transaction(e){return $s(e)}receiptLog(e){return fe.check(this.formats.receiptLog,e)}receipt(e){const t=fe.check(this.formats.receipt,e);if(t.root!=null)if(t.root.length<=4){const r=ee.from(t.root).toNumber();r===0||r===1?(t.status!=null&&t.status!==r&&hn.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=r,delete t.root):hn.throwArgumentError("invalid alt-root-status","value.root",t.root)}else t.root.length!==66&&hn.throwArgumentError("invalid root hash","value.root",t.root);return t.status!=null&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map(t=>this.topics(t)):e!=null?this.hash(e,!0):null}filter(e){return fe.check(this.formats.filter,e)}filterLog(e){return fe.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const i in e)try{const o=e[i](t[i]);o!==void 0&&(r[i]=o)}catch(o){throw o.checkKey=i,o.checkValue=t[i],o}return r}static allowNull(e,t){return(function(r){return r==null?t:e(r)})}static allowFalsish(e,t){return(function(r){return r?e(r):t})}static arrayOf(e){return(function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach(function(i){r.push(e(i))}),r})}}var pe=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const ge=new O(hi),Ru=10;function G0(n){return n==null?"null":(Pr(n)!==32&&ge.throwArgumentError("invalid topic","topic",n),n.toLowerCase())}function q0(n){for(n=n.slice();n.length>0&&n[n.length-1]==null;)n.pop();return n.map(e=>{if(Array.isArray(e)){const t={};e.forEach(i=>{t[G0(i)]=!0});const r=Object.keys(t);return r.sort(),r.join("|")}else return G0(e)}).join("&")}function Bu(n){return n===""?[]:n.split(/&/g).map(e=>{if(e==="")return[];const t=e.split("|").map(r=>r==="null"?null:r);return t.length===1?t[0]:t})}function Jr(n){if(typeof n=="string"){if(n=n.toLowerCase(),Pr(n)===32)return"tx:"+n;if(n.indexOf(":")===-1)return n}else{if(Array.isArray(n))return"filter:*:"+q0(n);if(nc.isForkEvent(n))throw ge.warn("not implemented"),new Error("not implemented");if(n&&typeof n=="object")return"filter:"+(n.address||"*")+":"+q0(n.topics||[])}throw new Error("invalid event - "+n)}function ln(){return new Date().getTime()}function z0(n){return new Promise(e=>{setTimeout(e,n)})}const Tu=["block","network","pending","poll"];class Fu{constructor(e,t,r){Q(this,"tag",e),Q(this,"listener",t),Q(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const t=e[1],r=Bu(e[2]),i={};return r.length>0&&(i.topics=r),t&&t!=="*"&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||Tu.indexOf(this.tag)>=0}}const Ou={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Xi(n){return We(ee.from(n).toHexString(),32)}function H0(n){return rn.encode(rt([n,ft(Ir(Ir(n)),0,4)]))}const ba=new RegExp("^(ipfs)://(.*)$","i"),K0=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ba,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Wn(n,e){try{return an(Sn(n,e))}catch{}return null}function Sn(n,e){if(n==="0x")return null;const t=ee.from(ft(n,e,e+32)).toNumber(),r=ee.from(ft(n,t,t+32)).toNumber();return ft(n,t+32,t+32+r)}function Zi(n){return n.match(/^ipfs:\/\/ipfs\//i)?n=n.substring(12):n.match(/^ipfs:\/\//i)?n=n.substring(7):ge.throwArgumentError("unsupported IPFS format","link",n),`https://gateway.ipfs.io/ipfs/${n}`}function J0(n){const e=Z(n);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function Du(n){if(n.length%32===0)return n;const e=new Uint8Array(Math.ceil(n.length/32)*32);return e.set(n),e}function ga(n){const e=[];let t=0;for(let r=0;r<n.length;r++)e.push(null),t+=32;for(let r=0;r<n.length;r++){const i=Z(n[r]);e[r]=J0(t),e.push(J0(i.length)),e.push(Du(i)),t+=32+Math.ceil(i.length/32)*32}return At(e)}class V0{constructor(e,t,r,i){Q(this,"provider",e),Q(this,"name",r),Q(this,"address",e.formatter.address(t)),Q(this,"_resolvedAddress",i)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>ee.from(e).eq(1)).catch(e=>{if(e.code===O.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,t){return pe(this,void 0,void 0,function*(){const r={to:this.address,ccipReadEnabled:!0,data:At([e,bn(this.name),t||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,r.data=At(["0x9061b923",ga([Ts(this.name),r.data])]));try{let o=yield this.provider.call(r);return Z(o).length%32===4&&ge.throwError("resolver threw error",O.errors.CALL_EXCEPTION,{transaction:r,data:o}),i&&(o=Sn(o,0)),o}catch(o){if(o.code===O.errors.CALL_EXCEPTION)return null;throw o}})}_fetchBytes(e,t){return pe(this,void 0,void 0,function*(){const r=yield this._fetch(e,t);return r!=null?Sn(r,0):null})}_getAddress(e,t){const r=Ou[String(e)];if(r==null&&ge.throwError(`unsupported coin type: ${e}`,O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),r.ilk==="eth")return this.provider.formatter.address(t);const i=Z(t);if(r.p2pkh!=null){const o=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){const s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return H0(rt([[r.p2pkh],"0x"+o[2]]))}}if(r.p2sh!=null){const o=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(o){const s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return H0(rt([[r.p2sh],"0x"+o[2]]))}}if(r.prefix!=null){const o=i[1];let s=i[0];if(s===0?o!==20&&o!==32&&(s=-1):s=-1,s>=0&&i.length===2+o&&o>=1&&o<=75){const c=L0.toWords(i.slice(2));return c.unshift(s),L0.encode(r.prefix,c)}}return null}getAddress(e){return pe(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===lf?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===O.errors.CALL_EXCEPTION)return null;throw i}const t=yield this._fetchBytes("0xf1cb7e06",Xi(e));if(t==null||t==="0x")return null;const r=this._getAddress(e,t);return r==null&&ge.throwError("invalid or unsupported coin data",O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r})}getAvatar(){return pe(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(t==null)return null;for(let r=0;r<K0.length;r++){const i=t.match(K0[r]);if(i==null)continue;const o=i[1].toLowerCase();switch(o){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:Zi(t)};case"erc721":case"erc1155":{const s=o==="erc721"?"0xc87b56dd":"0x0e89341c";e.push({type:o,content:t});const c=this._resolvedAddress||(yield this.getAddress()),x=(i[2]||"").split("/");if(x.length!==2)return null;const g=yield this.provider.formatter.address(x[0]),w=We(ee.from(x[1]).toHexString(),32);if(o==="erc721"){const k=this.provider.formatter.callAddress(yield this.provider.call({to:g,data:At(["0x6352211e",w])}));if(c!==k)return null;e.push({type:"owner",content:k})}else if(o==="erc1155"){const k=ee.from(yield this.provider.call({to:g,data:At(["0x00fdd58e",We(c,32),w])}));if(k.isZero())return null;e.push({type:"balance",content:k.toString()})}const M={to:this.provider.formatter.address(x[0]),data:At([s,w])};let C=Wn(yield this.provider.call(M),0);if(C==null)return null;e.push({type:"metadata-url-base",content:C}),o==="erc1155"&&(C=C.replace("{id}",w.substring(2)),e.push({type:"metadata-url-expanded",content:C})),C.match(/^ipfs:/i)&&(C=Zi(C)),e.push({type:"metadata-url",content:C});const G=yield ui(C);if(!G)return null;e.push({type:"metadata",content:JSON.stringify(G)});let H=G.image;if(typeof H!="string")return null;if(!H.match(/^(https:\/\/|data:)/i)){if(H.match(ba)==null)return null;e.push({type:"url-ipfs",content:H}),H=Zi(H)}return e.push({type:"url",content:H}),{linkage:e,url:H}}}}}catch{}return null})}getContentHash(){return pe(this,void 0,void 0,function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(e==null||e==="0x")return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const s=parseInt(t[3],16);if(t[4].length===s*2)return"ipfs://"+rn.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const s=parseInt(r[3],16);if(r[4].length===s*2)return"ipns://"+rn.encode("0x"+r[1])}const i=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(i&&i[1].length===64)return"bzz://"+i[1];const o=e.match(/^0x90b2c605([0-9a-f]*)$/);if(o&&o[1].length===68){const s={"=":"","+":"-","/":"_"};return"sia://"+Ms("0x"+o[1]).replace(/[=+\/]/g,x=>s[x])}return ge.throwError("invalid or unsupported content hash data",O.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return pe(this,void 0,void 0,function*(){let t=ut(e);t=rt([Xi(64),Xi(t.length),t]),t.length%32!==0&&(t=rt([t,We("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",re(t));return r==null||r==="0x"?null:an(r)})}}let $i=null,Uu=1;class Lu extends In{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Q(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(t=>{}),this._ready().catch(t=>{});else{const t=Wt(new.target,"getNetwork")(e);t?(Q(this,"_network",t),this.emit("network",t,null)):ge.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return pe(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||ge.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:Q(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Xr(()=>this._ready().then(e=>e,e=>{if(!(e.code===O.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return $i==null&&($i=new fe),$i}static getNetwork(e){return _u(e??"homestead")}ccipReadFetch(e,t,r){return pe(this,void 0,void 0,function*(){if(this.disableCcipRead||r.length===0)return null;const i=e.to.toLowerCase(),o=t.toLowerCase(),s=[];for(let c=0;c<r.length;c++){const x=r[c],g=x.replace("{sender}",i).replace("{data}",o),w=x.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:i}),M=yield ui({url:g,errorPassThrough:!0},w,(G,H)=>(G.status=H.statusCode,G));if(M.data)return M.data;const C=M.message||"unknown error";if(M.status>=400&&M.status<500)return ge.throwError(`response not found during CCIP fetch: ${C}`,O.errors.SERVER_ERROR,{url:x,errorMessage:C});s.push(C)}return ge.throwError(`error encountered during CCIP fetch: ${s.map(c=>JSON.stringify(c)).join(", ")}`,O.errors.SERVER_ERROR,{urls:r,errorMessages:s})})}_getInternalBlockNumber(e){return pe(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const o=yield i;if(ln()-o.respTime<=e)return o.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const t=ln(),r=Te({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:o})=>{if(o)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),o;const s=ln();return i=ee.from(i).toNumber(),i<this._maxInternalBlockNumber&&(i=this._maxInternalBlockNumber),this._maxInternalBlockNumber=i,this._setFastBlockNumber(i),{blockNumber:i,reqTime:t,respTime:s}});return this._internalBlockNumber=r,r.catch(i=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)}),(yield r).blockNumber})}poll(){return pe(this,void 0,void 0,function*(){const e=Uu++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)ge.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",ge.makeError("network block skew detected",O.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let i=this._emitted.block+1;i<=r;i++)this.emit("block",i);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const o=this._emitted[i];o!=="pending"&&r-o>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=r-1),this._events.forEach(i=>{switch(i.type){case"tx":{const o=i.hash;let s=this.getTransactionReceipt(o).then(c=>(!c||c.blockNumber==null||(this._emitted["t:"+o]=c.blockNumber,this.emit(o,c)),null)).catch(c=>{this.emit("error",c)});t.push(s);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=r-1);const o=i.filter;o.fromBlock=i._lastBlockNumber+1,o.toBlock=r;const s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);const c=this.getLogs(o).then(x=>{i._inflight=!1,x.length!==0&&x.forEach(g=>{g.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=g.blockNumber),this._emitted["b:"+g.blockHash]=g.blockNumber,this._emitted["t:"+g.transactionHash]=g.blockNumber,this.emit(o,g)})}).catch(x=>{this.emit("error",x),i._inflight=!1});t.push(c)}break}}}),this._lastBlockNumber=r,Promise.all(t).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return pe(this,void 0,void 0,function*(){return ge.throwError("provider does not support network detection",O.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return pe(this,void 0,void 0,function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield z0(0),this._network;const r=ge.makeError("underlying network changed",O.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=ln();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(t=>((this._fastBlockNumber==null||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&e<this._fastBlockNumber||(this._fastQueryDate=ln(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return pe(this,void 0,void 0,function*(){return this._waitForTransaction(e,t??1,r||0,null)})}_waitForTransaction(e,t,r,i){return pe(this,void 0,void 0,function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise((s,c)=>{const x=[];let g=!1;const w=function(){return g?!0:(g=!0,x.forEach(C=>{C()}),!1)},M=C=>{C.confirmations<t||w()||s(C)};if(this.on(e,M),x.push(()=>{this.removeListener(e,M)}),i){let C=i.startBlock,G=null;const H=k=>pe(this,void 0,void 0,function*(){g||(yield z0(1e3),this.getTransactionCount(i.from).then(S=>pe(this,void 0,void 0,function*(){if(!g){if(S<=i.nonce)C=k;else{{const T=yield this.getTransaction(e);if(T&&T.blockNumber!=null)return}for(G==null&&(G=C-3,G<i.startBlock&&(G=i.startBlock));G<=k;){if(g)return;const T=yield this.getBlockWithTransactions(G);for(let D=0;D<T.transactions.length;D++){const U=T.transactions[D];if(U.hash===e)return;if(U.from===i.from&&U.nonce===i.nonce){if(g)return;const q=yield this.waitForTransaction(U.hash,t);if(w())return;let z="replaced";U.data===i.data&&U.to===i.to&&U.value.eq(i.value)?z="repriced":U.data==="0x"&&U.from===U.to&&U.value.isZero()&&(z="cancelled"),c(ge.makeError("transaction was replaced",O.errors.TRANSACTION_REPLACED,{cancelled:z==="replaced"||z==="cancelled",reason:z,replacement:this._wrapTransaction(U),hash:e,receipt:q}));return}}G++}}g||this.once("block",H)}}),S=>{g||this.once("block",H)}))});if(g)return;this.once("block",H),x.push(()=>{this.removeListener("block",H)})}if(typeof r=="number"&&r>0){const C=setTimeout(()=>{w()||c(ge.makeError("timeout exceeded",O.errors.TIMEOUT,{timeout:r}))},r);C.unref&&C.unref(),x.push(()=>{clearTimeout(C)})}})})}getBlockNumber(){return pe(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return ee.from(e)}catch(t){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}})}getBalance(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Te({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),i=yield this.perform("getBalance",r);try{return ee.from(i)}catch(o){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getBalance",params:r,result:i,error:o})}})}getTransactionCount(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Te({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),i=yield this.perform("getTransactionCount",r);try{return ee.from(i).toNumber()}catch(o){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:i,error:o})}})}getCode(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Te({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),i=yield this.perform("getCode",r);try{return re(i)}catch(o){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getCode",params:r,result:i,error:o})}})}getStorageAt(e,t,r){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield Te({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then(s=>ii(s))}),o=yield this.perform("getStorageAt",i);try{return re(o)}catch(s){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:s})}})}_wrapTransaction(e,t,r){if(t!=null&&Pr(t)!==32)throw new Error("invalid response - sendTransaction");const i=e;return t!=null&&e.hash!==t&&ge.throwError("Transaction hash mismatch from Provider.sendTransaction.",O.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=(o,s)=>pe(this,void 0,void 0,function*(){o==null&&(o=1),s==null&&(s=0);let c;o!==0&&r!=null&&(c={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const x=yield this._waitForTransaction(e.hash,o,s,c);return x==null&&o===0?null:(this._emitted["t:"+e.hash]=x.blockNumber,x.status===0&&ge.throwError("transaction failed",O.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:x}),x)}),i}sendTransaction(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then(o=>re(o)),r=this.formatter.transaction(e);r.confirmations==null&&(r.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const o=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,o,i)}catch(o){throw o.transaction=r,o.transactionHash=r.hash,o}})}_getTransactionRequest(e){return pe(this,void 0,void 0,function*(){const t=yield e,r={};return["from","to"].forEach(i=>{t[i]!=null&&(r[i]=Promise.resolve(t[i]).then(o=>o?this._getAddress(o):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{t[i]!=null&&(r[i]=Promise.resolve(t[i]).then(o=>o?ee.from(o):null))}),["type"].forEach(i=>{t[i]!=null&&(r[i]=Promise.resolve(t[i]).then(o=>o??null))}),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach(i=>{t[i]!=null&&(r[i]=Promise.resolve(t[i]).then(o=>o?re(o):null))}),this.formatter.transactionRequest(yield Te(r))})}_getFilter(e){return pe(this,void 0,void 0,function*(){e=yield e;const t={};return e.address!=null&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach(r=>{e[r]!=null&&(t[r]=e[r])}),["fromBlock","toBlock"].forEach(r=>{e[r]!=null&&(t[r]=this._getBlockTag(e[r]))}),this.formatter.filter(yield Te(t))})}_call(e,t,r){return pe(this,void 0,void 0,function*(){r>=Ru&&ge.throwError("CCIP read exceeded maximum redirections",O.errors.SERVER_ERROR,{redirects:r,transaction:e});const i=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&t==="latest"&&i!=null&&o.substring(0,10)==="0x556f1830"&&Pr(o)%32===4)try{const s=ft(o,4),c=ft(s,0,32);ee.from(c).eq(i)||ge.throwError("CCIP Read sender did not match",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const x=[],g=ee.from(ft(s,32,64)).toNumber(),w=ee.from(ft(s,g,g+32)).toNumber(),M=ft(s,g+32);for(let T=0;T<w;T++){const D=Wn(M,T*32);D==null&&ge.throwError("CCIP Read contained corrupt URL string",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),x.push(D)}const C=Sn(s,64);ee.from(ft(s,100,128)).isZero()||ge.throwError("CCIP Read callback selector included junk",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const G=ft(s,96,100),H=Sn(s,128),k=yield this.ccipReadFetch(e,C,x);k==null&&ge.throwError("CCIP Read disabled or provided no URLs",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const S={to:i,data:At([G,ga([k,H])])};return this._call(S,t,r+1)}catch(s){if(s.code===O.errors.SERVER_ERROR)throw s}try{return re(o)}catch(s){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:s})}})}call(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Te({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)})}estimateGas(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield Te({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return ee.from(r)}catch(i){return ge.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:i})}})}_getAddress(e){return pe(this,void 0,void 0,function*(){e=yield e,typeof e!="string"&&ge.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return t==null&&ge.throwError("ENS name not configured",O.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t})}_getBlock(e,t){return pe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let r=-128;const i={includeTransactions:!!t};if(ve(e,32))i.blockHash=e;else try{i.blockTag=yield this._getBlockTag(e),ve(i.blockTag)&&(r=parseInt(i.blockTag.substring(2),16))}catch{ge.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return Xr(()=>pe(this,void 0,void 0,function*(){const o=yield this.perform("getBlock",i);if(o==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&r>this._emitted.block?null:void 0;if(t){let s=null;for(let x=0;x<o.transactions.length;x++){const g=o.transactions[x];if(g.blockNumber==null)g.confirmations=0;else if(g.confirmations==null){s==null&&(s=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let w=s-g.blockNumber+1;w<=0&&(w=1),g.confirmations=w}}const c=this.formatter.blockWithTransactions(o);return c.transactions=c.transactions.map(x=>this._wrapTransaction(x)),c}return this.formatter.block(o)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Xr(()=>pe(this,void 0,void 0,function*(){const r=yield this.perform("getTransaction",t);if(r==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(r);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Xr(()=>pe(this,void 0,void 0,function*(){const r=yield this.perform("getTransactionReceipt",t);if(r==null)return this._emitted["t:"+e]==null?null:void 0;if(r.blockHash==null)return;const i=this.formatter.receipt(r);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return i}),{oncePoll:this})})}getLogs(e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield Te({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach(i=>{i.removed==null&&(i.removed=!1)}),fe.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return pe(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return pe(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&ge.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)})}getResolver(e){return pe(this,void 0,void 0,function*(){let t=e;for(;;){if(t===""||t==="."||e!=="eth"&&t==="eth")return null;const r=yield this._getResolver(t,"getResolver");if(r!=null){const i=new V0(this,r,e);return t!==e&&!(yield i.supportsWildcard())?null:i}t=t.split(".").slice(1).join(".")}})}_getResolver(e,t){return pe(this,void 0,void 0,function*(){t==null&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||ge.throwError("network does not support ENS",O.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const i=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+bn(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return pe(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(r){if(ve(e))throw r}typeof e!="string"&&ge.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null})}lookupAddress(e){return pe(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const t=e.substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(r==null)return null;const i=Wn(yield this.call({to:r,data:"0x691f3431"+bn(t).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return pe(this,void 0,void 0,function*(){let t=null;if(ve(e)){const o=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",s=yield this._getResolver(o,"getAvatar");if(!s)return null;t=new V0(this,s,o);try{const c=yield t.getAvatar();if(c)return c.url}catch(c){if(c.code!==O.errors.CALL_EXCEPTION)throw c}try{const c=Wn(yield this.call({to:s,data:"0x691f3431"+bn(o).substring(2)}),0);t=yield this.getResolver(c)}catch(c){if(c.code!==O.errors.CALL_EXCEPTION)throw c;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return r==null?null:r.url})}perform(e,t){return ge.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(t=>t.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(t=>t.pollable()).length>0}_addEventListener(e,t,r){const i=new Fu(Jr(e),t,r);return this._events.push(i),this._startEvent(i),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,i=[],o=Jr(e);return this._events=this._events.filter(s=>s.tag!==o?!0:(setTimeout(()=>{s.listener.apply(this,t)},0),r=!0,s.once?(i.push(s),!1):!0)),i.forEach(s=>{this._stopEvent(s)}),r}listenerCount(e){if(!e)return this._events.length;let t=Jr(e);return this._events.filter(r=>r.tag===t).length}listeners(e){if(e==null)return this._events.map(r=>r.listener);let t=Jr(e);return this._events.filter(r=>r.tag===t).map(r=>r.listener)}off(e,t){if(t==null)return this.removeAllListeners(e);const r=[];let i=!1,o=Jr(e);return this._events=this._events.filter(s=>s.tag!==o||s.listener!=t||i?!0:(i=!0,r.push(s),!1)),r.forEach(s=>{this._stopEvent(s)}),this}removeAllListeners(e){let t=[];if(e==null)t=this._events,this._events=[];else{const r=Jr(e);this._events=this._events.filter(i=>i.tag!==r?!0:(t.push(i),!1))}return t.forEach(r=>{this._stopEvent(r)}),this}}const Gu="abstract-signer/5.8.0";var Gt=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const qt=new O(Gu),qu=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],zu=[O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED];class Ro{constructor(){qt.checkAbstract(new.target,Ro),Q(this,"_isSigner",!0)}getBalance(e){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Gt(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const t=yield Te(this.checkTransaction(e));return yield this.provider.estimateGas(t)})}call(e,t){return Gt(this,void 0,void 0,function*(){this._checkProvider("call");const r=yield Te(this.checkTransaction(e));return yield this.provider.call(r,t)})}sendTransaction(e){return Gt(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)})}getChainId(){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Gt(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Gt(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const r in e)qu.indexOf(r)===-1&&qt.throwArgumentError("invalid transaction key: "+r,"transaction",e);const t=nt(e);return t.from==null?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then(r=>(r[0].toLowerCase()!==r[1].toLowerCase()&&qt.throwArgumentError("from address mismatch","transaction",e),r[0])),t}populateTransaction(e){return Gt(this,void 0,void 0,function*(){const t=yield Te(this.checkTransaction(e));t.to!=null&&(t.to=Promise.resolve(t.to).then(i=>Gt(this,void 0,void 0,function*(){if(i==null)return null;const o=yield this.resolveName(i);return o==null&&qt.throwArgumentError("provided ENS name resolves to null","tx.to",i),o})),t.to.catch(i=>{}));const r=t.maxFeePerGas!=null||t.maxPriorityFeePerGas!=null;if(t.gasPrice!=null&&(t.type===2||r)?qt.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(t.type===0||t.type===1)&&r&&qt.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(t.type===2||t.type==null)&&t.maxFeePerGas!=null&&t.maxPriorityFeePerGas!=null)t.type=2;else if(t.type===0||t.type===1)t.gasPrice==null&&(t.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(t.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(t.type=2,t.gasPrice!=null){const o=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=o,t.maxPriorityFeePerGas=o}else t.maxFeePerGas==null&&(t.maxFeePerGas=i.maxFeePerGas),t.maxPriorityFeePerGas==null&&(t.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(r&&qt.throwError("network does not support EIP-1559",O.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),t.gasPrice==null&&(t.gasPrice=i.gasPrice),t.type=0):qt.throwError("failed to get consistent fee data",O.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else t.type===2&&(t.maxFeePerGas==null&&(t.maxFeePerGas=i.maxFeePerGas),t.maxPriorityFeePerGas==null&&(t.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return t.nonce==null&&(t.nonce=this.getTransactionCount("pending")),t.gasLimit==null&&(t.gasLimit=this.estimateGas(t).catch(i=>{if(zu.indexOf(i.code)>=0)throw i;return qt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:t})})),t.chainId==null?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&qt.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Te(t)})}_checkProvider(e){this.provider||qt.throwError("missing provider",O.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}var hr=function(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function c(w){try{g(r.next(w))}catch(M){s(M)}}function x(w){try{g(r.throw(w))}catch(M){s(M)}}function g(w){w.done?o(w.value):i(w.value).then(c,x)}g((r=r.apply(n,e||[])).next())})};const at=new O(hi),Hu=["call","estimateGas"];function mn(n,e){if(n==null)return null;if(typeof n.message=="string"&&n.message.match("reverted")){const t=ve(n.data)?n.data:null;if(!e||t)return{message:n.message,data:t}}if(typeof n=="object"){for(const t in n){const r=mn(n[t],e);if(r)return r}return null}if(typeof n=="string")try{return mn(JSON.parse(n),e)}catch{}return null}function ma(n,e,t){const r=t.transaction||t.signedTransaction;if(n==="call"){const o=mn(e,!0);if(o)return o.data;at.throwError("missing revert data in call exception; Transaction reverted without a reason string",O.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:e})}if(n==="estimateGas"){let o=mn(e.body,!1);o==null&&(o=mn(e,!1)),o&&at.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:n,transaction:r,error:e})}let i=e.message;throw e.code===O.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&at.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:n,transaction:r}),i.match(/nonce (is )?too low/i)&&at.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:n,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&at.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:n,transaction:r}),i.match(/only replay-protected/i)&&at.throwError("legacy pre-eip-155 transactions not supported",O.errors.UNSUPPORTED_OPERATION,{error:e,method:n,transaction:r}),Hu.indexOf(n)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&at.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:n,transaction:r}),e}function W0(n){return new Promise(function(e){setTimeout(e,n)})}function Ku(n){if(n.error){const e=new Error(n.error.message);throw e.code=n.error.code,e.data=n.error.data,e}return n.result}function dn(n){return n&&n.toLowerCase()}const lo={};class ya extends Ro{constructor(e,t,r){if(super(),e!==lo)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Q(this,"provider",t),r==null&&(r=0),typeof r=="string"?(Q(this,"_address",this.provider.formatter.address(r)),Q(this,"_index",null)):typeof r=="number"?(Q(this,"_index",r),Q(this,"_address",null)):at.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return at.throwError("cannot alter JSON-RPC Signer connection",O.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Ju(lo,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&at.throwError("unknown account #"+this._index,O.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=nt(e);const t=this.getAddress().then(r=>(r&&(r=r.toLowerCase()),r));if(e.gasLimit==null){const r=nt(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(r=>hr(this,void 0,void 0,function*(){if(r==null)return null;const i=yield this.provider.resolveName(r);return i==null&&at.throwArgumentError("provided ENS name resolves to null","tx.to",r),i}))),Te({tx:Te(e),sender:t}).then(({tx:r,sender:i})=>{r.from!=null?r.from.toLowerCase()!==i&&at.throwArgumentError("from address mismatch","transaction",e):r.from=i;const o=this.provider.constructor.hexlifyTransaction(r,{from:!0});return this.provider.send("eth_sendTransaction",[o]).then(s=>s,s=>(typeof s.message=="string"&&s.message.match(/user denied/i)&&at.throwError("user rejected transaction",O.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),ma("sendTransaction",s,o)))})}signTransaction(e){return at.throwError("signing transactions is unsupported",O.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return hr(this,void 0,void 0,function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Xr(()=>hr(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(r);if(i!==null)return this.provider._wrapTransaction(i,r,t)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=r,i}})}signMessage(e){return hr(this,void 0,void 0,function*(){const t=typeof e=="string"?ut(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[re(t),r.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&at.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),i}})}_legacySignMessage(e){return hr(this,void 0,void 0,function*(){const t=typeof e=="string"?ut(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),re(t)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&at.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),i}})}_signTypedData(e,t,r){return hr(this,void 0,void 0,function*(){const i=yield gt.resolveNames(e,t,r,s=>this.provider.resolveName(s)),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(gt.getPayload(i.domain,t,i.value))])}catch(s){throw typeof s.message=="string"&&s.message.match(/user denied/i)&&at.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:t,value:i.value}}),s}})}unlock(e){return hr(this,void 0,void 0,function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])})}}class Ju extends ya{sendTransaction(e){return this.sendUncheckedTransaction(e).then(t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:r=>this.provider.waitForTransaction(t,r)}))}}const Vu={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Wu extends Lu{constructor(e,t){let r=t;r==null&&(r=new Promise((i,o)=>{setTimeout(()=>{this.detectNetwork().then(s=>{i(s)},s=>{o(s)})},0)})),super(r),e||(e=Wt(this.constructor,"defaultUrl")()),typeof e=="string"?Q(this,"connection",Object.freeze({url:e})):Q(this,"connection",Object.freeze(nt(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return hr(this,void 0,void 0,function*(){yield W0(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const t=Wt(this.constructor,"getNetwork");try{return t(ee.from(e).toNumber())}catch(r){return at.throwError("could not detect network",O.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:r})}}return at.throwError("could not detect network",O.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new ya(lo,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(t=>this.formatter.address(t)))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:sr(r),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const o=ui(this.connection,JSON.stringify(r),Ku).then(s=>(this.emit("debug",{action:"response",request:r,response:s,provider:this}),s),s=>{throw this.emit("debug",{action:"response",error:s,request:r,provider:this}),s});return i&&(this._cache[e]=o,setTimeout(()=>{this._cache[e]=null},0)),o}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[dn(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[dn(t.address),t.blockTag]];case"getCode":return["eth_getCode",[dn(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[dn(t.address),We(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[Wt(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[Wt(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&t.filter.address!=null&&(t.filter.address=dn(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return hr(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=t.transaction;if(i&&i.type!=null&&ee.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const o=yield this.getFeeData();o.maxFeePerGas==null&&o.maxPriorityFeePerGas==null&&(t=nt(t),t.transaction=nt(i),delete t.transaction.type)}}const r=this.prepareRequest(e,t);r==null&&at.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(i){return ma(e,i,t)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then(function(r){function i(){e.send("eth_getFilterChanges",[r]).then(function(o){if(e._pendingFilter!=t)return null;let s=Promise.resolve();return o.forEach(function(c){e._emitted["t:"+c.toLowerCase()]="pending",s=s.then(function(){return e.getTransaction(c).then(function(x){return e.emit("pending",x),null})})}),s.then(function(){return W0(1e3)})}).then(function(){if(e._pendingFilter!=t){e.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){i()},0),null}).catch(o=>{})}return i(),r}).catch(r=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=nt(Vu);if(t)for(const o in t)t[o]&&(r[o]=!0);po(e,r);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(o){if(e[o]==null)return;const s=ii(ee.from(e[o]));o==="gasLimit"&&(o="gas"),i[o]=s}),["from","to","data"].forEach(function(o){e[o]!=null&&(i[o]=re(e[o]))}),e.accessList&&(i.accessList=zr(e.accessList)),i}}const j0=new O(hi);let ju=1;function Q0(n,e){const t="Web3LegacyFetcher";return function(r,i){const o={method:r,params:i,id:ju++,jsonrpc:"2.0"};return new Promise((s,c)=>{this.emit("debug",{action:"request",fetcher:t,request:sr(o),provider:this}),e(o,(x,g)=>{if(x)return this.emit("debug",{action:"response",fetcher:t,error:x,request:o,provider:this}),c(x);if(this.emit("debug",{action:"response",fetcher:t,request:o,response:g,provider:this}),g.error){const w=new Error(g.error.message);return w.code=g.error.code,w.data=g.error.data,c(w)}s(g.result)})})}}function Qu(n){return function(e,t){t==null&&(t=[]);const r={method:e,params:t};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:sr(r),provider:this}),n.request(r).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:i,provider:this}),i})}}class ih extends Wu{constructor(e,t){e==null&&j0.throwArgumentError("missing provider","provider",e);let r=null,i=null,o=null;typeof e=="function"?(r="unknown:",i=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),o=e,e.request?(r===""&&(r="eip-1193:"),i=Qu(e)):e.sendAsync?i=Q0(e,e.sendAsync.bind(e)):e.send?i=Q0(e,e.send.bind(e)):j0.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),Q(this,"jsonRpcFetchFunc",i),Q(this,"provider",o)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const Yu="units/5.8.0",Xu=new O(Yu),Zu=["wei","kwei","mwei","gwei","szabo","finney","ether"];function va(n,e){return qn(n,e)}function wa(n,e){if(typeof n!="string"&&Xu.throwArgumentError("value must be a string","value",n),typeof e=="string"){const t=Zu.indexOf(e);t!==-1&&(e=3*t)}return Zt(n,e??18)}function $u(n){return va(n,18)}function eh(n){return wa(n,18)}const oh=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:Es,ConstructorFragment:Jt,ErrorFragment:lr,EventFragment:rr,FormatTypes:Ee,Fragment:nr,FunctionFragment:Vt,HDNode:kt,Indexed:Zn,Interface:oo,LogDescription:Ls,Logger:O,ParamType:ct,SigningKey:Tr,get SupportedAlgorithm(){return nn},TransactionDescription:Gs,get TransactionTypes(){return fo},get UnicodeNormalizationForm(){return xr},Utf8ErrorFuncs:vs,get Utf8ErrorReason(){return Pt},_TypedDataEncoder:gt,_fetchData:pa,accessListify:zr,arrayify:Z,base58:rn,checkProperties:po,checkResultErrors:hs,computeAddress:Sr,computeHmac:_n,computePublicKey:_o,concat:rt,deepCopy:sr,defaultAbiCoder:_s,defaultPath:on,defineReadOnly:Q,dnsEncode:Ts,entropyToMnemonic:ci,fetchJson:ui,formatEther:$u,formatUnits:va,getAddress:et,getContractAddress:yo,getStatic:Wt,hashMessage:Fs,hexConcat:At,hexDataLength:Pr,hexDataSlice:ft,hexStripZeros:rs,hexValue:ii,hexZeroPad:We,hexlify:re,id:_r,isBytes:Ur,isBytesLike:Pn,isHexString:ve,joinSignature:no,keccak256:je,mnemonicToEntropy:ko,mnemonicToSeed:aa,namehash:bn,parseEther:eh,parseTransaction:$s,parseUnits:wa,poll:Xr,randomBytes:Yr,recoverAddress:Po,recoverPublicKey:js,resolveProperties:Te,ripemd160:ia,serializeTransaction:co,sha256:Ir,shallowCopy:nt,splitSignature:Lr,stripZeros:or,toUtf8Bytes:ut,toUtf8CodePoints:As,toUtf8String:an,zeroPad:ts},Symbol.toStringTag,{value:"Module"}));export{ee as B,nh as C,Wu as J,ih as W,ii as a,eh as b,We as c,wa as d,Ma as e,$u as f,Bo as g,re as h,ac as i,kn as j,ka as k,xc as l,Wr as m,Pi as p,Yr as r,oh as u};
|