kryptex.theincomegrowthofficial.com Open in urlscan Pro
54.38.153.209  Public Scan

Submitted URL: http://kryptex.theincomegrowthofficial.com/assets/web3-provider/web3-seaport.js
Effective URL: https://kryptex.theincomegrowthofficial.com/assets/web3-provider/web3-seaport.js
Submission: On July 09 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

(()=>{var e={6631:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Multicall:()=>E,providers:()=>k});var n=r(2593),i=r(8198),o=r(2734),s=r(7013);const a={erc1271:Object.freeze({__proto__:null,abi:[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],returns:{isValidSignatureBytes32:"0x1626ba7e"}}),factory:Object.freeze({__proto__:null,abi:[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}]}),mainModule:Object.freeze({__proto__:null,abi:[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"}]}),mainModuleUpgradable:Object.freeze({__proto__:null,abi:[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}]}),sequenceUtils:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}]}),requireFreshSigner:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}]})};function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}var l;function c(e,t){return function(...r){const n=Array.prototype.slice.call(r);return new Promise((async(r,i)=>{try{n.push(((e,t)=>e?i(e):r(t))),await e.apply(t,n)}catch(e){i(e)}}))}}!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.DISABLED=5]="DISABLED"}(l||(l={})),new class{constructor(e){this.config=e,this.logLevel=void 0,this.configure(e)}configure(e){switch(this.config=u({},this.config,e),this.config.logLevel){case"DEBUG":this.logLevel=l.DEBUG;break;case"INFO":default:this.logLevel=l.INFO;break;case"WARN":this.logLevel=l.WARN;break;case"ERROR":this.logLevel=l.ERROR;break;case"DISABLED":this.logLevel=l.DISABLED}void 0===this.config.silence&&(this.config.silence=!1)}debug(e,...t){!0!==this.config.silence&&this.logLevel===l.DEBUG&&console.log(e,...t)}info(e,...t){!0!==this.config.silence&&this.logLevel<=l.INFO&&console.log(e,...t)}warn(e,...t){!0!==this.config.silence&&this.logLevel<=l.WARN&&(console.warn(e,...t),this.config.onwarn&&this.config.onwarn(e,t))}error(e,...t){!0!==this.config.silence&&this.logLevel<=l.ERROR&&(console.error(e,...t),this.config.onerror&&this.config.onerror(e,t))}}({logLevel:"INFO",silence:!0});const h=(e=0,t=Number.MAX_SAFE_INTEGER)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),f=e=>e.replace(/([^:]\/)\/+/g,"$1");function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d.apply(this,arguments)}const p=(e,t,r)=>{let n=[];if(n="function"==typeof e&&r?e(r):e,t){n.forEach((e=>e.isDefaultChain=!1));const e=n.filter((e=>e.chainId===t));if(!e||0===e.length)throw new Error(`defaultChainId ${t} cannot be found in network list`);e[0].isDefaultChain=!0}return((e,t=!1)=>(((e,t=!1,r=!1)=>{if(!e)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(e)?n.push(...e):n.push(e),0===n.length){if(t)throw new Error("invalid network config: empty config");return!1}const i=n.map((e=>e.chainId)).sort(),o=i.filter(((e,t)=>i.indexOf(e)!==t));if(o.length>0){if(t)throw new Error(`invalid network config: duplicate chainIds ${o}`);return!1}n.forEach((e=>e.name=e.name.toLowerCase()));const s=n.map((e=>e.name)).sort(),a=s.filter(((e,t)=>s.indexOf(e)!==t));if(a.length>0){if(t)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let u=!1,l=!1;for(let e=0;e<n.length;e++){const i=n[e];if(!(i.rpcUrl&&""!==i.rpcUrl||i.provider)){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: rpcUrl or provider must be provided`);return!1}if(!r&&!i.relayer){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: relayer must be provided`);return!1}if(i.isDefaultChain){if(u){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: DefaultChain is already set by another config`);return!1}u=!0}if(i.isAuthChain){if(l&&t)throw new Error(`invalid network config for chainId ${i.chainId}: AuthChain is already set by another config`);l=!0}}if(!u){if(t)throw new Error("invalid network config: DefaultChain must be set");return!1}if(!l&&t)throw new Error("invalid network config: AuthChain must be set")})(e,!0,t),e))(m(n))},m=e=>{if(!e)return[];const t=e.sort(((e,t)=>e.chainId===t.chainId?0:e.chainId<t.chainId?-1:1)),r=t.findIndex((e=>e.isDefaultChain));r>0&&t.splice(0,0,t.splice(r,1)[0]);const n=t.findIndex((e=>e.isAuthChain&&!0!==e.isDefaultChain));return n>0&&t.splice(1,0,t.splice(n,1)[0]),t};let y;!function(e){e[e.MAINNET=1]="MAINNET",e[e.ROPSTEN=3]="ROPSTEN",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.KOVAN=42]="KOVAN",e[e.POLYGON=137]="POLYGON",e[e.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",e[e.BSC=56]="BSC",e[e.BSC_TESTNET=97]="BSC_TESTNET",e[e.OPTIMISM=10]="OPTIMISM",e[e.OPTIMISM_TESTNET=69]="OPTIMISM_TESTNET",e[e.ARBITRUM=42161]="ARBITRUM",e[e.ARBITRUM_TESTNET=421611]="ARBITRUM_TESTNET",e[e.AVALANCHE=43114]="AVALANCHE",e[e.AVALANCHE_TESTNET=43113]="AVALANCHE_TESTNET",e[e.FANTOM=250]="FANTOM",e[e.FANTOM_TESTNET=4002]="FANTOM_TESTNET",e[e.GNOSIS=100]="GNOSIS",e[e.AURORA=1313161554]="AURORA",e[e.AURORA_TESTNET=1313161556]="AURORA_TESTNET"}(y||(y={}));const g={[y.MAINNET]:{chainId:y.MAINNET,name:"mainnet",title:"Ethereum",blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"}},[y.ROPSTEN]:{chainId:y.ROPSTEN,name:"ropsten",title:"Ropsten",testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"}},[y.RINKEBY]:{chainId:y.RINKEBY,name:"rinkeby",title:"Rinkeby",testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"}},[y.GOERLI]:{chainId:y.GOERLI,name:"goerli",title:"Goerli",testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"}},[y.KOVAN]:{chainId:y.KOVAN,name:"kovan",title:"Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"}},[y.POLYGON]:{chainId:y.POLYGON,name:"polygon",title:"Polygon",blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"}},[y.POLYGON_MUMBAI]:{chainId:y.POLYGON_MUMBAI,name:"mumbai",title:"Polygon Mumbai",testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"}},[y.BSC]:{chainId:y.BSC,name:"bsc",title:"BNB Smart Chain",blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"}},[y.BSC_TESTNET]:{chainId:y.BSC_TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"}},[y.OPTIMISM]:{chainId:y.OPTIMISM,name:"optimism",title:"Optimism",blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"}},[y.OPTIMISM_TESTNET]:{chainId:y.OPTIMISM_TESTNET,name:"optimism-testnet",title:"Optimistic Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Optimism Testnet)",rootUrl:"https://kovan-optimistic.etherscan.io/"}},[y.ARBITRUM]:{chainId:y.ARBITRUM,name:"arbitrum",title:"Arbitrum",blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"}},[y.ARBITRUM_TESTNET]:{chainId:y.ARBITRUM_TESTNET,name:"arbitrum-testnet",title:"Arbitrum Testnet",testnet:!0,blockExplorer:{name:"Arbiscan (Testnet)",rootUrl:"https://testnet.arbiscan.io/"}},[y.AVALANCHE]:{chainId:y.AVALANCHE,name:"avalanche",title:"Avalanche",blockExplorer:{name:"Snowtrace",rootUrl:"https://snowtrace.io/"}},[y.AVALANCHE_TESTNET]:{chainId:y.AVALANCHE_TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://testnet.snowtrace.io/"}},[y.FANTOM]:{chainId:y.FANTOM,name:"fantom",title:"Fantom",blockExplorer:{name:"FTMScan",rootUrl:"https://ftmscan.com/"}},[y.FANTOM_TESTNET]:{chainId:y.FANTOM_TESTNET,name:"fantom-testnet",title:"Fantom Testnet",testnet:!0,blockExplorer:{name:"FTMScan (Testnet)",rootUrl:"https://testnet.ftmscan.com/"}},[y.GNOSIS]:{chainId:y.GNOSIS,name:"gnosis",title:"Gnosis Chain",blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"}},[y.AURORA]:{chainId:y.AURORA,name:"aurora",title:"Aurora",blockExplorer:{name:"Aurora Explorer",rootUrl:"https://aurorascan.dev/"}},[y.AURORA_TESTNET]:{chainId:y.AURORA_TESTNET,name:"aurora-testnet",title:"Aurora Testnet",blockExplorer:{name:"Aurora Explorer (Testnet)",rootUrl:"https://testnet.aurorascan.dev/"}}},v=(p((e=>[d({},g[y.MAINNET],{ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",rpcUrl:f(`${e.baseRpcUrl}/mainnet`),relayer:{url:f(`${e.baseRelayerUrl}/mainnet`)},isDefaultChain:!0}),d({},g[y.POLYGON],{rpcUrl:"https://rpc-mainnet.matic.network",relayer:{url:f(`${e.baseRelayerUrl}/matic`)},isAuthChain:!0})]),1,{baseRpcUrl:"https://nodes.sequence.app",baseRelayerUrl:"https://relayers.sequence.app"}),p((e=>[d({},g[y.RINKEBY],{ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",rpcUrl:f(`${e.baseRpcUrl}/rinkeby`),relayer:{url:f(`${e.baseRelayerUrl}/rinkeby`)},isDefaultChain:!0}),d({},g[y.GOERLI],{ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",rpcUrl:f(`${e.baseRpcUrl}/goerli`),relayer:{url:f(`${e.baseRelayerUrl}/goerli`)},isAuthChain:!0})]),void 0,{baseRpcUrl:"https://nodes.sequence.app",baseRelayerUrl:"https://relayers.sequence.app"}),"2.0");function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},b.apply(this,arguments)}let w;function A(e,t){return e.reduce((function(e,r,n){return t(r,n)?e[0].push(r):e[1].push(r),e}),[[],[]])}!function(e){e.ethCall="eth_call",e.ethGetBalance="eth_getBalance",e.ethGetCode="eth_getCode"}(w||(w={}));class E{constructor(e){var t=this;if(this.batchableJsonRpcMethods=[w.ethCall,w.ethGetCode,w.ethGetBalance],this.multicallInterface=new i.vU(a.sequenceUtils.abi),this.options=void 0,this.timeout=void 0,this.queue=[],this.scheduleExecution=()=>{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(e,t,r)=>this.batchableJsonRpcMethods.find((e=>e===t.method))?(this.queue.push({request:t,callback:r,next:e}),this.options.verbose&&console.log("Scheduling call",t.method),void this.scheduleExecution()):(this.options.verbose&&console.log("Forwarded call",t.method),e(t,r)),this.run=async function(){t.options.verbose&&console.log("Processing multicall");const e=Math.min(t.options.batchSize,t.queue.length);if(0===e)return;if(1===e)return t.forward(t.queue[0]),t.queue=[],void(t.options.verbose&&console.log("Skip multicall, single item"));t.options.verbose&&console.log("Resolving",e);var r=t.queue.slice(0,e);t.queue=e===t.queue.length?[]:t.queue.slice(e),t.options.verbose&&console.log("Updated queue",t.queue.length),0!==t.queue.length&&t.scheduleExecution();const i=r[0].next;let s;var[r,a]=A(r,(e=>{try{if(e.next!==i)return!1;switch(e.request.method){case w.ethCall:if(e.request.params[0].from||e.request.params[0].gasPrice||e.request.params[0].value)return!1;case w.ethGetBalance:case w.ethGetCode:const i=function(e){if(void 0===e)return"latest";switch(e){case"earliest":case"latest":case"pending":return e}return n.O$.from(e)}(e.request.params[1]);if(void 0===s&&(s=i),(t=i)!==(r=s)&&!(n.O$.isBigNumber(t)?n.O$.isBigNumber(r)&&t.eq(r):!n.O$.isBigNumber(r)&&t===r))return!1}return!0}catch(e){return!1}var t,r}));if(0!==a.length&&(t.options.verbose&&console.log("Forwarding incompatible calls",a.length),t.forward(a),0===r.length))return;let u=r.map((e=>{try{switch(e.request.method){case w.ethCall:return{delegateCall:!1,revertOnError:!1,target:e.request.params[0].to,data:e.request.params[0].data,gasLimit:e.request.params[0].gas?e.request.params[0].gas:0,value:0};case w.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:t.options.contract,gasLimit:0,value:0,data:t.multicallInterface.encodeFunctionData(t.multicallInterface.getFunction("callCode"),[e.request.params[0]])};case w.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:t.options.contract,gasLimit:0,value:0,data:t.multicallInterface.encodeFunctionData(t.multicallInterface.getFunction("callBalanceOf"),[e.request.params[0]])};default:return null}}catch(e){return null}}));var[r,a]=A(r,((e,t)=>void 0!==u[t]));if(u=u.filter((e=>e)),0!==a.length&&(t.options.verbose&&console.log("Forwarding calls on error",a.length),t.forward(a),0===r.length))return;let l;try{l=t.multicallInterface.encodeFunctionData(t.multicallInterface.getFunction("multiCall"),[u])}catch(e){return void t.forward(r)}const f=h(),d=await async function(e,t){try{return await e}catch(e){return t instanceof Function?t(e):t}}(c(i)({id:f,jsonrpc:v,method:w.ethCall,params:[{to:t.options.contract,value:0,data:l},n.O$.isBigNumber(s)?s.toNumber():s]}),(e=>({jsonrpc:v,id:f,result:void 0,error:e})));if(d.error)return t.forward(r);let p;try{p=t.multicallInterface.decodeFunctionResult(t.multicallInterface.getFunction("multiCall"),d.result)}catch(e){return void t.forward(r)}t.options.verbose&&console.log("Got response for",r.length),r.forEach(((e,r)=>{if(p[0][r])switch(e.request.method){case w.ethCall:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:p[1][r]});break;case w.ethGetCode:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:o.$.decode(["bytes"],p[1][r])[0]});break;case w.ethGetBalance:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:o.$.decode(["uint256"],p[1][r])[0]})}else t.forward(e)}))},this.options=e?b({},E.DefaultOptions,e):E.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach((e=>e.next(e.request,e.callback))):e.next(e.request,e.callback)}static isMulticall(e){return e&&void 0!==e.handle&&void 0!==e.conf&&E.isMulticallOptions(e.options)}static isMulticallOptions(e){return void 0!==e&&void 0!==e.batchSize&&void 0!==e.timeWindow&&void 0!==e.contract}}E.DefaultOptions=b({},{batchSize:50,timeWindow:50,contract:"0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E",verbose:!1});const T=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];class _ extends s.Zk{constructor(e,t){var r;super(e.getNetwork()),r=this,this.provider=e,this.multicall=void 0,this.listenerCount=this.provider.listenerCount,this.getResolver=async function(e){const t=r.provider;if(t.getResolver){const n=await t.getResolver(await e);return n?new s.H2(r,n.address,n.name):null}return t.getResolver(await e)},this.next=async function(e,t){try{switch(e.method){case w.ethCall:r.callback(e,t,await r.provider.call(e.params[0],e.params[1]));break;case w.ethGetCode:r.callback(e,t,await r.provider.getCode(e.params[0],e.params[1]));break;case w.ethGetBalance:r.callback(e,t,await r.provider.getBalance(e.params[0],e.params[1]))}}catch(n){r.callback(e,t,void 0,n)}},this.multicall=E.isMulticall(t)?t:new E(t),T.forEach((t=>{void 0!==e[t]&&(this[t]=(...r)=>e[t](...r))}))}callback(e,t,r,n){t(n,{jsonrpc:v,id:e.id,result:r,error:n})}async call(e,t){return this.rpcCall(w.ethCall,e,t)}async getCode(e,t){return this.rpcCall(w.ethGetCode,e,t)}async getBalance(e,t){return this.rpcCall(w.ethGetBalance,e,t)}async rpcCall(e,...t){const r=h();return(await c(this.multicall.handle)(this.next,{jsonrpc:v,id:r,method:e,params:t})).result}}var k=Object.freeze({__proto__:null,ProxyMethods:T,MulticallProvider:_,MulticallExternalProvider:class{constructor(e,t){if(this.provider=e,this.multicall=void 0,this.multicall=E.isMulticall(t)?t:new E(t),e.send){const t=async function(t,r){e.send(t,r)};this.send=(e,r)=>{this.multicall.handle(t,e,r)}}if(e.sendAsync){const t=async function(t,r){e.sendAsync(t,r)};this.sendAsync=(e,r)=>{this.multicall.handle(t,e,r)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}},multicallMiddleware:e=>t=>{const r=E.isMulticall(e)?e:new E(e);return(e,n)=>r.handle(t,e,n)}})},5851:(e,t,r)=>{"use strict";r.d(t,{i:()=>n});const n="abi/5.7.0"},2734:(e,t,r)=>{"use strict";r.d(t,{R:()=>I,$:()=>P});var n=r(3286),i=r(3587),o=r(711),s=r(5851),a=r(1184),u=r(4594);class l extends a.XI{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=(0,u.getAddress)(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return(0,u.getAddress)((0,n.hexZeroPad)(e.readValue().toHexString(),20))}}class c extends a.XI{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 h=new o.Logger(s.i);function f(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||h.throwError("cannot encode object for signature with missing names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&h.throwError("cannot encode object for signature with duplicate names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else h.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&h.throwArgumentError("types/value length mismatch","tuple",r);let i=new a.QV(e.wordSize),s=new a.QV(e.wordSize),u=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=s.length;e.encode(s,r);let n=i.writeUpdatableValue();u.push((e=>{n(e+t)}))}else e.encode(i,r)})),u.forEach((e=>{e(i.length)}));let l=e.appendWriter(i);return l+=e.appendWriter(s),l}function d(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),s=n.subReader(r.toNumber());try{i=t.decode(s)}catch(e){if(e.code===o.Logger.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===o.Logger.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let e=0;e<r.length;e++){const t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(r)}class p extends a.XI{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),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;-1===r&&(r=t.length,e.writeValue(t.length)),h.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let e=0;e<t.length;e++)n.push(this.coder);return f(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&h.throwError("insufficient data length",o.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new c(this.coder));return e.coerce(this.name,d(e,r))}}class m extends a.XI{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 y extends a.XI{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,n.arrayify)(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class g extends y{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,(0,n.hexlify)(super.decode(e)))}}class v extends a.XI{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=(0,n.arrayify)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,(0,n.hexlify)(e.readBytes(this.size)))}}class b extends a.XI{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}var w=r(2593),A=r(1046);class E extends a.XI{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=w.O$.from(t),n=A.Bz.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(A.fh).mul(A.tL)))&&this._throwError("value out-of-bounds",t)}else(r.lt(A._Y)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}var T=r(4242);class _ extends y{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,T.Y0)(t))}decode(e){return(0,T.ZN)(super.decode(e))}}class k extends a.XI{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)})),super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return f(e,this.coders,t)}decode(e){return e.coerce(this.name,d(e,this.coders))}}var S=r(1388);const O=new o.Logger(s.i),x=new RegExp(/^bytes([0-9]*)$/),C=new RegExp(/^(u?int)([0-9]*)$/);class I{constructor(e){(0,i.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new l(e.name);case"bool":return new m(e.name);case"string":return new _(e.name);case"bytes":return new g(e.name);case"array":return new p(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new k((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new b(e.name)}let t=e.type.match(C);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&O.throwArgumentError("invalid "+t[1]+" bit length","param",e),new E(r/8,"int"===t[1],e.name)}if(t=e.type.match(x),t){let r=parseInt(t[1]);return(0===r||r>32)&&O.throwArgumentError("invalid bytes length","param",e),new v(r,e.name)}return O.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new a.Ej(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new a.QV(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(S._R.from(e))));return new k(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&O.throwError("types/values length mismatch",o.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(S._R.from(e)))),n=new k(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const i=e.map((e=>this._getCoder(S._R.from(e))));return new k(i,"_").decode(this._getReader((0,n.arrayify)(t),r))}}const P=new I},1184:(e,t,r)=>{"use strict";r.d(t,{BR:()=>l,Ej:()=>f,QV:()=>h,XI:()=>c});var n=r(3286),i=r(2593),o=r(3587),s=r(711),a=r(5851);const u=new s.Logger(a.i);function l(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class c{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){u.throwArgumentError(e,this.localName,t)}}class h{constructor(e){(0,o.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,n.hexConcat)(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((0,n.concat)(e._data))}writeBytes(e){let t=(0,n.arrayify)(e);const r=t.length%this.wordSize;return r&&(t=(0,n.concat)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,n.arrayify)(i.O$.from(e));return t.length>this.wordSize&&u.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,n.concat)([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 f{constructor(e,t,r,i){(0,o.defineReadOnly)(this,"_data",(0,n.arrayify)(e)),(0,o.defineReadOnly)(this,"wordSize",t||32),(0,o.defineReadOnly)(this,"_coerceFunc",r),(0,o.defineReadOnly)(this,"allowLoose",i),this._offset=0}get data(){return(0,n.hexlify)(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):f.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:u.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new f(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 i.O$.from(this.readBytes(this.wordSize))}}},1388:(e,t,r)=>{"use strict";r.d(t,{HY:()=>g,IC:()=>k,QV:()=>v,Xg:()=>E,YW:()=>T,_R:()=>m,pc:()=>d});var n=r(2593),i=r(3587),o=r(711),s=r(5851);const a=new o.Logger(s.i),u={};let l={calldata:!0,memory:!0,storage:!0},c={calldata:!0,memory:!0};function h(e,t){if("bytes"===e||"string"===e){if(l[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&c[t])return!0;return(l[t]||"payable"===t)&&a.throwArgumentError("invalid modifier","name",t),!1}function f(e,t){for(let r in t)(0,i.defineReadOnly)(e,r,t[r])}const d=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=new RegExp(/^(.*)\[([0-9]*)\]$/);class m{constructor(e,t){e!==u&&a.throwError("use fromString",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),f(this,t);let r=this.type.match(p);f(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:m.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==d.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===d.full?", ":",")+")"):t+=this.type,e!==d.sighash&&(!0===this.indexed&&(t+=" indexed"),e===d.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?m.fromString(e,t):m.fromObject(e)}static fromObject(e){return m.isParamType(e)?e:new m(u,{name:e.name||null,type:S(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(m.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){a.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let r=0;r<e.length;r++){let o=e[r];switch(o){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(r),s.state.allowType=!1,s.type=S(s.type),s.components=[i(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),h(s.type,s.name)&&(s.name=""),s.type=S(s.type);let e=s;s=s.parent,s||n(r),delete e.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),h(s.type,s.name)&&(s.name=""),s.type=S(s.type);let a=i(s.parent);s.parent.components.push(a),delete s.parent,s=a;break;case" ":s.state.allowType&&""!==s.type&&(s.type=S(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(t||n(r),s.indexed&&n(r),s.indexed=!0,s.name=""):h(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(r),s.type+=o,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(r),s.type+=o,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=o,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=o,delete s.state.allowArray):s.state.readArray?s.type+=o:n(r)}}return s.parent&&a.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===s.name?(t||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):h(s.type,s.name)&&(s.name=""),o.type=S(o.type),o}(e,!!t),m.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}}function y(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&(n--,-1===n&&a.throwArgumentError("unbalanced parenthesis","value",e)))}return r&&t.push(r),t}(e).map((e=>m.fromString(e,t)))}class g{constructor(e,t){e!==u&&a.throwError("use a static from method",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return g.isFragment(e)?e:"string"==typeof e?g.fromString(e):g.fromObject(e)}static fromObject(e){if(g.isFragment(e))return e;switch(e.type){case"function":return T.fromObject(e);case"event":return v.fromObject(e);case"constructor":return E.fromObject(e);case"error":return k.fromObject(e);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?v.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?T.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?E.fromString(e.trim()):"error"===e.split(" ")[0]?k.fromString(e.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class v extends g{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==d.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===d.full?", ":",")+") ",e!==d.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?v.fromString(e):v.fromObject(e)}static fromObject(e){if(v.isEventFragment(e))return e;"event"!==e.type&&a.throwArgumentError("invalid event object","value",e);const t={name:x(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(m.fromObject):[],type:"event"};return new v(u,t)}static fromString(e){let t=e.match(C);t||a.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:a.warn("unknown modifier: "+e)}})),v.fromObject({name:t[1].trim(),anonymous:r,inputs:y(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function b(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=n.O$.from(r[1]),r[0]):e}function w(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function A(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&a.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&a.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||a.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&a.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&a.throwArgumentError("unable to determine stateMutability","value",e),t}class E extends g{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===d.sighash&&a.throwError("cannot format a constructor for sighash",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===d.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?E.fromString(e):E.fromObject(e)}static fromObject(e){if(E.isConstructorFragment(e))return e;"constructor"!==e.type&&a.throwArgumentError("invalid constructor object","value",e);let t=A(e);t.constant&&a.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.O$.from(e.gas):null};return new E(u,r)}static fromString(e){let t={type:"constructor"},r=(e=b(e,t)).match(C);return r&&"constructor"===r[1].trim()||a.throwArgumentError("invalid constructor string","value",e),t.inputs=y(r[2].trim(),!1),w(r[3].trim(),t),E.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class T extends E{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==d.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===d.full?", ":",")+") ",e!==d.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?T.fromString(e):T.fromObject(e)}static fromObject(e){if(T.isFunctionFragment(e))return e;"function"!==e.type&&a.throwArgumentError("invalid function object","value",e);let t=A(e);const r={type:e.type,name:x(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(m.fromObject):[],outputs:e.outputs?e.outputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.O$.from(e.gas):null};return new T(u,r)}static fromString(e){let t={type:"function"},r=(e=b(e,t)).split(" returns ");r.length>2&&a.throwArgumentError("invalid function string","value",e);let n=r[0].match(C);if(n||a.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&x(t.name),t.inputs=y(n[2],!1),w(n[3].trim(),t),r.length>1){let n=r[1].match(C);""==n[1].trim()&&""==n[3].trim()||a.throwArgumentError("unexpected tokens","value",e),t.outputs=y(n[2],!1)}else t.outputs=[];return T.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function _(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||a.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class k extends g{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==d.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===d.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?k.fromString(e):k.fromObject(e)}static fromObject(e){if(k.isErrorFragment(e))return e;"error"!==e.type&&a.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:x(e.name),inputs:e.inputs?e.inputs.map(m.fromObject):[]};return _(new k(u,t))}static fromString(e){let t={type:"error"},r=e.match(C);return r||a.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&x(t.name),t.inputs=y(r[2],!1),_(k.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function S(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const O=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function x(e){return e&&e.match(O)||a.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const C=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},3893:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbiCoder:()=>i.R,ConstructorFragment:()=>n.Xg,ErrorFragment:()=>n.IC,EventFragment:()=>n.QV,FormatTypes:()=>n.pc,Fragment:()=>n.HY,FunctionFragment:()=>n.YW,Indexed:()=>o.Hk,Interface:()=>o.vU,LogDescription:()=>o.CC,ParamType:()=>n._R,TransactionDescription:()=>o.vk,checkResultErrors:()=>s.BR,defaultAbiCoder:()=>i.$});var n=r(1388),i=r(2734),o=r(8198),s=r(1184)},8198:(e,t,r)=>{"use strict";r.d(t,{CC:()=>p,Hk:()=>g,vU:()=>w,vk:()=>m});var n=r(4594),i=r(2593),o=r(3286),s=r(2046),a=r(8197),u=r(3587),l=r(2734),c=r(1388),h=r(711),f=r(5851);const d=new h.Logger(f.i);class p extends u.Description{}class m extends u.Description{}class y extends u.Description{}class g extends u.Description{static isIndexed(e){return!(!e||!e._isIndexed)}}const v={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function b(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class w{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,(0,u.defineReadOnly)(this,"fragments",t.map((e=>c.HY.from(e))).filter((e=>null!=e))),(0,u.defineReadOnly)(this,"_abiCoder",(0,u.getStatic)(new.target,"getAbiCoder")()),(0,u.defineReadOnly)(this,"functions",{}),(0,u.defineReadOnly)(this,"errors",{}),(0,u.defineReadOnly)(this,"events",{}),(0,u.defineReadOnly)(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void d.warn("duplicate definition - constructor"):void(0,u.defineReadOnly)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?d.warn("duplicate definition - "+r):t[r]=e})),this.deploy||(0,u.defineReadOnly)(this,"deploy",c.Xg.from({payable:!1,type:"constructor"})),(0,u.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=c.pc.full),e===c.pc.sighash&&d.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===c.pc.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return l.$}static getAddress(e){return(0,n.getAddress)(e)}static getSighash(e){return(0,o.hexDataSlice)((0,s.id)(e.format()),0,4)}static getEventTopic(e){return(0,s.id)(e.format())}getFunction(e){if((0,o.isHexString)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];d.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?d.throwArgumentError("no matching function","name",t):r.length>1&&d.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[c.YW.fromString(e).format()];return t||d.throwArgumentError("no matching function","signature",e),t}getEvent(e){if((0,o.isHexString)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];d.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?d.throwArgumentError("no matching event","name",t):r.length>1&&d.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[c.QV.fromString(e).format()];return t||d.throwArgumentError("no matching event","signature",e),t}getError(e){if((0,o.isHexString)(e)){const t=(0,u.getStatic)(this.constructor,"getSighash");for(const r in this.errors)if(e===t(this.errors[r]))return this.errors[r];d.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?d.throwArgumentError("no matching error","name",t):r.length>1&&d.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[c.YW.fromString(e).format()];return t||d.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return(0,u.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),(0,u.getStatic)(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){"string"==typeof e&&(e=this.getError(e));const r=(0,o.arrayify)(t);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(e)&&d.throwArgumentError(`data signature does not match error ${e.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=(0,o.arrayify)(t);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(e)&&d.throwArgumentError(`data signature does not match function ${e.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,o.arrayify)(t),n=null,i="",s=null,a=null,u=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=(0,o.hexlify)(r.slice(0,4)),t=v[e];if(t)s=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,u=t.signature,t.reason&&(n=s[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const t=this.getError(e);s=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,u=t.format()}catch(e){}break}}return d.throwError("call revert exception"+i,h.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,o.hexlify)(t),errorArgs:s,errorName:a,errorSignature:u,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,o.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&d.throwError("too many arguments for "+e.format(),h.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?(0,s.id)(t):"bytes"===e.type?(0,a.keccak256)((0,o.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=i.O$.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,o.hexZeroPad)((0,o.hexlify)(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?d.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&d.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&d.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const u=t[o];if(e.indexed)if("string"===e.type)r.push((0,s.id)(u));else if("bytes"===e.type)r.push((0,a.keccak256)(u));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[u]))}else n.push(e),i.push(u)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);(0,o.isHexString)(r[0],32)&&r[0].toLowerCase()===t||d.throwError("fragment/topic mismatch",h.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],s=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(c._R.fromObject({type:"bytes32",name:e.name})),s.push(!0)):(n.push(e),s.push(!1)):(i.push(e),s.push(!1))}));let a=null!=r?this._abiCoder.decode(n,(0,o.concat)(r)):null,u=this._abiCoder.decode(i,t,!0),l=[],f=0,p=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)l[t]=new g({_isIndexed:!0,hash:null});else if(s[t])l[t]=new g({_isIndexed:!0,hash:a[p++]});else try{l[t]=a[p++]}catch(e){l[t]=e}else try{l[t]=u[f++]}catch(e){l[t]=e}if(e.name&&null==l[e.name]){const r=l[t];r instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:()=>{throw b(`property ${JSON.stringify(e.name)}`,r)}}):l[e.name]=r}}));for(let e=0;e<l.length;e++){const t=l[e];t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:()=>{throw b(`index ${e}`,t)}})}return Object.freeze(l)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new m({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:i.O$.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new p({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=(0,o.hexlify)(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new y({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)}}},4353:(e,t,r)=>{"use strict";r.d(t,{Sg:()=>a,zt:()=>u});var n=r(2593),i=r(3587),o=r(711);const s=new o.Logger("abstract-provider/5.7.0");class a extends i.Description{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class u{constructor(){s.checkAbstract(new.target,u),(0,i.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return e=this,t=void 0,o=function*(){const{block:e,gasPrice:t}=yield(0,i.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,o=null,s=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,s=n.O$.from("1500000000"),o=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:r,maxFeePerGas:o,maxPriorityFeePerGas:s,gasPrice:t}},new((r=void 0)||(r=Promise))((function(n,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((o=o.apply(e,t||[])).next())}));var e,t,r,o}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}},8171:(e,t,r)=>{"use strict";r.d(t,{E:()=>l,b:()=>c});var n=r(3587),i=r(711),o=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const s=new i.Logger("abstract-signer/5.7.0"),a=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],u=[i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED];class l{constructor(){s.checkAbstract(new.target,l),(0,n.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return o(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return o(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return o(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield(0,n.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return o(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield(0,n.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return o(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 o(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return o(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===a.indexOf(t)&&s.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=(0,n.shallowCopy)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&s.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return o(this,void 0,void 0,(function*(){const t=yield(0,n.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>o(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&s.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&s.throwError("network does not support EIP-1559",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):s.throwError("failed to get consistent fee data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(u.indexOf(e.code)>=0)throw e;return s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&s.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield(0,n.resolveProperties)(t)}))}_checkProvider(e){this.provider||s.throwError("missing provider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class c extends l{constructor(e,t){super(),(0,n.defineReadOnly)(this,"address",e),(0,n.defineReadOnly)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{s.throwError(e,i.Logger.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 c(this.address,e)}}},4594:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getAddress:()=>d,getContractAddress:()=>y,getCreate2Address:()=>g,getIcapAddress:()=>m,isAddress:()=>p});var n=r(3286),i=r(2593),o=r(8197),s=r(1843);const a=new(r(711).Logger)("address/5.7.0");function u(e){(0,n.isHexString)(e,20)||a.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const i=(0,n.arrayify)((0,o.keccak256)(r));for(let e=0;e<40;e+=2)i[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&i[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const l={};for(let e=0;e<10;e++)l[String(e)]=String(e);for(let e=0;e<26;e++)l[String.fromCharCode(65+e)]=String(10+e);const c=Math.floor((h=9007199254740991,Math.log10?Math.log10(h):Math.log(h)/Math.LN10));var h;function f(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>l[e])).join("");for(;t.length>=c;){let e=t.substring(0,c);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function d(e){let t=null;if("string"!=typeof e&&a.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=u(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&a.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==f(e)&&a.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=u("0x"+t)}else a.throwArgumentError("invalid address","address",e);return t}function p(e){try{return d(e),!0}catch(e){}return!1}function m(e){let t=(0,i.t2)(d(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+f("XE00"+t)+t}function y(e){let t=null;try{t=d(e.from)}catch(t){a.throwArgumentError("missing from address","transaction",e)}const r=(0,n.stripZeros)((0,n.arrayify)(i.O$.from(e.nonce).toHexString()));return d((0,n.hexDataSlice)((0,o.keccak256)((0,s.encode)([t,r])),12))}function g(e,t,r){return 32!==(0,n.hexDataLength)(t)&&a.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,n.hexDataLength)(r)&&a.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),d((0,n.hexDataSlice)((0,o.keccak256)((0,n.concat)(["0xff",d(e),t,r])),12))}},9567:(e,t,r)=>{"use strict";r.d(t,{J:()=>i,c:()=>o});var n=r(3286);function i(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return(0,n.arrayify)(t)}function o(e){e=(0,n.arrayify)(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}},4089:(e,t,r)=>{"use strict";r.r(t),r.d(t,{decode:()=>n.J,encode:()=>n.c});var n=r(9567)},7727:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Base32:()=>s,Base58:()=>a,BaseX:()=>o});var n=r(3286),i=r(3587);class o{constructor(e){(0,i.defineReadOnly)(this,"alphabet",e),(0,i.defineReadOnly)(this,"base",e.length),(0,i.defineReadOnly)(this,"_alphabetMap",{}),(0,i.defineReadOnly)(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=(0,n.arrayify)(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let i="";for(let e=0;0===t[e]&&e<t.length-1;++e)i+=this._leader;for(let e=r.length-1;e>=0;--e)i+=this.alphabet[r[e]];return i}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let e=0;e<t.length;++e)i+=t[e]*this.base,t[e]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return(0,n.arrayify)(new Uint8Array(t.reverse()))}}const s=new o("abcdefghijklmnopqrstuvwxyz234567"),a=new o("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8794:(e,t,r)=>{"use strict";r.d(t,{i:()=>n});const n="bignumber/5.7.0"},2593:(e,t,r)=>{"use strict";r.d(t,{O$:()=>p,Zm:()=>f,g$:()=>b,t2:()=>w});var n=r(3550),i=r.n(n),o=r(3286),s=r(711),a=r(8794),u=i().BN;const l=new s.Logger(a.i),c={},h=9007199254740991;function f(e){return null!=e&&(p.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||(0,o.isHexString)(e)||"bigint"==typeof e||(0,o.isBytes)(e))}let d=!1;class p{constructor(e,t){e!==c&&l.throwError("cannot call constructor directly; use BigNumber.from",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return y(g(this).fromTwos(e))}toTwos(e){return y(g(this).toTwos(e))}abs(){return"-"===this._hex[0]?p.from(this._hex.substring(1)):this}add(e){return y(g(this).add(g(e)))}sub(e){return y(g(this).sub(g(e)))}div(e){return p.from(e).isZero()&&v("division-by-zero","div"),y(g(this).div(g(e)))}mul(e){return y(g(this).mul(g(e)))}mod(e){const t=g(e);return t.isNeg()&&v("division-by-zero","mod"),y(g(this).umod(t))}pow(e){const t=g(e);return t.isNeg()&&v("negative-power","pow"),y(g(this).pow(t))}and(e){const t=g(e);return(this.isNegative()||t.isNeg())&&v("unbound-bitwise-result","and"),y(g(this).and(t))}or(e){const t=g(e);return(this.isNegative()||t.isNeg())&&v("unbound-bitwise-result","or"),y(g(this).or(t))}xor(e){const t=g(e);return(this.isNegative()||t.isNeg())&&v("unbound-bitwise-result","xor"),y(g(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&v("negative-width","mask"),y(g(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&v("negative-width","shl"),y(g(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&v("negative-width","shr"),y(g(this).shrn(e))}eq(e){return g(this).eq(g(e))}lt(e){return g(this).lt(g(e))}lte(e){return g(this).lte(g(e))}gt(e){return g(this).gt(g(e))}gte(e){return g(this).gte(g(e))}isNegative(){return"-"===this._hex[0]}isZero(){return g(this).isZero()}toNumber(){try{return g(this).toNumber()}catch(e){v("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return l.throwError("this platform does not support BigInt",s.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?d||(d=!0,l.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?l.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):l.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof p)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new p(c,m(e)):e.match(/^-?[0-9]+$/)?new p(c,m(new u(e))):l.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&v("underflow","BigNumber.from",e),(e>=h||e<=-h)&&v("overflow","BigNumber.from",e),p.from(String(e));const t=e;if("bigint"==typeof t)return p.from(t.toString());if((0,o.isBytes)(t))return p.from((0,o.hexlify)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return p.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&((0,o.isHexString)(e)||"-"===e[0]&&(0,o.isHexString)(e.substring(1))))return p.from(e)}return l.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function m(e){if("string"!=typeof e)return m(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&l.throwArgumentError("invalid hex","value",e),"0x00"===(e=m(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function y(e){return p.from(m(e))}function g(e){const t=p.from(e).toHexString();return"-"===t[0]?new u("-"+t.substring(3),16):new u(t.substring(2),16)}function v(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),l.throwError(e,s.Logger.errors.NUMERIC_FAULT,n)}function b(e){return new u(e,36).toString(16)}function w(e){return new u(e,16).toString(36)}},335:(e,t,r)=>{"use strict";r.d(t,{Ox:()=>m,S5:()=>p,xs:()=>g});var n=r(3286),i=r(711),o=r(8794),s=r(2593);const a=new i.Logger(o.i),u={},l=s.O$.from(0),c=s.O$.from(-1);function h(e,t,r,n){const o={fault:t,operation:r};return void 0!==n&&(o.value=n),a.throwError(e,i.Logger.errors.NUMERIC_FAULT,o)}let f="0";for(;f.length<256;)f+=f;function d(e){if("number"!=typeof e)try{e=s.O$.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+f.substring(0,e):a.throwArgumentError("invalid decimal size","decimals",e)}function p(e,t){null==t&&(t=0);const r=d(t),n=(e=s.O$.from(e)).lt(l);n&&(e=e.mul(c));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=e.div(r).toString();return e=1===r.length?o:o+"."+i,n&&(e="-"+e),e}function m(e,t){null==t&&(t=0);const r=d(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||a.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&a.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&a.throwArgumentError("too many decimal points","value",e);let o=i[0],u=i[1];for(o||(o="0"),u||(u="0");"0"===u[u.length-1];)u=u.substring(0,u.length-1);for(u.length>r.length-1&&h("fractional component exceeds decimals","underflow","parseFixed"),""===u&&(u="0");u.length<r.length-1;)u+="0";const l=s.O$.from(o),f=s.O$.from(u);let p=l.mul(r).add(f);return n&&(p=p.mul(c)),p}class y{constructor(e,t,r,n){e!==u&&a.throwError("cannot use FixedFormat constructor; use FixedFormat.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=d(n),Object.freeze(this)}static from(e){if(e instanceof y)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||a.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&a.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new y(u,t,r,n)}}class g{constructor(e,t,r,n){e!==u&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return g.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return g.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return g.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return g.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=g.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(v.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=g.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(v.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&a.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=g.from("1"+f.substring(0,e),this.format),n=b.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&a.throwArgumentError("invalid byte width","width",e);const t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,n.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return g.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||(0,s.Zm)(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),g.fromString(p(e,t),y.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=y.from(t),i=m(e,r.decimals);!r.signed&&i.lt(l)&&h("unsigned value cannot be negative","overflow","value",e);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=(0,n.hexZeroPad)(o,r.width/8));const s=p(i,r.decimals);return new g(u,o,s,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=y.from(t);if((0,n.arrayify)(e).length>r.width/8)throw new Error("overflow");let i=s.O$.from(e);r.signed&&(i=i.fromTwos(r.width));const o=i.toTwos((r.signed?0:1)+r.width).toHexString(),a=p(i,r.decimals);return new g(u,o,a,r)}static from(e,t){if("string"==typeof e)return g.fromString(e,t);if((0,n.isBytes)(e))return g.fromBytes(e,t);try{return g.fromValue(e,0,t)}catch(e){if(e.code!==i.Logger.errors.INVALID_ARGUMENT)throw e}return a.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const v=g.from(1),b=g.from("0.5")},3286:(e,t,r)=>{"use strict";r.r(t),r.d(t,{arrayify:()=>l,concat:()=>c,hexConcat:()=>v,hexDataLength:()=>y,hexDataSlice:()=>g,hexStripZeros:()=>w,hexValue:()=>b,hexZeroPad:()=>A,hexlify:()=>m,isBytes:()=>u,isBytesLike:()=>s,isHexString:()=>d,joinSignature:()=>T,splitSignature:()=>E,stripZeros:()=>h,zeroPad:()=>f});const n=new(r(711).Logger)("bytes/5.7.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function s(e){return d(e)&&!(e.length%2)||u(e)}function a(e){return"number"==typeof e&&e==e&&e%1==0}function u(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!a(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!a(r)||r<0||r>=256)return!1}return!0}function l(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),o(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),d(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let e=0;e<r.length;e+=2)i.push(parseInt(r.substring(e,e+2),16));return o(new Uint8Array(i))}return u(e)?o(new Uint8Array(e)):n.throwArgumentError("invalid arrayify value","value",e)}function c(e){const t=e.map((e=>l(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),o(n)}function h(e){let t=l(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function f(e,t){(e=l(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),o(r)}function d(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const p="0123456789abcdef";function m(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=p[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(d(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(u(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=p[(240&n)>>4]+p[15&n]}return t}return n.throwArgumentError("invalid hexlify value","value",e)}function y(e){if("string"!=typeof e)e=m(e);else if(!d(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,r){return"string"!=typeof e?e=m(e):(!d(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function v(e){let t="0x";return e.forEach((e=>{t+=m(e).substring(2)})),t}function b(e){const t=w(m(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!=typeof e&&(e=m(e)),d(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function A(e,t){for("string"!=typeof e?e=m(e):d(e)||n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function E(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(s(e)){let r=l(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=m(r.slice(0,32)),t.s=m(r.slice(32,64))):65===r.length?(t.r=m(r.slice(0,32)),t.s=m(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=m(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=f(l(t._vs),32);t._vs=m(r);const i=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const o=m(r);null==t.s?t.s=o:t.s!==o&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&d(t.r)?t.r=A(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&d(t.s)?t.s=A(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);const r=l(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const i=m(r);t._vs&&(d(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=A(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function T(e){return m(c([(e=E(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},9279:(e,t,r)=>{"use strict";r.d(t,{d:()=>n});const n="0x0000000000000000000000000000000000000000"},1046:(e,t,r)=>{"use strict";r.d(t,{$B:()=>c,Bz:()=>l,Ce:()=>u,PS:()=>h,Py:()=>a,_Y:()=>o,fh:()=>s,tL:()=>i});var n=r(2593);const i=n.O$.from(-1),o=n.O$.from(0),s=n.O$.from(1),a=n.O$.from(2),u=n.O$.from("1000000000000000000"),l=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),c=n.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),h=n.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},7218:(e,t,r)=>{"use strict";r.d(t,{R:()=>n});const n="0x0000000000000000000000000000000000000000000000000000000000000000"},5644:(e,t,r)=>{"use strict";r.d(t,{i:()=>n});const n="hash/5.7.0"},2046:(e,t,r)=>{"use strict";r.d(t,{id:()=>o});var n=r(8197),i=r(4242);function o(e){return(0,n.keccak256)((0,i.Y0)(e))}},5931:(e,t,r)=>{"use strict";r.r(t),r.d(t,{_TypedDataEncoder:()=>s.E,dnsEncode:()=>i.Kn,ensNormalize:()=>i.w3,hashMessage:()=>o.r,id:()=>n.id,isValidName:()=>i.r1,messagePrefix:()=>o.B,namehash:()=>i.VM});var n=r(2046),i=r(8339),o=r(3684),s=r(7827)},3684:(e,t,r)=>{"use strict";r.d(t,{B:()=>s,r:()=>a});var n=r(3286),i=r(8197),o=r(4242);const s="Ethereum Signed Message:\n";function a(e){return"string"==typeof e&&(e=(0,o.Y0)(e)),(0,i.keccak256)((0,n.concat)([(0,o.Y0)(s),(0,o.Y0)(String(e.length)),e]))}},8339:(e,t,r)=>{"use strict";r.d(t,{Kn:()=>M,w3:()=>P,r1:()=>B,VM:()=>R});var n=r(3286),i=r(4242),o=r(8197),s=r(711),a=r(5644);function u(e,t){null==t&&(t=1);const r=[],n=r.forEach,i=function(e,t){n.call(e,(function(e){t>0&&Array.isArray(e)?i(e,t-1):r.push(e)}))};return i(e,t),r}function l(e){return 1&e?~e>>1:e>>1}function c(e,t){let r=Array(e);for(let n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function h(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=l(t());return r}function f(e,t){let r=c(e(),e),n=e(),i=c(n,e),o=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<o[e];t++)r.push(i[e]+t);return t?r.map((e=>t[e])):r}function d(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;i<t;i++)h(e,r).forEach(((e,t)=>n[t].push(e)));return n}function p(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return u(d(i.length,1+e,t).map(((e,t)=>{const o=e[0],s=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,s.map((e=>e+i))]}))})))}function m(e,t){return d(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const y=function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e<n;e++)o.push(i+=r());let s=r(),a=t;t+=s;let u=0,l=0;function c(){return 0==u&&(l=l<<8|e[t++],u=8),l>>--u&1}const h=Math.pow(2,31),f=h>>>1,d=f>>1,p=h-1;let m=0;for(let e=0;e<31;e++)m=m<<1|c();let y=[],g=0,v=h;for(;;){let e=Math.floor(((m-g+1)*i-1)/v),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<o[n]?r=n:t=n}if(0==t)break;y.push(t);let s=g+Math.floor(v*o[t]/i),a=g+Math.floor(v*o[t+1]/i)-1;for(;0==((s^a)&f);)m=m<<1&p|c(),s=s<<1&p,a=a<<1&p|1;for(;s&~a&d;)m=m&f|m<<1&p>>>1|c(),s=s<<1^f,a=(a^f)<<1|f|1;g=s,v=1+a-s}let b=n-4;return y.map((t=>{switch(t-b){case 3:return b+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return b+256+(e[a++]<<8|e[a++]);case 1:return b+e[a++];default:return t-1}}))}((0,r(9567).J)("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=="))),g=new Set(f(y)),v=new Set(f(y)),b=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(p(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(m(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}(u(t))}(y),w=function(e){let t=f(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let i=f(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let s=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:s,save:1==i,check:2==i}}()}(y),A=45,E=95;function T(e){return(0,i.XL)(e)}function _(e){return e.filter((e=>65039!=e))}function k(e){for(let t of e.split(".")){let e=T(t);try{for(let t=e.lastIndexOf(E)-1;t>=0;t--)if(e[t]!==E)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===A&&e[3]===A)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function S(e,t){var r;let n,i,o=w,s=[],a=e.length;for(t&&(t.length=0);a;){let u=e[--a];if(o=null===(r=o.branches.find((e=>e.set.has(u))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=u;else if(o.check&&u===i)break;s.push(u),o.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),o.valid&&(n=s.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return n}const O=new s.Logger(a.i),x=new Uint8Array(32);function C(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function I(e){const t=(0,i.Y0)(function(e){return k(function(e,t){let r=T(e).reverse(),n=[];for(;r.length;){let e=S(r);if(e){n.push(...t(e));continue}let i=r.pop();if(g.has(i)){n.push(i);continue}if(v.has(i))continue;let o=b[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return k(String.fromCodePoint(...n).normalize("NFC"))}(e,_))}(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++)46===t[e]&&(r.push(C(t.slice(n,e))),n=e+1);if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(C(t.slice(n))),r}function P(e){return I(e).map((e=>(0,i.ZN)(e))).join(".")}function B(e){try{return 0!==I(e).length}catch(e){}return!1}function R(e){"string"!=typeof e&&O.throwArgumentError("invalid ENS name; not a string","name",e);let t=x;const r=I(e);for(;r.length;)t=(0,o.keccak256)((0,n.concat)([t,(0,o.keccak256)(r.pop())]));return(0,n.hexlify)(t)}function M(e){return(0,n.hexlify)((0,n.concat)(I(e).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"}x.fill(0)},7827:(e,t,r)=>{"use strict";r.d(t,{E:()=>k});var n=r(4594),i=r(2593),o=r(3286),s=r(8197),a=r(3587),u=r(711),l=r(5644),c=r(2046);const h=new u.Logger(l.i),f=new Uint8Array(32);f.fill(0);const d=i.O$.from(-1),p=i.O$.from(0),m=i.O$.from(1),y=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),g=(0,o.hexZeroPad)(m.toHexString(),32),v=(0,o.hexZeroPad)(p.toHexString(),32),b={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},w=["name","version","chainId","verifyingContract","salt"];function A(e){return function(t){return"string"!=typeof t&&h.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const E={name:A("name"),version:A("version"),chainId:function(e){try{return i.O$.from(e).toString()}catch(e){}return h.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,n.getAddress)(e).toLowerCase()}catch(e){}return h.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=(0,o.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,o.hexlify)(t)}catch(e){}return h.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function T(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&h.throwArgumentError("invalid numeric width","type",e);const s=y.mask(r?n-1:n),a=r?s.add(m).mul(d):p;return function(t){const r=i.O$.from(t);return(r.lt(a)||r.gt(s))&&h.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,o.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&h.throwArgumentError("invalid bytes width","type",e),function(t){return(0,o.arrayify)(t).length!==r&&h.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=(0,o.arrayify)(e),r=t.length%32;return r?(0,o.hexConcat)([t,f.slice(r)]):(0,o.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,o.hexZeroPad)((0,n.getAddress)(e),32)};case"bool":return function(e){return e?g:v};case"bytes":return function(e){return(0,s.keccak256)(e)};case"string":return function(e){return(0,c.id)(e)}}return null}function _(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class k{constructor(e){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(e))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const i={};e[n].forEach((o=>{i[o.name]&&h.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&h.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e),T(s)||(r[s]||h.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(n),t[n][s]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?h.throwArgumentError("missing primary type","types",e):i.length>1&&h.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,a.defineReadOnly)(this,"primaryType",i[0]),function i(o,s){s[o]&&h.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),s[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,s),Object.keys(s).forEach((t=>{n[t][e]=!0})))})),delete s[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=_(t,e[t])+r.map((t=>_(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=T(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(s.keccak256)),(0,s.keccak256)((0,o.hexConcat)(i))}}const r=this.types[e];if(r){const t=(0,c.id)(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?(0,s.keccak256)(n):n}));return n.unshift(t),(0,o.hexConcat)(n)}}return h.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||h.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,s.keccak256)(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(T(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):h.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new k(e)}static getPrimaryType(e){return k.from(e).primaryType}static hashStruct(e,t,r){return k.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=b[r];n||h.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>w.indexOf(e.name)-w.indexOf(t.name))),k.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,o.hexConcat)(["0x1901",k.hashDomain(e),k.from(t).hash(r)])}static hash(e,t,r){return(0,s.keccak256)(k.encode(e,t,r))}static resolveNames(e,t,r,n){return i=this,s=void 0,l=function*(){e=(0,a.shallowCopy)(e);const i={};e.verifyingContract&&!(0,o.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const s=k.from(t);s.visit(r,((e,t)=>("address"!==e||(0,o.isHexString)(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=s.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}},new((u=void 0)||(u=Promise))((function(e,t){function r(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var i;t.done?e(t.value):(i=t.value,i instanceof u?i:new u((function(e){e(i)}))).then(r,n)}o((l=l.apply(i,s||[])).next())}));var i,s,u,l}static getPayload(e,t,r){k.hashDomain(e);const n={},s=[];w.forEach((t=>{const r=e[t];null!=r&&(n[t]=E[t](r),s.push({name:t,type:b[t]}))}));const u=k.from(t),l=(0,a.shallowCopy)(t);return l.EIP712Domain?h.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):l.EIP712Domain=s,u.encode(r),{types:l,domain:n,primaryType:u.primaryType,message:u.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.arrayify)(t));if(e.match(/^u?int/))return i.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&h.throwArgumentError("invalid string","value",t),t}return h.throwArgumentError("unsupported type","type",e)}))}}}},6274:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HDNode:()=>_,defaultPath:()=>T,entropyToMnemonic:()=>O,getAccountPath:()=>C,isValidMnemonic:()=>x,mnemonicToEntropy:()=>S,mnemonicToSeed:()=>k});var n=r(7727),i=r(3286),o=r(2593),s=r(4242),a=r(5306),u=r(3587),l=r(2768),c=r(3951),h=r(1261),f=r(4377),d=r(9855);const p=new(r(711).Logger)("hdnode/5.7.0"),m=o.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y=(0,s.Y0)("Bitcoin seed"),g=2147483648;function v(e){return(1<<e)-1<<8-e}function b(e){return(0,i.hexZeroPad)((0,i.hexlify)(e),32)}function w(e){return n.Base58.encode((0,i.concat)([e,(0,i.hexDataSlice)((0,c.JQ)((0,c.JQ)(e)),0,4)]))}function A(e){if(null==e)return d.E.en;if("string"==typeof e){const t=d.E[e];return null==t&&p.throwArgumentError("unknown locale","wordlist",e),t}return e}const E={},T="m/44'/60'/0'/0/0";class _{constructor(e,t,r,n,o,s,a,h){if(e!==E)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new l.SigningKey(t);(0,u.defineReadOnly)(this,"privateKey",e.privateKey),(0,u.defineReadOnly)(this,"publicKey",e.compressedPublicKey)}else(0,u.defineReadOnly)(this,"privateKey",null),(0,u.defineReadOnly)(this,"publicKey",(0,i.hexlify)(r));(0,u.defineReadOnly)(this,"parentFingerprint",n),(0,u.defineReadOnly)(this,"fingerprint",(0,i.hexDataSlice)((0,c.bP)((0,c.JQ)(this.publicKey)),0,4)),(0,u.defineReadOnly)(this,"address",(0,f.computeAddress)(this.publicKey)),(0,u.defineReadOnly)(this,"chainCode",o),(0,u.defineReadOnly)(this,"index",s),(0,u.defineReadOnly)(this,"depth",a),null==h?((0,u.defineReadOnly)(this,"mnemonic",null),(0,u.defineReadOnly)(this,"path",null)):"string"==typeof h?((0,u.defineReadOnly)(this,"mnemonic",null),(0,u.defineReadOnly)(this,"path",h)):((0,u.defineReadOnly)(this,"mnemonic",h),(0,u.defineReadOnly)(this,"path",h.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return w((0,i.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,i.hexlify)(this.depth),this.parentFingerprint,(0,i.hexZeroPad)((0,i.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,i.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new _(E,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&~g));const r=new Uint8Array(37);if(e&g){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,i.arrayify)(this.privateKey),1),t&&(t+="'")}else r.set((0,i.arrayify)(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=(0,i.arrayify)((0,c.Gy)(h.p.sha512,this.chainCode,r)),s=n.slice(0,32),a=n.slice(32);let u=null,f=null;this.privateKey?u=b(o.O$.from(s).add(this.privateKey).mod(m)):f=new l.SigningKey((0,i.hexlify)(s))._addPoint(this.publicKey);let d=t;const p=this.mnemonic;return p&&(d=Object.freeze({phrase:p.phrase,path:t,locale:p.locale||"en"})),new _(E,u,f,this.fingerprint,b(a),e,this.depth+1,d)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e<t.length;e++){const n=t[e];if(n.match(/^[0-9]+'$/)){const e=parseInt(n.substring(0,n.length-1));if(e>=g)throw new Error("invalid path index - "+n);r=r._derive(g+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=g)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=(0,i.arrayify)(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=(0,i.arrayify)((0,c.Gy)(h.p.sha512,y,r));return new _(E,b(n.slice(0,32)),null,"0x00000000",b(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=O(S(e,r=A(r)),r),_._fromSeed(k(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return _._fromSeed(e,null)}static fromExtendedKey(e){const t=n.Base58.decode(e);82===t.length&&w(t.slice(0,78))===e||p.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],o=(0,i.hexlify)(t.slice(5,9)),s=parseInt((0,i.hexlify)(t.slice(9,13)).substring(2),16),a=(0,i.hexlify)(t.slice(13,45)),u=t.slice(45,78);switch((0,i.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new _(E,null,(0,i.hexlify)(u),o,a,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new _(E,(0,i.hexlify)(u.slice(1)),null,o,a,s,r,null)}return p.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function k(e,t){t||(t="");const r=(0,s.Y0)("mnemonic"+t,s.Uj.NFKD);return(0,a.n)((0,s.Y0)(e,s.Uj.NFKD),r,2048,64,"sha512")}function S(e,t){t=A(t),p.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=(0,i.arrayify)(new Uint8Array(Math.ceil(11*r.length/8)));let o=0;for(let e=0;e<r.length;e++){let i=t.getWordIndex(r[e].normalize("NFKD"));if(-1===i)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)i&1<<10-e&&(n[o>>3]|=1<<7-o%8),o++}const s=32*r.length/3,a=v(r.length/3);if(((0,i.arrayify)((0,c.JQ)(n.slice(0,s/8)))[0]&a)!=(n[n.length-1]&a))throw new Error("invalid checksum");return(0,i.hexlify)(n.slice(0,s/8))}function O(e,t){if(t=A(t),(e=(0,i.arrayify)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t<e.length;t++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const o=e.length/4,s=(0,i.arrayify)((0,c.JQ)(e))[0]&v(o);return r[r.length-1]<<=o,r[r.length-1]|=s>>8-o,t.join(r.map((e=>t.getWord(e))))}function x(e,t){try{return S(e,t),!0}catch(e){}return!1}function C(e){return("number"!=typeof e||e<0||e>=g||e%1)&&p.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}},9816:(e,t,r)=>{"use strict";r.d(t,{i:()=>n});const n="json-wallets/5.7.0"},9380:(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptCrowdsale:()=>y,decryptJsonWallet:()=>b,decryptJsonWalletSync:()=>w,decryptKeystore:()=>v.pe,decryptKeystoreSync:()=>v.hb,encryptKeystore:()=>v.HI,getJsonWalletAddress:()=>g.Rb,isCrowdsaleWallet:()=>g.LW,isKeystoreWallet:()=>g.aO});var n=r(8709),i=r.n(n),o=r(4594),s=r(3286),a=r(8197),u=r(5306),l=r(4242),c=r(3587),h=r(711),f=r(9816),d=r(5199);const p=new h.Logger(f.i);class m extends c.Description{isCrowdsaleAccount(e){return!(!e||!e._isCrowdsaleAccount)}}function y(e,t){const r=JSON.parse(e);t=(0,d.Ij)(t);const n=(0,o.getAddress)((0,d.gx)(r,"ethaddr")),c=(0,d.p3)((0,d.gx)(r,"encseed"));c&&c.length%16==0||p.throwArgumentError("invalid encseed","json",e);const h=(0,s.arrayify)((0,u.n)(t,t,2e3,32,"sha256")).slice(0,16),f=c.slice(0,16),y=c.slice(16),g=new(i().ModeOfOperation.cbc)(h,f),v=i().padding.pkcs7.strip((0,s.arrayify)(g.decrypt(y)));let b="";for(let e=0;e<v.length;e++)b+=String.fromCharCode(v[e]);const w=(0,l.Y0)(b),A=(0,a.keccak256)(w);return new m({_isCrowdsaleAccount:!0,address:n,privateKey:A})}var g=r(7949),v=r(1964);function b(e,t,r){if((0,g.LW)(e)){r&&r(0);const n=y(e,t);return r&&r(1),Promise.resolve(n)}return(0,g.aO)(e)?(0,v.pe)(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function w(e,t){if((0,g.LW)(e))return y(e,t);if((0,g.aO)(e))return(0,v.hb)(e,t);throw new Error("invalid JSON wallet")}},7949:(e,t,r)=>{"use strict";r.d(t,{LW:()=>i,Rb:()=>s,aO:()=>o});var n=r(4594);function i(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function o(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function s(e){if(i(e))try{return(0,n.getAddress)(JSON.parse(e).ethaddr)}catch(e){return null}if(o(e))try{return(0,n.getAddress)(JSON.parse(e).address)}catch(e){return null}return null}},1964:(e,t,r)=>{"use strict";r.d(t,{HI:()=>x,hb:()=>S,pe:()=>O});var n=r(8709),i=r.n(n),o=r(7635),s=r.n(o),a=r(4594),u=r(3286),l=r(6274),c=r(8197),h=r(5306),f=r(4478),d=r(3587),p=r(4377),m=r(5199),y=r(711),g=r(9816),v=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const b=new y.Logger(g.i);function w(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class A extends d.Description{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function E(e,t){const r=(0,m.p3)((0,m.gx)(e,"crypto/ciphertext"));if((0,u.hexlify)((0,c.keccak256)((0,u.concat)([t.slice(16,32),r]))).substring(2)!==(0,m.gx)(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===(0,m.gx)(e,"crypto/cipher")){const n=(0,m.p3)((0,m.gx)(e,"crypto/cipherparams/iv")),o=new(i().Counter)(n),s=new(i().ModeOfOperation.ctr)(t,o);return(0,u.arrayify)(s.decrypt(r))}return null}(e,t.slice(0,16),r);n||b.throwError("unsupported cipher",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const o=t.slice(32,64),s=(0,p.computeAddress)(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),(0,a.getAddress)(t)!==s)throw new Error("address mismatch")}const h={_isKeystoreAccount:!0,address:s,privateKey:(0,u.hexlify)(n)};if("0.1"===(0,m.gx)(e,"x-ethers/version")){const t=(0,m.p3)((0,m.gx)(e,"x-ethers/mnemonicCiphertext")),r=(0,m.p3)((0,m.gx)(e,"x-ethers/mnemonicCounter")),n=new(i().Counter)(r),s=new(i().ModeOfOperation.ctr)(o,n),a=(0,m.gx)(e,"x-ethers/path")||l.defaultPath,c=(0,m.gx)(e,"x-ethers/locale")||"en",f=(0,u.arrayify)(s.decrypt(t));try{const e=(0,l.entropyToMnemonic)(f,c),t=l.HDNode.fromMnemonic(e,null,c).derivePath(a);if(t.privateKey!=h.privateKey)throw new Error("mnemonic mismatch");h.mnemonic=t.mnemonic}catch(e){if(e.code!==y.Logger.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new A(h)}function T(e,t,r,n,i){return(0,u.arrayify)((0,h.n)(e,t,r,n,i))}function _(e,t,r,n,i){return Promise.resolve(T(e,t,r,n,i))}function k(e,t,r,n,i){const o=(0,m.Ij)(t),s=(0,m.gx)(e,"crypto/kdf");if(s&&"string"==typeof s){const t=function(e,t){return b.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===s.toLowerCase()){const r=(0,m.p3)((0,m.gx)(e,"crypto/kdfparams/salt")),a=parseInt((0,m.gx)(e,"crypto/kdfparams/n")),u=parseInt((0,m.gx)(e,"crypto/kdfparams/r")),l=parseInt((0,m.gx)(e,"crypto/kdfparams/p"));a&&u&&l||t("kdf",s),0!=(a&a-1)&&t("N",a);const c=parseInt((0,m.gx)(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),n(o,r,a,u,l,64,i)}if("pbkdf2"===s.toLowerCase()){const n=(0,m.p3)((0,m.gx)(e,"crypto/kdfparams/salt"));let i=null;const s=(0,m.gx)(e,"crypto/kdfparams/prf");"hmac-sha256"===s?i="sha256":"hmac-sha512"===s?i="sha512":t("prf",s);const a=parseInt((0,m.gx)(e,"crypto/kdfparams/c")),u=parseInt((0,m.gx)(e,"crypto/kdfparams/dklen"));return 32!==u&&t("dklen",u),r(o,n,a,u,i)}}return b.throwArgumentError("unsupported key-derivation function","kdf",s)}function S(e,t){const r=JSON.parse(e);return E(r,k(r,t,T,s().syncScrypt))}function O(e,t,r){return v(this,void 0,void 0,(function*(){const n=JSON.parse(e);return E(n,yield k(n,t,_,s().scrypt,r))}))}function x(e,t,r,n){try{if((0,a.getAddress)(e.address)!==(0,p.computeAddress)(e.privateKey))throw new Error("address/privateKey mismatch");if(w(e)){const t=e.mnemonic;if(l.HDNode.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||l.defaultPath).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const o=(0,u.arrayify)(e.privateKey),h=(0,m.Ij)(t);let d=null,y=null,g=null;if(w(e)){const t=e.mnemonic;d=(0,u.arrayify)((0,l.mnemonicToEntropy)(t.phrase,t.locale||"en")),y=t.path||l.defaultPath,g=t.locale||"en"}let v=r.client;v||(v="ethers.js");let b=null;b=r.salt?(0,u.arrayify)(r.salt):(0,f.O)(32);let A=null;if(r.iv){if(A=(0,u.arrayify)(r.iv),16!==A.length)throw new Error("invalid iv")}else A=(0,f.O)(16);let E=null;if(r.uuid){if(E=(0,u.arrayify)(r.uuid),16!==E.length)throw new Error("invalid uuid")}else E=(0,f.O)(16);let T=1<<17,_=8,k=1;return r.scrypt&&(r.scrypt.N&&(T=r.scrypt.N),r.scrypt.r&&(_=r.scrypt.r),r.scrypt.p&&(k=r.scrypt.p)),s().scrypt(h,b,T,_,k,64,n).then((t=>{const r=(t=(0,u.arrayify)(t)).slice(0,16),n=t.slice(16,32),s=t.slice(32,64),a=new(i().Counter)(A),l=new(i().ModeOfOperation.ctr)(r,a),h=(0,u.arrayify)(l.encrypt(o)),p=(0,c.keccak256)((0,u.concat)([n,h])),w={address:e.address.substring(2).toLowerCase(),id:(0,m.EH)(E),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,u.hexlify)(A).substring(2)},ciphertext:(0,u.hexlify)(h).substring(2),kdf:"scrypt",kdfparams:{salt:(0,u.hexlify)(b).substring(2),n:T,dklen:32,p:k,r:_},mac:p.substring(2)}};if(d){const e=(0,f.O)(16),t=new(i().Counter)(e),r=new(i().ModeOfOperation.ctr)(s,t),n=(0,u.arrayify)(r.encrypt(d)),o=new Date,a=o.getUTCFullYear()+"-"+(0,m.VP)(o.getUTCMonth()+1,2)+"-"+(0,m.VP)(o.getUTCDate(),2)+"T"+(0,m.VP)(o.getUTCHours(),2)+"-"+(0,m.VP)(o.getUTCMinutes(),2)+"-"+(0,m.VP)(o.getUTCSeconds(),2)+".0Z";w["x-ethers"]={client:v,gethFilename:"UTC--"+a+"--"+w.address,mnemonicCounter:(0,u.hexlify)(e).substring(2),mnemonicCiphertext:(0,u.hexlify)(n).substring(2),path:y,locale:g,version:"0.1"}}return JSON.stringify(w)}))}},5199:(e,t,r)=>{"use strict";r.d(t,{EH:()=>l,Ij:()=>a,VP:()=>s,gx:()=>u,p3:()=>o});var n=r(3286),i=r(4242);function o(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,n.arrayify)(e)}function s(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function a(e){return"string"==typeof e?(0,i.Y0)(e,i.Uj.NFKC):(0,n.arrayify)(e)}function u(e,t){let r=e;const n=t.toLowerCase().split("/");for(let e=0;e<n.length;e++){let t=null;for(const i in r)if(i.toLowerCase()===n[e]){t=r[i];break}if(null===t)return null;r=t}return r}function l(e){const t=(0,n.arrayify)(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=(0,n.hexlify)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}},8709:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function s(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var a,u={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return i(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},l=(a="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(a[(240&n)>>4]+a[15&n])}return t.join("")}}),c={16:10,24:12,32:14},h=[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],f=[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],d=[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],p=[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],m=[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],y=[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],g=[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],v=[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],b=[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],w=[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],A=[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],E=[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],T=[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],_=[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],k=[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 S(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var O=function(e){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};O.prototype._prepare=function(){var e=c[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),i=this.key.length/4,o=S(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var s,a=0,u=i;u<n;){if(s=o[i-1],o[0]^=f[s>>16&255]<<24^f[s>>8&255]<<16^f[255&s]<<8^f[s>>24&255]^h[a]<<24,a+=1,8!=i)for(t=1;t<i;t++)o[t]^=o[t-1];else{for(t=1;t<i/2;t++)o[t]^=o[t-1];for(s=o[i/2-1],o[i/2]^=f[255&s]^f[s>>8&255]<<8^f[s>>16&255]<<16^f[s>>24&255]<<24,t=i/2+1;t<i;t++)o[t]^=o[t-1]}for(t=0;t<i&&u<n;)l=u>>2,d=u%4,this._Ke[l][d]=o[t],this._Kd[e-l][d]=o[t++],u++}for(var l=1;l<e;l++)for(var d=0;d<4;d++)s=this._Kd[l][d],this._Kd[l][d]=E[s>>24&255]^T[s>>16&255]^_[s>>8&255]^k[255&s]},O.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=S(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s<t;s++){for(i=0;i<4;i++)r[i]=p[n[i]>>24&255]^m[n[(i+1)%4]>>16&255]^y[n[(i+2)%4]>>8&255]^g[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}var a,u=o(16);for(i=0;i<4;i++)a=this._Ke[t][i],u[4*i]=255&(f[n[i]>>24&255]^a>>24),u[4*i+1]=255&(f[n[(i+1)%4]>>16&255]^a>>16),u[4*i+2]=255&(f[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(f[255&n[(i+3)%4]]^a);return u},O.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=S(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s<t;s++){for(i=0;i<4;i++)r[i]=v[n[i]>>24&255]^b[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^A[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}var a,u=o(16);for(i=0;i<4;i++)a=this._Kd[t][i],u[4*i]=255&(d[n[i]>>24&255]^a>>24),u[4*i+1]=255&(d[n[(i+3)%4]>>16&255]^a>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(d[255&n[(i+1)%4]]^a);return u};var x=function(e){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new O(e)};x.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.encrypt(r),t,n);return t},x.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.decrypt(r),t,n);return t};var C=function(e,t){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=o(16);this._lastCipherblock=i(t,!0),this._aes=new O(e)};C.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16);for(var a=0;a<16;a++)r[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(r),s(this._lastCipherblock,t,n)}return t},C.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var a=0;a<16;a++)t[n+a]=r[a]^this._lastCipherblock[a];s(e,this._lastCipherblock,0,n,n+16)}return t};var I=function(e,t,r){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=o(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(t,!0),this._aes=new O(e)};I.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)r[n+o]^=t[o];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},I.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)r[n+o]^=t[o];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var P=function(e,t){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=o(16);this._lastPrecipher=i(t,!0),this._lastPrecipherIndex=16,this._aes=new O(e)};P.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},P.prototype.decrypt=P.prototype.encrypt;var B=function(e){if(!(this instanceof B))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=o(16),this.setValue(e)):this.setBytes(e)};B.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");for(var t=15;t>=0;--t)this._counter[t]=e%256,e>>=8},B.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},B.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function(e,t){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof B||(t=new B(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new O(e)};R.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},R.prototype.decrypt=R.prototype.encrypt;var M={AES:O,Counter:B,ModeOfOperation:{ecb:x,cbc:C,cfb:I,ofb:P,ctr:R},utils:{hex:l,utf8:u},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=o(e.length+t);s(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=i(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var a=o(r);return s(e,a,0,0,r),a}}},_arrayTest:{coerceArray:i,createArray:o,copyArray:s}};e.exports=M}()},8197:(e,t,r)=>{"use strict";r.r(t),r.d(t,{keccak256:()=>s});var n=r(1094),i=r.n(n),o=r(3286);function s(e){return"0x"+i().keccak_256((0,o.arrayify)(e))}},711:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ErrorCode:()=>c,LogLevel:()=>l,Logger:()=>f});let n=!1,i=!1;const o={debug:1,default:2,info:2,warning:3,error:4,off:5};let s=o.default,a=null;const u=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var l,c;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(l||(l={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(c||(c={}));const h="0123456789abcdef";class f{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==o[r]&&this.throwArgumentError("invalid log level name","logLevel",e),s>o[r]||console.log.apply(console,t)}debug(...e){this._log(f.levels.DEBUG,e)}info(...e){this._log(f.levels.INFO,e)}warn(...e){this._log(f.levels.WARNING,e)}makeError(e,t,r){if(i)return this.makeError("censored error",t,{});t||(t=f.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=h[t[e]>>4],r+=h[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const o=e;let s="";switch(t){case c.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case c.CALL_EXCEPTION:case c.INSUFFICIENT_FUNDS:case c.MISSING_NEW:case c.NONCE_EXPIRED:case c.REPLACEMENT_UNDERPRICED:case c.TRANSACTION_REPLACED:case c.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,f.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),u&&this.throwError("platform missing String.prototype.normalize",f.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:u})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,f.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,f.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",f.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",f.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",f.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return a||(a=new f("logger/5.7.0")),a}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!e)return;this.globalLogger().throwError("error censorship permanent",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!e,n=!!t}static setLogLevel(e){const t=o[e.toLowerCase()];null!=t?s=t:f.globalLogger().warn("invalid log level - "+e)}static from(e){return new f(e)}}f.errors=c,f.levels=l},9861:(e,t,r)=>{"use strict";r.d(t,{H:()=>c});const n=new(r(711).Logger)("networks/5.7.1");function i(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return i(e)},t}function o(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return o(e,t)},r}const s={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:i("homestead")},a={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:i("ropsten")},u={chainId:63,name:"classicMordor",_defaultProvider:o("https://www.ethercluster.com/mordor","classicMordor")},l={unspecified:{chainId:0,name:"unspecified"},homestead:s,mainnet:s,morden:{chainId:2,name:"morden"},ropsten:a,testnet:a,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:i("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:i("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:i("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:i("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:o("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:u,classicTestnet:u,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:o("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:i("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:i("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function c(e){if(null==e)return null;if("number"==typeof e){for(const t in l){const r=l[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=l[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=l[e.name];if(!t)return"number"!=typeof e.chainId&&n.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&n.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var i;return null==r&&t._defaultProvider&&(r=(i=t._defaultProvider)&&"function"==typeof i.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}},5306:(e,t,r)=>{"use strict";r.d(t,{n:()=>o});var n=r(3286),i=r(3951);function o(e,t,r,o,s){let a;e=(0,n.arrayify)(e),t=(0,n.arrayify)(t);let u=1;const l=new Uint8Array(o),c=new Uint8Array(t.length+4);let h,f;c.set(t);for(let d=1;d<=u;d++){c[t.length]=d>>24&255,c[t.length+1]=d>>16&255,c[t.length+2]=d>>8&255,c[t.length+3]=255&d;let p=(0,n.arrayify)((0,i.Gy)(s,e,c));a||(a=p.length,f=new Uint8Array(a),u=Math.ceil(o/a),h=o-(u-1)*a),f.set(p);for(let t=1;t<r;t++){p=(0,n.arrayify)((0,i.Gy)(s,e,p));for(let e=0;e<a;e++)f[e]^=p[e]}const m=(d-1)*a,y=d===u?h:a;l.set((0,n.arrayify)(f).slice(0,y),m)}return(0,n.hexlify)(l)}},3587:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Description:()=>m,checkProperties:()=>l,deepCopy:()=>p,defineReadOnly:()=>s,getStatic:()=>a,resolveProperties:()=>u,shallowCopy:()=>c});var n=r(711),i=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const o=new n.Logger("properties/5.7.0");function s(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function a(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function u(e){return i(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function l(e,t){e&&"object"==typeof e||o.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||o.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function c(e){const t={};for(const r in e)t[r]=e[r];return t}const h={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function f(e){if(null==e||h[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!f(n))return!1}return!0}return o.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function d(e){if(f(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>p(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&s(t,r,p(n))}return t}return o.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function p(e){return d(e)}class m{constructor(e){for(const t in e)this[t]=p(e[t])}}},4216:(e,t,r)=>{"use strict";r.d(t,{i:()=>n});const n="providers/5.7.2"},7013:(e,t,r)=>{"use strict";r.d(t,{H2:()=>H,Zk:()=>K});var n=r(4353),i=r(9567),o=r(7727),s=r(2593),a=r(3286),u=r(7218),l=r(8339),c=r(9861),h=r(3587),f=r(3951),d=r(4242),p=r(8341),m=r(2882),y=r.n(m),g=r(711),v=r(4216),b=r(32),w=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const A=new g.Logger(v.i);function E(e){return null==e?"null":(32!==(0,a.hexDataLength)(e)&&A.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function T(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[E(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return E(e)})).join("&")}function _(e){if("string"==typeof e){if(e=e.toLowerCase(),32===(0,a.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+T(e);if(n.Sg.isForkEvent(e))throw A.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+T(e.topics||[])}throw new Error("invalid event - "+e)}function k(){return(new Date).getTime()}function S(e){return new Promise((t=>{setTimeout(t,e)}))}const O=["block","network","pending","poll"];class x{constructor(e,t,r){(0,h.defineReadOnly)(this,"tag",e),(0,h.defineReadOnly)(this,"listener",t),(0,h.defineReadOnly)(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"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||O.indexOf(this.tag)>=0}}const C={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 I(e){return(0,a.hexZeroPad)(s.O$.from(e).toHexString(),32)}function P(e){return o.Base58.encode((0,a.concat)([e,(0,a.hexDataSlice)((0,f.JQ)((0,f.JQ)(e)),0,4)]))}const B=new RegExp("^(ipfs)://(.*)$","i"),R=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),B,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function M(e,t){try{return(0,d.ZN)(N(e,t))}catch(e){}return null}function N(e,t){if("0x"===e)return null;const r=s.O$.from((0,a.hexDataSlice)(e,t,t+32)).toNumber(),n=s.O$.from((0,a.hexDataSlice)(e,r,r+32)).toNumber();return(0,a.hexDataSlice)(e,r+32,r+32+n)}function L(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):A.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function F(e){const t=(0,a.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function D(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function U(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const i=(0,a.arrayify)(e[n]);t[n]=F(r),t.push(F(i.length)),t.push(D(i)),r+=32+32*Math.ceil(i.length/32)}return(0,a.hexConcat)(t)}class H{constructor(e,t,r,n){(0,h.defineReadOnly)(this,"provider",e),(0,h.defineReadOnly)(this,"name",r),(0,h.defineReadOnly)(this,"address",e.formatter.address(t)),(0,h.defineReadOnly)(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>s.O$.from(e).eq(1))).catch((e=>{if(e.code===g.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return w(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:(0,a.hexConcat)([e,(0,l.VM)(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,a.hexConcat)(["0x9061b923",U([(0,l.Kn)(this.name),r.data])]));try{let e=yield this.provider.call(r);return(0,a.arrayify)(e).length%32==4&&A.throwError("resolver threw error",g.Logger.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=N(e,0)),e}catch(e){if(e.code===g.Logger.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return w(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?N(r,0):null}))}_getAddress(e,t){const r=C[String(e)];if(null==r&&A.throwError(`unsupported coin type: ${e}`,g.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=(0,a.arrayify)(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return P((0,a.concat)([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return P((0,a.concat)([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=y().toWords(n.slice(2));return e.unshift(t),y().encode(r.prefix,e)}}return null}getAddress(e){return w(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===u.R?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===g.Logger.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",I(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&A.throwError("invalid or unsupported coin data",g.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return w(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<R.length;r++){const n=t.match(R[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){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:L(t)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});const o=this._resolvedAddress||(yield this.getAddress()),u=(n[2]||"").split("/");if(2!==u.length)return null;const l=yield this.provider.formatter.address(u[0]),c=(0,a.hexZeroPad)(s.O$.from(u[1]).toHexString(),32);if("erc721"===i){const t=this.provider.formatter.callAddress(yield this.provider.call({to:l,data:(0,a.hexConcat)(["0x6352211e",c])}));if(o!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){const t=s.O$.from(yield this.provider.call({to:l,data:(0,a.hexConcat)(["0x00fdd58e",(0,a.hexZeroPad)(o,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const h={to:this.provider.formatter.address(u[0]),data:(0,a.hexConcat)([r,c])};let f=M(yield this.provider.call(h),0);if(null==f)return null;e.push({type:"metadata-url-base",content:f}),"erc1155"===i&&(f=f.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:f})),f.match(/^ipfs:/i)&&(f=L(f)),e.push({type:"metadata-url",content:f});const d=yield(0,p.fetchJson)(f);if(!d)return null;e.push({type:"metadata",content:JSON.stringify(d)});let m=d.image;if("string"!=typeof m)return null;if(m.match(/^(https:\/\/|data:)/i));else{if(null==m.match(B))return null;e.push({type:"url-ipfs",content:m}),m=L(m)}return e.push({type:"url",content:m}),{linkage:e,url:m}}}}}catch(e){}return null}))}getContentHash(){return w(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)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 e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+o.Base58.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 e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+o.Base58.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const s=e.match(/^0x90b2c605([0-9a-f]*)$/);if(s&&68===s[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+(0,i.c)("0x"+s[1]).replace(/[=+\/]/g,(t=>e[t]))}return A.throwError("invalid or unsupported content hash data",g.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return w(this,void 0,void 0,(function*(){let t=(0,d.Y0)(e);t=(0,a.concat)([I(64),I(t.length),t]),t.length%32!=0&&(t=(0,a.concat)([t,(0,a.hexZeroPad)("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",(0,a.hexlify)(t));return null==r||"0x"===r?null:(0,d.ZN)(r)}))}}let j=null,z=1;class K extends n.zt{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,h.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=(0,h.getStatic)(new.target,"getNetwork")(e);t?((0,h.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):A.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return w(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||A.throwError("no network detected",g.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:(0,h.defineReadOnly)(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return(0,p.poll)((()=>this._ready().then((e=>e),(e=>{if(e.code!==g.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==j&&(j=new b.Mb),j}static getNetwork(e){return(0,c.H)(null==e?"homestead":e)}ccipReadFetch(e,t,r){return w(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e<r.length;e++){const t=r[e],s=t.replace("{sender}",n).replace("{data}",i),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),u=yield(0,p.fetchJson)({url:s,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(u.data)return u.data;const l=u.message||"unknown error";if(u.status>=400&&u.status<500)return A.throwError(`response not found during CCIP fetch: ${l}`,g.Logger.errors.SERVER_ERROR,{url:t,errorMessage:l});o.push(l)}return A.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,g.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return w(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(k()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=k(),r=(0,h.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=k();return(e=s.O$.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:i}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return w(this,void 0,void 0,(function*(){const e=z++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)A.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",A.makeError("network block skew detected",g.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return w(this,void 0,void 0,(function*(){return A.throwError("provider does not support network detection",g.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return w(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 S(0),this._network;const r=A.makeError("underlying network changed",g.Logger.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=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}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("number"!=typeof e||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=k();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=k(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return w(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return w(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const s=[];let a=!1;const u=function(){return!!a||(a=!0,s.forEach((e=>{e()})),!1)},l=e=>{e.confirmations<t||u()||i(e)};if(this.on(e,l),s.push((()=>{this.removeListener(e,l)})),n){let r=n.startBlock,i=null;const l=s=>w(this,void 0,void 0,(function*(){a||(yield S(1e3),this.getTransactionCount(n.from).then((c=>w(this,void 0,void 0,(function*(){if(!a){if(c<=n.nonce)r=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=s;){if(a)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const s=r.transactions[i];if(s.hash===e)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,t);if(u())return;let i="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?i="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(i="cancelled"),void o(A.makeError("transaction was replaced",g.Logger.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:e,receipt:r}))}}i++}}a||this.once("block",l)}}))),(e=>{a||this.once("block",l)})))}));if(a)return;this.once("block",l),s.push((()=>{this.removeListener("block",l)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{u()||o(A.makeError("timeout exceeded",g.Logger.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return w(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return s.O$.from(e)}catch(t){return A.throwError("bad result from backend",g.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,h.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return s.O$.from(n)}catch(e){return A.throwError("bad result from backend",g.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,h.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return s.O$.from(n).toNumber()}catch(e){return A.throwError("bad result from backend",g.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,h.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,a.hexlify)(n)}catch(e){return A.throwError("bad result from backend",g.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,h.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>(0,a.hexValue)(e)))}),i=yield this.perform("getStorageAt",n);try{return(0,a.hexlify)(i)}catch(e){return A.throwError("bad result from backend",g.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,a.hexDataLength)(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&A.throwError("Transaction hash mismatch from Provider.sendTransaction.",g.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>w(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&A.throwError("transaction failed",g.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>(0,a.hexlify)(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return w(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?s.O$.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?(0,a.hexlify)(e):null)))})),this.formatter.transactionRequest(yield(0,h.resolveProperties)(r))}))}_getFilter(e){return w(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield(0,h.resolveProperties)(t))}))}_call(e,t,r){return w(this,void 0,void 0,(function*(){r>=10&&A.throwError("CCIP read exceeded maximum redirections",g.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&(0,a.hexDataLength)(i)%32==4)try{const o=(0,a.hexDataSlice)(i,4),u=(0,a.hexDataSlice)(o,0,32);s.O$.from(u).eq(n)||A.throwError("CCIP Read sender did not match",g.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const l=[],c=s.O$.from((0,a.hexDataSlice)(o,32,64)).toNumber(),h=s.O$.from((0,a.hexDataSlice)(o,c,c+32)).toNumber(),f=(0,a.hexDataSlice)(o,c+32);for(let t=0;t<h;t++){const r=M(f,32*t);null==r&&A.throwError("CCIP Read contained corrupt URL string",g.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),l.push(r)}const d=N(o,64);s.O$.from((0,a.hexDataSlice)(o,100,128)).isZero()||A.throwError("CCIP Read callback selector included junk",g.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const p=(0,a.hexDataSlice)(o,96,100),m=N(o,128),y=yield this.ccipReadFetch(e,d,l);null==y&&A.throwError("CCIP Read disabled or provided no URLs",g.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const v={to:n,data:(0,a.hexConcat)([p,U([y,m])])};return this._call(v,t,r+1)}catch(e){if(e.code===g.Logger.errors.SERVER_ERROR)throw e}try{return(0,a.hexlify)(i)}catch(r){return A.throwError("bad result from backend",g.Logger.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:i,error:r})}}))}call(e,t){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,h.resolveProperties)({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 w(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,h.resolveProperties)({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return s.O$.from(r)}catch(e){return A.throwError("bad result from backend",g.Logger.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return w(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&A.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&A.throwError("ENS name not configured",g.Logger.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return w(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if((0,a.isHexString)(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),(0,a.isHexString)(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){A.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return(0,p.poll)((()=>w(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){const n=e.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return w(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,p.poll)((()=>w(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return w(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,p.poll)((()=>w(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,h.resolveProperties)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),b.Mb.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return w(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return w(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&A.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 w(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new H(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return w(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||A.throwError("network does not support ENS",g.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+(0,l.VM)(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return w(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if((0,a.isHexString)(e))throw t}"string"!=typeof e&&A.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return w(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=M(yield this.call({to:r,data:"0x691f3431"+(0,l.VM)(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return w(this,void 0,void 0,(function*(){let t=null;if((0,a.isHexString)(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new H(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==g.Logger.errors.CALL_EXCEPTION)throw e}try{const e=M(yield this.call({to:n,data:"0x691f3431"+(0,l.VM)(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==g.Logger.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return A.throwError(e+" not implemented",g.Logger.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new x(_(e),t,r);return this._events.push(n),this._startEvent(n),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,n=[],i=_(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=_(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=_(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=_(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||!!n||(n=!0,r.push(e),!1))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=_(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}},32:(e,t,r)=>{"use strict";r.d(t,{Ed:()=>d,Gp:()=>p,Mb:()=>f,vh:()=>y});var n=r(4594),i=r(2593),o=r(3286),s=r(9279),a=r(3587),u=r(4377),l=r(711),c=r(4216);const h=new l.Logger(c.i);class f{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),u=this.number.bind(this),l=this.type.bind(this);return e.transaction={hash:o,type:l,accessList:f.allowNull(this.accessList.bind(this),null),blockHash:f.allowNull(o,null),blockNumber:f.allowNull(u,null),transactionIndex:f.allowNull(u,null),confirmations:f.allowNull(u,null),from:t,gasPrice:f.allowNull(r),maxPriorityFeePerGas:f.allowNull(r),maxFeePerGas:f.allowNull(r),gasLimit:r,to:f.allowNull(t,null),value:r,nonce:u,data:i,r:f.allowNull(this.uint256),s:f.allowNull(this.uint256),v:f.allowNull(u),creates:f.allowNull(t,null),raw:f.allowNull(i)},e.transactionRequest={from:f.allowNull(t),nonce:f.allowNull(u),gasLimit:f.allowNull(r),gasPrice:f.allowNull(r),maxPriorityFeePerGas:f.allowNull(r),maxFeePerGas:f.allowNull(r),to:f.allowNull(t),value:f.allowNull(r),data:f.allowNull((e=>this.data(e,!0))),type:f.allowNull(u),accessList:f.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:u,blockNumber:u,transactionHash:o,address:t,topics:f.arrayOf(o),data:i,logIndex:u,blockHash:o},e.receipt={to:f.allowNull(this.address,null),from:f.allowNull(this.address,null),contractAddress:f.allowNull(t,null),transactionIndex:u,root:f.allowNull(s),gasUsed:r,logsBloom:f.allowNull(i),blockHash:o,transactionHash:o,logs:f.arrayOf(this.receiptLog.bind(this)),blockNumber:u,confirmations:f.allowNull(u,null),cumulativeGasUsed:r,effectiveGasPrice:f.allowNull(r),status:f.allowNull(u),type:l},e.block={hash:f.allowNull(o),parentHash:o,number:u,timestamp:u,nonce:f.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:f.allowNull(t),extraData:i,transactions:f.allowNull(f.arrayOf(o)),baseFeePerGas:f.allowNull(r)},e.blockWithTransactions=(0,a.shallowCopy)(e.block),e.blockWithTransactions.transactions=f.allowNull(f.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:f.allowNull(n,void 0),toBlock:f.allowNull(n,void 0),blockHash:f.allowNull(o,void 0),address:f.allowNull(t,void 0),topics:f.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:f.allowNull(u),blockHash:f.allowNull(o),transactionIndex:u,removed:f.allowNull(this.boolean.bind(this)),address:t,data:f.allowFalsish(i,"0x"),topics:f.arrayOf(o),transactionHash:o,logIndex:u},e}accessList(e){return(0,u.accessListify)(e||[])}number(e){return"0x"===e?0:i.O$.from(e).toNumber()}type(e){return"0x"===e||null==e?0:i.O$.from(e).toNumber()}bigNumber(e){return i.O$.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,o.isHexString)(e))?e.toLowerCase():h.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(0,n.getAddress)(e)}callAddress(e){if(!(0,o.isHexString)(e,32))return null;const t=(0,n.getAddress)((0,o.hexDataSlice)(e,12));return t===s.d?null:t}contractAddress(e){return(0,n.getContractAddress)(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||(0,o.isHexString)(e))return(0,o.hexValue)(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==(0,o.hexDataLength)(r)?h.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=i.O$.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!(0,o.isHexString)(e))throw new Error("invalid uint256");return(0,o.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=f.check(t,e);return n._difficulty=null==r?null:i.O$.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return f.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&i.O$.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=f.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return(0,u.parse)(e)}receiptLog(e){return f.check(this.formats.receiptLog,e)}receipt(e){const t=f.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=i.O$.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&h.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):h.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&h.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return f.check(this.formats.filter,e)}filterLog(e){return f.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?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(t){r.push(e(t))})),r}}}function d(e){return e&&"function"==typeof e.isCommunityResource}function p(e){return d(e)&&e.isCommunityResource()}let m=!1;function y(){m||(m=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded  (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}},2118:(e,t,r)=>{"use strict";r.r(t),r.d(t,{randomBytes:()=>n.O,shuffled:()=>i.y});var n=r(4478),i=r(2472)},4478:(e,t,r)=>{"use strict";r.d(t,{O:()=>u});var n=r(3286),i=r(711);const o=new i.Logger("random/5.7.0"),s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();let a=s.crypto||s.msCrypto;function u(e){(e<=0||e>1024||e%1||e!=e)&&o.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return a.getRandomValues(t),(0,n.arrayify)(t)}a&&a.getRandomValues||(o.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(e){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},2472:(e,t,r)=>{"use strict";function n(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}r.d(t,{y:()=>n})},1843:(e,t,r)=>{"use strict";r.r(t),r.d(t,{decode:()=>f,encode:()=>l});var n=r(3286),i=r(711);const o=new i.Logger("rlp/5.7.0");function s(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function a(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function u(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(u(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=s(t.length);return r.unshift(247+r.length),r.concat(t)}(0,n.isBytesLike)(e)||o.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call((0,n.arrayify)(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=s(t.length);return r.unshift(183+r.length),r.concat(t)}function l(e){return(0,n.hexlify)(u(e))}function c(e,t,r,n){const s=[];for(;r<t+1+n;){const a=h(e,r);s.push(a.result),(r+=a.consumed)>t+1+n&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:s}}function h(e,t){if(0===e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});const n=a(e,t+1,r);return t+1+r+n>e.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),c(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),c(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});const s=a(e,t+1,r);return t+1+r+s>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+r+s,result:(0,n.hexlify)(e.slice(t+1+r,t+1+r+s))}}if(e[t]>=128){const r=e[t]-128;return t+1+r>e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+r,result:(0,n.hexlify)(e.slice(t+1,t+1+r))}}return{consumed:1,result:(0,n.hexlify)(e[t])}}function f(e){const t=(0,n.arrayify)(e),r=h(t,0);return r.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),r.result}},1278:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SupportedAlgorithm:()=>i.p,computeHmac:()=>n.Gy,ripemd160:()=>n.bP,sha256:()=>n.JQ,sha512:()=>n.o});var n=r(3951),i=r(1261)},3951:(e,t,r)=>{"use strict";r.d(t,{Gy:()=>f,bP:()=>l,JQ:()=>c,o:()=>h});var n=r(3715),i=r.n(n),o=r(3286),s=r(1261),a=r(711);const u=new a.Logger("sha2/5.7.0");function l(e){return"0x"+i().ripemd160().update((0,o.arrayify)(e)).digest("hex")}function c(e){return"0x"+i().sha256().update((0,o.arrayify)(e)).digest("hex")}function h(e){return"0x"+i().sha512().update((0,o.arrayify)(e)).digest("hex")}function f(e,t,r){return s.p[e]||u.throwError("unsupported algorithm "+e,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+i().hmac(i()[e],(0,o.arrayify)(t)).update((0,o.arrayify)(r)).digest("hex")}},1261:(e,t,r)=>{"use strict";var n;r.d(t,{p:()=>n}),function(e){e.sha256="sha256",e.sha512="sha512"}(n||(n={}))},2768:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SigningKey:()=>J,computePublicKey:()=>Q,recoverPublicKey:()=>Y});var n=r(3550),i=r.n(n),o=r(3715),s=r.n(o);function a(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var u=l;function l(e,t){if(!e)throw new Error(t||"Assertion failed")}l.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var c=a((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),h=a((function(e,t){var r=t;r.assert=u,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+i&3,l=t.andln(3)+o&3;3===u&&(u=-1),3===l&&(l=-1),s=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==l?u:-u,r[0].push(s),a=0==(1&l)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?l:-l,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(i())(e,"hex","le")}})),f=h.getNAF,d=h.getJSF,p=h.assert;function m(e,t){this.type=e,this.p=new(i())(t.p,16),this.red=t.prime?i().red(t.prime):i().mont(this.p),this.zero=new(i())(0).toRed(this.red),this.one=new(i())(1).toRed(this.red),this.two=new(i())(2).toRed(this.red),this.n=t.n&&new(i())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var y=m;function g(e,t){this.curve=e,this.type=t,this.precomputed=null}m.prototype.point=function(){throw new Error("Not implemented")},m.prototype.validate=function(){throw new Error("Not implemented")},m.prototype._fixedNafMul=function(e,t){p(e.precomputed);var r=e._getDoubles(),n=f(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,s,a=[];for(o=0;o<n.length;o+=r.step){s=0;for(var u=o+r.step-1;u>=o;u--)s=(s<<1)+n[u];a.push(s)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o<a.length;o++)(s=a[o])===h?c=c.mixedAdd(r.points[o]):s===-h&&(c=c.mixedAdd(r.points[o].neg()));l=l.add(c)}return l.toP()},m.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=f(t,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var l=o[a];p(0!==l),s="affine"===e.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===e.type?s.toP():s},m.prototype._wnafMulAdd=function(e,t,r,n,i){var o,s,a,u=this._wnafT1,l=this._wnafT2,c=this._wnafT3,h=0;for(o=0;o<n;o++){var p=(a=t[o])._getNAFPoints(e);u[o]=p.wnd,l[o]=p.points}for(o=n-1;o>=1;o-=2){var m=o-1,y=o;if(1===u[m]&&1===u[y]){var g=[t[m],null,null,t[y]];0===t[m].y.cmp(t[y].y)?(g[1]=t[m].add(t[y]),g[2]=t[m].toJ().mixedAdd(t[y].neg())):0===t[m].y.cmp(t[y].y.redNeg())?(g[1]=t[m].toJ().mixedAdd(t[y]),g[2]=t[m].add(t[y].neg())):(g[1]=t[m].toJ().mixedAdd(t[y]),g[2]=t[m].toJ().mixedAdd(t[y].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=d(r[m],r[y]);for(h=Math.max(b[0].length,h),c[m]=new Array(h),c[y]=new Array(h),s=0;s<h;s++){var w=0|b[0][s],A=0|b[1][s];c[m][s]=v[3*(w+1)+(A+1)],c[y][s]=0,l[m]=g}}else c[m]=f(r[m],u[m],this._bitLength),c[y]=f(r[y],u[y],this._bitLength),h=Math.max(c[m].length,h),h=Math.max(c[y].length,h)}var E=this.jpoint(null,null,null),T=this._wnafT4;for(o=h;o>=0;o--){for(var _=0;o>=0;){var k=!0;for(s=0;s<n;s++)T[s]=0|c[s][o],0!==T[s]&&(k=!1);if(!k)break;_++,o--}if(o>=0&&_++,E=E.dblp(_),o<0)break;for(s=0;s<n;s++){var S=T[s];0!==S&&(S>0?a=l[s][S-1>>1]:S<0&&(a=l[s][-S-1>>1].neg()),E="affine"===a.type?E.mixedAdd(a):E.add(a))}}for(o=0;o<n;o++)l[o]=null;return i?E:E.toP()},m.BasePoint=g,g.prototype.eq=function(){throw new Error("Not implemented")},g.prototype.validate=function(){return this.curve.validate(this)},m.prototype.decodePoint=function(e,t){e=h.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?p(e[e.length-1]%2==0):7===e[0]&&p(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},g.prototype.encodeCompressed=function(e){return this.encode(e,!0)},g.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))},g.prototype.encode=function(e,t){return h.encode(this._encode(t),e)},g.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},g.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)},g.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},g.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},g.prototype._getBeta=function(){return null},g.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var v=a((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),b=h.assert;function w(e){y.call(this,"short",e),this.a=new(i())(e.a,16).toRed(this.red),this.b=new(i())(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}v(w,y);var A=w;function E(e,t,r,n){y.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(i())(t,16),this.y=new(i())(r,16),n&&(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)}function T(e,t,r,n){y.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(i())(0)):(this.x=new(i())(t,16),this.y=new(i())(r,16),this.z=new(i())(n,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}w.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(i())(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new(i())(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],b(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new(i())(e.a,16),b:new(i())(e.b,16)}})):this._getEndoBasis(r)}}},w.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i().mont(e),r=new(i())(2).toRed(t).redInvm(),n=r.redNeg(),o=new(i())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},w.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,u,l,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),p=new(i())(1),m=new(i())(0),y=new(i())(0),g=new(i())(1),v=0;0!==f.cmpn(0);){var b=d.div(f);l=d.sub(b.mul(f)),c=y.sub(b.mul(p));var w=g.sub(b.mul(m));if(!n&&l.cmp(h)<0)t=u.neg(),r=p,n=l.neg(),o=c;else if(n&&2==++v)break;u=l,d=f,f=l,y=p,p=c,g=m,m=w}s=l.neg(),a=c;var A=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(A)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},w.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),l=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(l).neg()}},w.prototype.pointFromX=function(e,t){(e=new(i())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},w.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},w.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var l=this._wnafMulAdd(1,n,i,2*o,r),c=0;c<2*o;c++)n[c]=null,i[c]=null;return l},v(E,y.BasePoint),w.prototype.point=function(e,t,r){return new E(this,e,t,r)},w.prototype.pointFromJSON=function(e,t){return E.fromJSON(this,e,t)},E.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,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},E.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]},E.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},E.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)+">"},E.prototype.isInfinity=function(){return this.inf},E.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(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},E.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},E.prototype.getX=function(){return this.x.fromRed()},E.prototype.getY=function(){return this.y.fromRed()},E.prototype.mul=function(e){return e=new(i())(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)},E.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},E.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},E.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},E.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,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},E.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},v(T,y.BasePoint),w.prototype.jpoint=function(e,t,r){return new T(this,e,t,r)},T.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),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},T.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},T.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),c=l.redMul(a),h=n.redMul(l),f=u.redSqr().redIAdd(c).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,d,p)},T.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),c=r.redMul(u),h=a.redSqr().redIAdd(l).redISub(c).redISub(c),f=a.redMul(c.redISub(h)).redISub(i.redMul(l)),d=this.z.redMul(s);return this.curve.jpoint(h,f,d)},T.prototype.dblp=function(e){if(0===e)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 n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),l=s.redAdd(s);for(t=0;t<e;t++){var c=o.redSqr(),h=l.redSqr(),f=h.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(u)),p=o.redMul(h),m=d.redSqr().redISub(p.redAdd(p)),y=p.redISub(m),g=d.redMul(y);g=g.redIAdd(g).redISub(f);var v=l.redMul(a);t+1<e&&(u=u.redMul(f)),o=m,a=v,l=g}return this.curve.jpoint(o,l.redMul(i),a)},T.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},T.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=u,t=a.redMul(s.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),f=h.redSqr(),d=this.x.redAdd(h).redSqr().redISub(c).redISub(f);d=d.redIAdd(d);var p=c.redAdd(c).redIAdd(c),m=p.redSqr(),y=f.redIAdd(f);y=(y=y.redIAdd(y)).redIAdd(y),e=m.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},T.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);e=u;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=a.redMul(s.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),f=this.x.redMul(h),d=this.x.redSub(c).redMul(this.x.redAdd(c));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),m=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var y=h.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),t=d.redMul(p.redISub(e)).redISub(y)}return this.curve.jpoint(e,t,r)},T.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),l=(u=u.redIAdd(u)).redMul(s),c=a.redSqr().redISub(l.redAdd(l)),h=l.redISub(c),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=a.redMul(h).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,d,p)},T.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(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),c=t.redMul(l);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(a).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.y.redMul(l.redMul(u.redISub(l)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,f,d)},T.prototype.mul=function(e,t){return e=new(i())(e,t),this.curve._wnafMul(this,e)},T.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},T.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},T.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)+">"},T.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var _=a((function(e,t){var r=t;r.base=y,r.short=A,r.mont=null,r.edwards=null})),k=a((function(e,t){var r,n=t,i=h.assert;function o(e){"short"===e.type?this.curve=new _.short(e):"edwards"===e.type?this.curve=new _.edwards(e):this.curve=new _.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function S(e){if(!(this instanceof S))return new S(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=c.toArray(e.entropy,e.entropyEnc||"hex"),r=c.toArray(e.nonce,e.nonceEnc||"hex"),n=c.toArray(e.pers,e.persEnc||"hex");u(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var O=S;S.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},S.prototype._hmac=function(){return new(s().hmac)(this.hash,this.K)},S.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())},S.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=c.toArray(e,t),r=c.toArray(r,n),u(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},S.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=c.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,c.encode(o,t)};var x=h.assert;function C(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var I=C;C.fromPublic=function(e,t,r){return t instanceof C?t:new C(e,{pub:t,pubEnc:r})},C.fromPrivate=function(e,t,r){return t instanceof C?t:new C(e,{priv:t,privEnc:r})},C.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"}},C.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},C.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},C.prototype._importPrivate=function(e,t){this.priv=new(i())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},C.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?x(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||x(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},C.prototype.derive=function(e){return e.validate()||x(e.validate(),"public point not validated"),e.mul(this.priv).getX()},C.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},C.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},C.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var P=h.assert;function B(e,t){if(e instanceof B)return e;this._importDER(e,t)||(P(e.r&&e.s,"Signature without r or s"),this.r=new(i())(e.r,16),this.s=new(i())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var R=B;function M(){this.place=0}function N(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function L(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function F(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}B.prototype._importDER=function(e,t){e=h.toArray(e,t);var r=new M;if(48!==e[r.place++])return!1;var n=N(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=N(e,r);if(!1===o)return!1;var s=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var a=N(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var u=e.slice(r.place,a+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new(i())(s),this.s=new(i())(u),this.recoveryParam=null,!0},B.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=L(t),r=L(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];F(n,t.length),(n=n.concat(t)).push(2),F(n,r.length);var i=n.concat(r),o=[48];return F(o,i.length),o=o.concat(i),h.encode(o,e)};var D=function(){throw new Error("unsupported")},U=h.assert;function H(e){if(!(this instanceof H))return new H(e);"string"==typeof e&&(U(Object.prototype.hasOwnProperty.call(k,e),"Unknown curve "+e),e=k[e]),e instanceof k.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var j=H;H.prototype.keyPair=function(e){return new I(this,e)},H.prototype.keyFromPrivate=function(e,t){return I.fromPrivate(this,e,t)},H.prototype.keyFromPublic=function(e,t){return I.fromPublic(this,e,t)},H.prototype.genKeyPair=function(e){e||(e={});for(var t=new O({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||D(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(i())(2));;){var o=new(i())(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},H.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},H.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(i())(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),a=e.toArray("be",o),u=new O({hash:this.hash,entropy:s,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new(i())(1)),c=0;;c++){var h=n.k?n.k(c):new(i())(u.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var f=this.g.mul(h);if(!f.isInfinity()){var d=f.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var m=h.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var y=(f.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),y^=1),new R({r:p,s:m,recoveryParam:y})}}}}}},H.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(i())(e,16)),r=this.keyFromPublic(r,n);var o=(t=new R(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),l=u.mul(e).umod(this.n),c=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(l,r.getPublic(),c)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(l,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},H.prototype.recoverPubKey=function(e,t,r,n){U((3&r)===r,"The recovery param is more than two bits"),t=new R(t,n);var o=this.n,s=new(i())(e),a=t.r,u=t.s,l=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var h=t.r.invm(o),f=o.sub(s).mul(h).umod(o),d=u.mul(h).umod(o);return this.g.mulAdd(f,a,d)},H.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new R(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var z=a((function(e,t){var r=t;r.version="6.5.4",r.utils=h,r.rand=function(){throw new Error("unsupported")},r.curve=_,r.curves=k,r.ec=j,r.eddsa=null})).ec,K=r(3286),G=r(3587);const q=new(r(711).Logger)("signing-key/5.7.0");let V=null;function W(){return V||(V=new z("secp256k1")),V}class J{constructor(e){(0,G.defineReadOnly)(this,"curve","secp256k1"),(0,G.defineReadOnly)(this,"privateKey",(0,K.hexlify)(e)),32!==(0,K.hexDataLength)(this.privateKey)&&q.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=W().keyFromPrivate((0,K.arrayify)(this.privateKey));(0,G.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,G.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,G.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){const t=W().keyFromPublic((0,K.arrayify)(this.publicKey)),r=W().keyFromPublic((0,K.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=W().keyFromPrivate((0,K.arrayify)(this.privateKey)),r=(0,K.arrayify)(e);32!==r.length&&q.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return(0,K.splitSignature)({recoveryParam:n.recoveryParam,r:(0,K.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,K.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=W().keyFromPrivate((0,K.arrayify)(this.privateKey)),r=W().keyFromPublic((0,K.arrayify)(Q(e)));return(0,K.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Y(e,t){const r=(0,K.splitSignature)(t),n={r:(0,K.arrayify)(r.r),s:(0,K.arrayify)(r.s)};return"0x"+W().recoverPubKey((0,K.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function Q(e,t){const r=(0,K.arrayify)(e);if(32===r.length){const e=new J(r);return t?"0x"+W().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?(0,K.hexlify)(r):"0x"+W().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+W().keyFromPublic(r).getPublic(!0,"hex"):(0,K.hexlify)(r):q.throwArgumentError("invalid public or private key","key","[REDACTED]")}},3777:(e,t,r)=>{"use strict";r.r(t),r.d(t,{keccak256:()=>y,pack:()=>m,sha256:()=>g});var n=r(2593),i=r(3286),o=r(8197),s=r(3951),a=r(4242),u=r(711);const l=new RegExp("^bytes([0-9]+)$"),c=new RegExp("^(u?int)([0-9]*)$"),h=new RegExp("^(.*)\\[([0-9]*)\\]$"),f="0000000000000000000000000000000000000000000000000000000000000000",d=new u.Logger("solidity/5.7.0");function p(e,t,r){switch(e){case"address":return r?(0,i.zeroPad)(t,32):(0,i.arrayify)(t);case"string":return(0,a.Y0)(t);case"bytes":return(0,i.arrayify)(t);case"bool":return t=t?"0x01":"0x00",r?(0,i.zeroPad)(t,32):(0,i.arrayify)(t)}let o=e.match(c);if(o){let s=parseInt(o[2]||"256");return(o[2]&&String(s)!==o[2]||s%8!=0||0===s||s>256)&&d.throwArgumentError("invalid number type","type",e),r&&(s=256),t=n.O$.from(t).toTwos(s),(0,i.zeroPad)(t,s/8)}if(o=e.match(l),o){const n=parseInt(o[1]);return(String(n)!==o[1]||0===n||n>32)&&d.throwArgumentError("invalid bytes type","type",e),(0,i.arrayify)(t).byteLength!==n&&d.throwArgumentError(`invalid value for ${e}`,"value",t),r?(0,i.arrayify)((t+f).substring(0,66)):t}if(o=e.match(h),o&&Array.isArray(t)){const r=o[1];parseInt(o[2]||String(t.length))!=t.length&&d.throwArgumentError(`invalid array length for ${e}`,"value",t);const n=[];return t.forEach((function(e){n.push(p(r,e,!0))})),(0,i.concat)(n)}return d.throwArgumentError("invalid type","type",e)}function m(e,t){e.length!=t.length&&d.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(p(e,t[n]))})),(0,i.hexlify)((0,i.concat)(r))}function y(e,t){return(0,o.keccak256)(m(e,t))}function g(e,t){return(0,s.JQ)(m(e,t))}},6237:(e,t,r)=>{"use strict";r.d(t,{F:()=>a,s:()=>s});var n=r(7218),i=r(3286),o=r(4242);function s(e){const t=(0,o.Y0)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([t,n.R]).slice(0,32))}function a(e){const t=(0,i.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,o.ZN)(t.slice(0,r))}},5637:(e,t,r)=>{"use strict";r.d(t,{Ll:()=>p});var n=r(4242);function i(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function o(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function s(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n];if(r+=i.l,e>=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const a=o("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),u="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),l=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],c=i("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),h=i("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),f=i("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),d=o("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function p(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=(0,n.XL)(e);var r;r=t.map((e=>{if(u.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=s(e,l);if(t)return[e+t.s];let r=c[e];if(r)return r;let n=h[e];return n?[e+n[0]]:f[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=(0,n.XL)((0,n.uu)(t),n.Uj.NFKC),t.forEach((e=>{if(s(e,d))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(s(e,a))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let i=(0,n.uu)(t);if("-"===i.substring(0,1)||"--"===i.substring(2,4)||"-"===i.substring(i.length-1))throw new Error("invalid hyphen");return i}},2741:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:()=>o.Uj,Utf8ErrorFuncs:()=>o.te,Utf8ErrorReason:()=>o.Uw,_toEscapedUtf8String:()=>o.U$,formatBytes32String:()=>n.s,nameprep:()=>i.Ll,parseBytes32String:()=>n.F,toUtf8Bytes:()=>o.Y0,toUtf8CodePoints:()=>o.XL,toUtf8String:()=>o.ZN});var n=r(6237),i=r(5637),o=r(4242)},4242:(e,t,r)=>{"use strict";r.d(t,{Uj:()=>o,te:()=>u,Uw:()=>s,U$:()=>f,uu:()=>d,Y0:()=>c,XL:()=>m,ZN:()=>p});var n=r(3286);const i=new(r(711).Logger)("strings/5.7.0");var o,s;function a(e,t,r,n,i){if(e===s.BAD_PREFIX||e===s.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===s.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(o||(o={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(s||(s={}));const u=Object.freeze({error:function(e,t,r,n,o){return i.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:a,replace:function(e,t,r,n,i){return e===s.OVERLONG?(n.push(i),0):(n.push(65533),a(e,t,r))}});function l(e,t){null==t&&(t=u.error),e=(0,n.arrayify)(e);const r=[];let i=0;for(;i<e.length;){const n=e[i++];if(n>>7==0){r.push(n);continue}let o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){i+=t(128==(192&n)?s.UNEXPECTED_CONTINUE:s.BAD_PREFIX,i-1,e,r);continue}o=3,a=65535}if(i-1+o>=e.length){i+=t(s.OVERRUN,i-1,e,r);continue}let u=n&(1<<8-o-1)-1;for(let n=0;n<o;n++){let n=e[i];if(128!=(192&n)){i+=t(s.MISSING_CONTINUE,i,e,r),u=null;break}u=u<<6|63&n,i++}null!==u&&(u>1114111?i+=t(s.OUT_OF_RANGE,i-1-o,e,r,u):u>=55296&&u<=57343?i+=t(s.UTF16_SURROGATE,i-1-o,e,r,u):u<=a?i+=t(s.OVERLONG,i-1-o,e,r,u):r.push(u))}return r}function c(e,t=o.current){t!=o.current&&(i.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return(0,n.arrayify)(r)}function h(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function f(e,t){return'"'+l(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?h(e):h(55296+((e-=65536)>>10&1023))+h(56320+(1023&e))})).join("")+'"'}function d(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function p(e,t){return d(l(e,t))}function m(e,t=o.current){return l(c(e,t))}},4377:(e,t,r)=>{"use strict";r.r(t),r.d(t,{TransactionTypes:()=>d,accessListify:()=>E,computeAddress:()=>v,parse:()=>x,recoverAddress:()=>b,serialize:()=>S});var n=r(4594),i=r(2593),o=r(3286),s=r(1046),a=r(8197),u=r(3587),l=r(1843),c=r(2768),h=r(711);const f=new h.Logger("transactions/5.7.0");var d;function p(e){return"0x"===e?null:(0,n.getAddress)(e)}function m(e){return"0x"===e?s._Y:i.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(d||(d={}));const y=[{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"}],g={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function v(e){const t=(0,c.computePublicKey)(e);return(0,n.getAddress)((0,o.hexDataSlice)((0,a.keccak256)((0,o.hexDataSlice)(t,1)),12))}function b(e,t){return v((0,c.recoverPublicKey)((0,o.arrayify)(e),t))}function w(e,t){const r=(0,o.stripZeros)(i.O$.from(e).toHexString());return r.length>32&&f.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function A(e,t){return{address:(0,n.getAddress)(e),storageKeys:(t||[]).map(((t,r)=>(32!==(0,o.hexDataLength)(t)&&f.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function E(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&f.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),A(e[0],e[1])):A(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return A(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function T(e){return E(e).map((e=>[e.address,e.storageKeys]))}function _(e,t){if(null!=e.gasPrice){const t=i.O$.from(e.gasPrice),r=i.O$.from(e.maxFeePerGas||0);t.eq(r)||f.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(e.maxFeePerGas||0,"maxFeePerGas"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",T(e.accessList||[])];if(t){const e=(0,o.splitSignature)(t);r.push(w(e.recoveryParam,"recoveryParam")),r.push((0,o.stripZeros)(e.r)),r.push((0,o.stripZeros)(e.s))}return(0,o.hexConcat)(["0x02",l.encode(r)])}function k(e,t){const r=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.gasPrice||0,"gasPrice"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",T(e.accessList||[])];if(t){const e=(0,o.splitSignature)(t);r.push(w(e.recoveryParam,"recoveryParam")),r.push((0,o.stripZeros)(e.r)),r.push((0,o.stripZeros)(e.s))}return(0,o.hexConcat)(["0x01",l.encode(r)])}function S(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&f.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,u.checkProperties)(e,g);const r=[];y.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=(0,o.arrayify)((0,o.hexlify)(n,i)),t.length&&n.length!==t.length&&n.length>0&&f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,o.stripZeros)(n),n.length>t.maxLength&&f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push((0,o.hexlify)(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&f.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,o.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,o.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return l.encode(r);const i=(0,o.splitSignature)(t);let s=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),s+=2*n+8,i.v>28&&i.v!==s&&f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==s&&f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,o.hexlify)(s)),r.push((0,o.stripZeros)((0,o.arrayify)(i.r))),r.push((0,o.stripZeros)((0,o.arrayify)(i.s))),l.encode(r)}(e,t);switch(e.type){case 1:return k(e,t);case 2:return _(e,t)}return f.throwError(`unsupported transaction type: ${e.type}`,h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function O(e,t,r){try{const r=m(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){f.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,o.hexZeroPad)(t[1],32),e.s=(0,o.hexZeroPad)(t[2],32);try{const t=(0,a.keccak256)(r(e));e.from=b(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function x(e){const t=(0,o.arrayify)(e);if(t[0]>127)return function(e){const t=l.decode(e);9!==t.length&&6!==t.length&&f.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:m(t[0]).toNumber(),gasPrice:m(t[1]),gasLimit:m(t[2]),to:p(t[3]),value:m(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=i.O$.from(t[6]).toNumber()}catch(e){return r}if(r.r=(0,o.hexZeroPad)(t[7],32),r.s=(0,o.hexZeroPad)(t[8],32),i.O$.from(r.r).isZero()&&i.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push((0,o.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const s=(0,a.keccak256)(l.encode(i));try{r.from=b(s,{r:(0,o.hexlify)(r.r),s:(0,o.hexlify)(r.s),recoveryParam:n})}catch(e){}r.hash=(0,a.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=l.decode(e.slice(1));8!==t.length&&11!==t.length&&f.throwArgumentError("invalid component count for transaction type: 1","payload",(0,o.hexlify)(e));const r={type:1,chainId:m(t[0]).toNumber(),nonce:m(t[1]).toNumber(),gasPrice:m(t[2]),gasLimit:m(t[3]),to:p(t[4]),value:m(t[5]),data:t[6],accessList:E(t[7])};return 8===t.length||(r.hash=(0,a.keccak256)(e),O(r,t.slice(8),k)),r}(t);case 2:return function(e){const t=l.decode(e.slice(1));9!==t.length&&12!==t.length&&f.throwArgumentError("invalid component count for transaction type: 2","payload",(0,o.hexlify)(e));const r=m(t[2]),n=m(t[3]),i={type:2,chainId:m(t[0]).toNumber(),nonce:m(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:m(t[4]),to:p(t[5]),value:m(t[6]),data:t[7],accessList:E(t[8])};return 9===t.length||(i.hash=(0,a.keccak256)(e),O(i,t.slice(9),_)),i}(t)}return f.throwError(`unsupported transaction type: ${t[0]}`,h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},6441:(e,t,r)=>{"use strict";r.r(t),r.d(t,{commify:()=>s,formatEther:()=>l,formatUnits:()=>a,parseEther:()=>c,parseUnits:()=>u});var n=r(335);const i=new(r(711).Logger)("units/5.7.0"),o=["wei","kwei","mwei","gwei","szabo","finney","ether"];function s(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&i.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let o="";for(2===t.length&&(o="."+(t[1]||"0"));o.length>2&&"0"===o[o.length-1];)o=o.substring(0,o.length-1);const s=[];for(;r.length;){if(r.length<=3){s.unshift(r);break}{const e=r.length-3;s.unshift(r.substring(e)),r=r.substring(0,e)}}return n+s.join(",")+o}function a(e,t){if("string"==typeof t){const e=o.indexOf(t);-1!==e&&(t=3*e)}return(0,n.S5)(e,null!=t?t:18)}function u(e,t){if("string"!=typeof e&&i.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=o.indexOf(t);-1!==e&&(t=3*e)}return(0,n.Ox)(e,null!=t?t:18)}function l(e){return a(e,18)}function c(e){return u(e,18)}},4958:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Wallet:()=>w,verifyMessage:()=>A,verifyTypedData:()=>E});var n=r(4594),i=r(4353),o=r(8171),s=r(3286),a=r(3684),u=r(7827),l=r(6274),c=r(8197),h=r(3587),f=r(4478),d=r(2768),p=r(1964),m=r(9380),y=r(4377),g=r(711),v=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const b=new g.Logger("wallet/5.7.0");class w extends o.E{constructor(e,t){if(super(),null!=(r=e)&&(0,s.isHexString)(r.privateKey,32)&&null!=r.address){const t=new d.SigningKey(e.privateKey);if((0,h.defineReadOnly)(this,"_signingKey",(()=>t)),(0,h.defineReadOnly)(this,"address",(0,y.computeAddress)(this.publicKey)),this.address!==(0,n.getAddress)(e.address)&&b.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;(0,h.defineReadOnly)(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||l.defaultPath,locale:t.locale||"en"})));const r=this.mnemonic,n=l.HDNode.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path);(0,y.computeAddress)(n.privateKey)!==this.address&&b.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,h.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(d.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&b.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,h.defineReadOnly)(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new d.SigningKey(e);(0,h.defineReadOnly)(this,"_signingKey",(()=>t))}(0,h.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,h.defineReadOnly)(this,"address",(0,y.computeAddress)(this.publicKey))}var r;t&&!i.zt.isProvider(t)&&b.throwArgumentError("invalid provider","provider",t),(0,h.defineReadOnly)(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 w(this,e)}signTransaction(e){return(0,h.resolveProperties)(e).then((t=>{null!=t.from&&((0,n.getAddress)(t.from)!==this.address&&b.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest((0,c.keccak256)((0,y.serialize)(t)));return(0,y.serialize)(t,r)}))}signMessage(e){return v(this,void 0,void 0,(function*(){return(0,s.joinSignature)(this._signingKey().signDigest((0,a.r)(e)))}))}_signTypedData(e,t,r){return v(this,void 0,void 0,(function*(){const n=yield u.E.resolveNames(e,t,r,(e=>(null==this.provider&&b.throwError("cannot resolve ENS names without a provider",g.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return(0,s.joinSignature)(this._signingKey().signDigest(u.E.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),(0,p.HI)(this,e,t,r)}static createRandom(e){let t=(0,f.O)(16);e||(e={}),e.extraEntropy&&(t=(0,s.arrayify)((0,s.hexDataSlice)((0,c.keccak256)((0,s.concat)([t,e.extraEntropy])),0,16)));const r=(0,l.entropyToMnemonic)(t,e.locale);return w.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return(0,m.decryptJsonWallet)(e,t,r).then((e=>new w(e)))}static fromEncryptedJsonSync(e,t){return new w((0,m.decryptJsonWalletSync)(e,t))}static fromMnemonic(e,t,r){return t||(t=l.defaultPath),new w(l.HDNode.fromMnemonic(e,null,r).derivePath(t))}}function A(e,t){return(0,y.recoverAddress)((0,a.r)(e),t)}function E(e,t,r,n){return(0,y.recoverAddress)(u.E.hash(e,t,r),n)}},8341:(e,t,r)=>{"use strict";r.r(t),r.d(t,{_fetchData:()=>p,fetchJson:()=>m,poll:()=>y});var n=r(9567),i=r(3286),o=r(3587),s=r(4242),a=r(711),u=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};function l(e,t){return u(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),o=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach(((e,t)=>{s[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{s[e.toLowerCase()]=n.headers.get(e)})),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:(0,i.arrayify)(new Uint8Array(o))}}))}var c=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const h=new a.Logger("web/5.7.1");function f(e){return new Promise((t=>{setTimeout(t,e)}))}function d(e,t){if(null==e)return null;if("string"==typeof e)return e;if((0,i.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,s.ZN)(e)}catch(e){}return(0,i.hexlify)(e)}return e}function p(e,t,r){const i="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;h.assertArgument(i>0&&i%1==0,"invalid connection throttle limit","connection.throttleLimit",i);const u="object"==typeof e?e.throttleCallback:null,p="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;h.assertArgument(p>0&&p%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",p);const m="object"==typeof e&&!!e.errorPassThrough,y={};let g=null;const v={method:"GET"};let b=!1,w=12e4;if("string"==typeof e)g=e;else if("object"==typeof e){if(null!=e&&null!=e.url||h.throwArgumentError("missing URL","connection.url",e),g=e.url,"number"==typeof e.timeout&&e.timeout>0&&(w=e.timeout),e.headers)for(const t in e.headers)y[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(b=!0);if(v.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==g.substring(0,6)&&!0!==e.allowInsecureAuthentication&&h.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;y.authorization={key:"Authorization",value:"Basic "+(0,n.c)((0,s.Y0)(t))}}null!=e.skipFetchSetup&&(v.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(v.fetchOptions=(0,o.shallowCopy)(e.fetchOptions))}const A=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),E=g?g.match(A):null;if(E)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":E[1]||"text/plain"},body:E[2]?(0,n.J)(E[3]):(T=E[3],(0,s.Y0)(T.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){h.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:d(E[1],E[2]),error:e,requestBody:null,requestMethod:"GET",url:g})}var T;t&&(v.method="POST",v.body=t,null==y["content-type"]&&(y["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==y["content-length"]&&(y["content-length"]={key:"Content-Length",value:String(t.length)}));const _={};Object.keys(y).forEach((e=>{const t=y[e];_[t.key]=t.value})),v.headers=_;const k=function(){let e=null;return{promise:new Promise((function(t,r){w&&(e=setTimeout((()=>{null!=e&&(e=null,r(h.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:d(v.body,_["content-type"]),requestMethod:v.method,timeout:w,url:g})))}),w))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),S=function(){return c(this,void 0,void 0,(function*(){for(let e=0;e<i;e++){let t=null;try{if(t=yield l(g,v),e<i)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===v.method&&e.match(/^https:/)){g=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(u&&(r=yield u(e,g)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):p*parseInt(String(Math.random()*Math.pow(2,e))),yield f(r);continue}}}catch(e){t=e.response,null==t&&(k.cancel(),h.throwError("missing response",a.Logger.errors.SERVER_ERROR,{requestBody:d(v.body,_["content-type"]),requestMethod:v.method,serverError:e,url:g}))}let n=t.body;if(b&&304===t.statusCode?n=null:!m&&(t.statusCode<200||t.statusCode>=300)&&(k.cancel(),h.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:d(n,t.headers?t.headers["content-type"]:null),requestBody:d(v.body,_["content-type"]),requestMethod:v.method,url:g})),r)try{const e=yield r(n,t);return k.cancel(),e}catch(r){if(r.throttleRetry&&e<i){let t=!0;if(u&&(t=yield u(e,g)),t){const t=p*parseInt(String(Math.random()*Math.pow(2,e)));yield f(t);continue}}k.cancel(),h.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:d(n,t.headers?t.headers["content-type"]:null),error:r,requestBody:d(v.body,_["content-type"]),requestMethod:v.method,url:g})}return k.cancel(),n}return h.throwError("failed response",a.Logger.errors.SERVER_ERROR,{requestBody:d(v.body,_["content-type"]),requestMethod:v.method,url:g})}))}();return Promise.race([k.promise,S])}function m(e,t,r){let n=null;if(null!=t){n=(0,s.Y0)(t);const r="string"==typeof e?{url:e}:(0,o.shallowCopy)(e);r.headers?0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length||(r.headers=(0,o.shallowCopy)(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return p(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse((0,s.ZN)(e))}catch(t){h.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function y(e,t){return t||(t={}),null==(t=(0,o.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),t.timeout));const a=t.retryLimit;let u=0;!function i(){return e().then((function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(u++,u>a)return void(s()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){s()&&n(e)}))}()}))}},8659:(e,t,r)=>{"use strict";r.d(t,{D:()=>s});var n=r(2046),i=r(3587);const o=new(r(711).Logger)("wordlists/5.7.0");class s{constructor(e){o.checkAbstract(new.target,s),(0,i.defineReadOnly)(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 n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return(0,n.id)(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}},9855:(e,t,r)=>{"use strict";r.d(t,{E:()=>u});var n=r(8659);let i=null;function o(e){if(null==i&&(i="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==n.D.check(e)))throw i=null,new Error("BIP39 Wordlist for en (English) FAILED")}class s extends n.D{constructor(){super("en")}getWord(e){return o(this),i[e]}getWordIndex(e){return o(this),i.indexOf(e)}}const a=new s;n.D.register(a);const u={en:a}},9540:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainRegistryABI=void 0,t.DomainRegistryABI=[{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"DomainAlreadyRegistered",type:"error"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"maxIndex",type:"uint256"},{internalType:"uint256",name:"suppliedIndex",type:"uint256"}],name:"DomainIndexOutOfRange",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"domain",type:"string"},{indexed:!1,internalType:"bytes4",name:"tag",type:"bytes4"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"DomainRegistered",type:"event"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getDomain",outputs:[{internalType:"string",name:"domain",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getDomains",outputs:[{internalType:"string[]",name:"domains",type:"string[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getNumberOfDomains",outputs:[{internalType:"uint256",name:"totalDomains",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"setDomain",outputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}]},5989:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERC1155ABI=void 0,t.ERC1155ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"owners",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"balances",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}]},2089:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERC20ABI=void 0,t.ERC20ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]},1198:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERC721ABI=void 0,t.ERC721ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}]},6812:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeaportABIv14=void 0,t.SeaportABIv14=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"EtherTransferGenericFailure",type:"error"},{inputs:[],name:"InexactFraction",type:"error"},{inputs:[],name:"InsufficientEtherSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents[]",name:"orders",type:"tuple[]"}],name:"cancel",outputs:[{internalType:"bool",name:"cancelled",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder",name:"advancedOrder",type:"tuple"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"}],name:"fulfillAdvancedOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"advancedOrders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableAdvancedOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"parameters",type:"tuple"}],name:"fulfillBasicOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"}],name:"fulfillOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"contractOfferer",type:"address"}],name:"getContractOffererNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"offerer",type:"address"}],name:"getCounter",outputs:[{internalType:"uint256",name:"counter",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents",name:"order",type:"tuple"}],name:"getOrderHash",outputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"getOrderStatus",outputs:[{internalType:"bool",name:"isValidated",type:"bool"},{internalType:"bool",name:"isCancelled",type:"bool"},{internalType:"uint256",name:"totalFilled",type:"uint256"},{internalType:"uint256",name:"totalSize",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"incrementCounter",outputs:[{internalType:"uint256",name:"newCounter",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"information",outputs:[{internalType:"string",name:"version",type:"string"},{internalType:"bytes32",name:"domainSeparator",type:"bytes32"},{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"},{internalType:"address",name:"recipient",type:"address"}],name:"matchAdvancedOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"}],name:"matchOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"contractName",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"}],name:"validate",outputs:[{internalType:"bool",name:"validated",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}]},7452:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DOMAIN_REGISTRY_ADDRESS=t.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS=t.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS=t.KNOWN_CONDUIT_KEYS_TO_CONDUIT=t.NO_CONDUIT=t.ONE_HUNDRED_PERCENT_BP=t.MAX_INT=t.BasicOrderRouteType=t.Side=t.ItemType=t.OrderType=t.EIP_712_BULK_ORDER_TYPE=t.EIP_712_ORDER_TYPE=t.OPENSEA_CONDUIT_ADDRESS=t.OPENSEA_CONDUIT_KEY=t.SEAPORT_CONTRACT_VERSION_V1_5=t.SEAPORT_CONTRACT_VERSION_V1_4=t.SEAPORT_CONTRACT_NAME=void 0;var i,o,s,a,u=r(7640);t.SEAPORT_CONTRACT_NAME="Seaport",t.SEAPORT_CONTRACT_VERSION_V1_4="1.4",t.SEAPORT_CONTRACT_VERSION_V1_5="1.5",t.OPENSEA_CONDUIT_KEY="0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000",t.OPENSEA_CONDUIT_ADDRESS="0x1e0049783f008a0085193e00003d00cd54003c71",t.EIP_712_ORDER_TYPE={OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},t.EIP_712_BULK_ORDER_TYPE={BulkOrder:[{name:"tree",type:"OrderComponents[2][2][2][2][2][2][2]"}],OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},(a=t.OrderType||(t.OrderType={}))[a.FULL_OPEN=0]="FULL_OPEN",a[a.PARTIAL_OPEN=1]="PARTIAL_OPEN",a[a.FULL_RESTRICTED=2]="FULL_RESTRICTED",a[a.PARTIAL_RESTRICTED=3]="PARTIAL_RESTRICTED",(s=t.ItemType||(t.ItemType={}))[s.NATIVE=0]="NATIVE",s[s.ERC20=1]="ERC20",s[s.ERC721=2]="ERC721",s[s.ERC1155=3]="ERC1155",s[s.ERC721_WITH_CRITERIA=4]="ERC721_WITH_CRITERIA",s[s.ERC1155_WITH_CRITERIA=5]="ERC1155_WITH_CRITERIA",(o=t.Side||(t.Side={}))[o.OFFER=0]="OFFER",o[o.CONSIDERATION=1]="CONSIDERATION",(i=t.BasicOrderRouteType||(t.BasicOrderRouteType={}))[i.ETH_TO_ERC721=0]="ETH_TO_ERC721",i[i.ETH_TO_ERC1155=1]="ETH_TO_ERC1155",i[i.ERC20_TO_ERC721=2]="ERC20_TO_ERC721",i[i.ERC20_TO_ERC1155=3]="ERC20_TO_ERC1155",i[i.ERC721_TO_ERC20=4]="ERC721_TO_ERC20",i[i.ERC1155_TO_ERC20=5]="ERC1155_TO_ERC20",t.MAX_INT=u.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),t.ONE_HUNDRED_PERCENT_BP=1e4,t.NO_CONDUIT="0x0000000000000000000000000000000000000000000000000000000000000000",t.KNOWN_CONDUIT_KEYS_TO_CONDUIT=((n={})[t.OPENSEA_CONDUIT_KEY]=t.OPENSEA_CONDUIT_ADDRESS,n),t.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS="0x00000000000001ad428e4906aE43D8F9852d0dD6",t.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS="0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC",t.DOMAIN_REGISTRY_ADDRESS="0x000000000DaD0DE04D2B2D4a5A74581EBA94124A"},8272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Seaport=void 0;var n=r(7278);Object.defineProperty(t,"Seaport",{enumerable:!0,get:function(){return n.Seaport}})},7278:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},u=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.Seaport=void 0;var l=r(6631),c=r(7640),h=r(6371),f=r(9540),d=r(6812),p=r(7452),m=r(8471),y=r(512),g=r(8609),v=r(5154),b=r(9919),w=r(9494),A=r(7591),E=function(){function e(e,t){var r,i,o,s,a=void 0===t?{}:t,u=a.overrides,h=a.ascendingAmountFulfillmentBuffer,m=void 0===h?300:h,y=a.balanceAndApprovalChecksOnOrderCreation,g=void 0===y||y,v=a.conduitKeyToConduit,b=a.seaportVersion,w=void 0===b?"1.4":b;this.OPENSEA_CONDUIT_KEY=p.OPENSEA_CONDUIT_KEY,this.getOrderHash=function(e){var t="OfferItem(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount)",r="ConsiderationItem(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount,address recipient)",n="".concat("OrderComponents(address offerer,address zone,OfferItem[] offer,ConsiderationItem[] consideration,uint8 orderType,uint256 startTime,uint256 endTime,bytes32 zoneHash,uint256 salt,bytes32 conduitKey,uint256 counter)").concat(r).concat(t),i=c.ethers.utils.keccak256(c.ethers.utils.toUtf8Bytes(t)),o=c.ethers.utils.keccak256(c.ethers.utils.toUtf8Bytes(r)),s=c.ethers.utils.keccak256(c.ethers.utils.toUtf8Bytes(n)),a=c.ethers.utils.keccak256("0x"+e.offer.map((function(e){return c.ethers.utils.keccak256("0x"+[i.slice(2),e.itemType.toString().padStart(64,"0"),e.token.slice(2).padStart(64,"0"),c.ethers.BigNumber.from(e.identifierOrCriteria).toHexString().slice(2).padStart(64,"0"),c.ethers.BigNumber.from(e.startAmount).toHexString().slice(2).padStart(64,"0"),c.ethers.BigNumber.from(e.endAmount).toHexString().slice(2).padStart(64,"0")].join("")).slice(2)})).join("")),u=c.ethers.utils.keccak256("0x"+e.consideration.map((function(e){return c.ethers.utils.keccak256("0x"+[o.slice(2),e.itemType.toString().padStart(64,"0"),e.token.slice(2).padStart(64,"0"),c.ethers.BigNumber.from(e.identifierOrCriteria).toHexString().slice(2).padStart(64,"0"),c.ethers.BigNumber.from(e.startAmount).toHexString().slice(2).padStart(64,"0"),c.ethers.BigNumber.from(e.endAmount).toHexString().slice(2).padStart(64,"0"),e.recipient.slice(2).padStart(64,"0")].join("")).slice(2)})).join(""));return c.ethers.utils.keccak256("0x"+[s.slice(2),e.offerer.slice(2).padStart(64,"0"),e.zone.slice(2).padStart(64,"0"),a.slice(2),u.slice(2),e.orderType.toString().padStart(64,"0"),c.ethers.BigNumber.from(e.startTime).toHexString().slice(2).padStart(64,"0"),c.ethers.BigNumber.from(e.endTime).toHexString().slice(2).padStart(64,"0"),e.zoneHash.slice(2),e.salt.slice(2).padStart(64,"0"),e.conduitKey.slice(2).padStart(64,"0"),c.ethers.BigNumber.from(e.counter).toHexString().slice(2).padStart(64,"0")].join(""))};var A=e instanceof c.providers.Provider?e:e.provider;if(this.signer=e._isSigner?e:void 0,!A)throw new Error("Either a provider or custom signer with provider must be provided");this.provider=A,this.multicallProvider=new l.providers.MulticallProvider(this.provider),this.contract=new c.Contract(null!==(i=null==u?void 0:u.contractAddress)&&void 0!==i?i:"1.5"===w?p.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS:p.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS,d.SeaportABIv14,this.multicallProvider),this.domainRegistry=new c.Contract(null!==(o=null==u?void 0:u.domainRegistryAddress)&&void 0!==o?o:p.DOMAIN_REGISTRY_ADDRESS,f.DomainRegistryABI,this.multicallProvider),this.config={ascendingAmountFulfillmentBuffer:m,balanceAndApprovalChecksOnOrderCreation:g,conduitKeyToConduit:n(n(n({},p.KNOWN_CONDUIT_KEYS_TO_CONDUIT),(r={},r[p.NO_CONDUIT]=this.contract.address,r)),v),seaportVersion:w},this.defaultConduitKey=null!==(s=null==u?void 0:u.defaultConduitKey)&&void 0!==s?s:p.NO_CONDUIT}return e.prototype.createOrder=function(e,t,r){return i(this,void 0,void 0,(function(){var n,u,l,c,h,f,d,p=this;return o(this,(function(m){switch(m.label){case 0:return[4,(n=this._getSigner(t)).getAddress()];case 1:return u=m.sent(),[4,this._formatOrder(n,u,Boolean(r),e)];case 2:return l=m.sent(),c=l.orderComponents,h=l.approvalActions,f={type:"create",getMessageToSign:function(){return p._getMessageToSign(c)},createOrder:function(){return i(p,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.signOrder(c,u)];case 1:return e=t.sent(),[2,{parameters:c,signature:e}]}}))}))}},[2,{actions:d=a(a([],s(h),!1),[f],!1),executeAllActions:function(){return(0,A.executeAllActions)(d)}}]}}))}))},e.prototype.createBulkOrders=function(e,t,r){var n;return i(this,void 0,void 0,(function(){var l,c,h,f,d,p,m,y,g,v,b,w,E,T,_,k,S,O,x,C,I,P,B=this;return o(this,(function(R){switch(R.label){case 0:return[4,(l=this._getSigner(t)).getAddress()];case 1:return c=R.sent(),[4,this.getCounter(c)];case 2:h=R.sent(),f=[],d=[],R.label=3;case 3:R.trys.push([3,8,9,10]),p=u(e),m=p.next(),R.label=4;case 4:return m.done?[3,7]:(y=m.value,null!==(n=y.counter)&&void 0!==n||(y.counter=h),[4,this._formatOrder(l,c,Boolean(r),y)]);case 5:g=R.sent(),v=g.orderComponents,b=g.approvalActions,d.push(v),w=function(e){void 0===f.find((function(t){return t.token===e.token}))&&f.push(e)};try{for(I=void 0,E=u(b),T=E.next();!T.done;T=E.next())_=T.value,w(_)}catch(e){I={error:e}}finally{try{T&&!T.done&&(P=E.return)&&P.call(E)}finally{if(I)throw I.error}}R.label=6;case 6:return m=p.next(),[3,4];case 7:return[3,10];case 8:return k=R.sent(),x={error:k},[3,10];case 9:try{m&&!m.done&&(C=p.return)&&C.call(p)}finally{if(x)throw x.error}return[7];case 10:return S={type:"createBulk",getMessageToSign:function(){return B._getBulkMessageToSign(d)},createBulkOrders:function(){return i(B,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.signBulkOrder(d,c)];case 1:return[2,e.sent()]}}))}))}},[2,{actions:O=a(a([],s(f),!1),[S],!1),executeAllActions:function(){return(0,A.executeAllActions)(O)}}]}}))}))},e.prototype._formatOrder=function(e,t,r,u){var l,h=u.conduitKey,f=void 0===h?this.defaultConduitKey:h,d=u.zone,g=void 0===d?c.ethers.constants.AddressZero:d,v=u.startTime,A=void 0===v?Math.floor(Date.now()/1e3).toString():v,E=u.endTime,T=void 0===E?p.MAX_INT.toString():E,_=u.offer,k=u.consideration,S=u.counter,O=u.allowPartialFills,x=u.restrictedByZone,C=u.fees,I=u.domain,P=u.salt;return i(this,void 0,void 0,(function(){var i,u,h,d,p,v,E,B,R,M,N,L,F,D,U;return o(this,(function(o){switch(o.label){case 0:if(i=_.map(w.mapInputItemToOfferItem),u=a([],s(k.map((function(e){var r;return n(n({},(0,w.mapInputItemToOfferItem)(e)),{recipient:null!==(r=e.recipient)&&void 0!==r?r:t})}))),!1),!(0,w.areAllCurrenciesSame)({offer:i,consideration:u}))throw new Error("All currency tokens in the order must be the same token");return h=a(a([],s(i),!1),s(u),!1).filter(b.isCurrencyItem),d=(0,w.totalItemsAmount)(h),p=this.config.conduitKeyToConduit[f],v=this._getOrderTypeFromOrderOptions({allowPartialFills:O,restrictedByZone:x}),E=a(a([],s((0,w.deductFees)(u,C)),!1),s(h.length&&null!==(l=null==C?void 0:C.map((function(e){return(0,w.feeToConsiderationItem)({fee:e,token:h[0].token,baseAmount:d.startAmount,baseEndAmount:d.endAmount})})))&&void 0!==l?l:[]),!1),B=P||(I?(0,w.generateRandomSaltWithDomain)(I):(0,w.generateRandomSalt)()),U={offerer:t,zone:g,zoneHash:c.ethers.constants.HashZero,startTime:A,endTime:T,orderType:v,offer:i,consideration:E,totalOriginalConsiderationItems:E.length,salt:B,conduitKey:f},null==S?[3,1]:(M=S,[3,3]);case 1:return[4,this.getCounter(t)];case 2:M=o.sent(),o.label=3;case 3:return U.counter=M.toString(),R=U,N=[],this.config.balanceAndApprovalChecksOnOrderCreation?[4,(0,y.getBalancesAndApprovals)({owner:t,items:i,criterias:[],multicallProvider:this.multicallProvider,operator:p})]:[3,6];case 4:return L=o.sent(),F=(0,y.validateOfferBalancesAndApprovals)({offer:i,criterias:[],balancesAndApprovals:L,throwOnInsufficientBalances:!0,operator:p}),[4,(0,m.getApprovalActions)(F,r,e)];case 5:D=o.sent(),N.push.apply(N,a([],s(D),!1)),o.label=6;case 6:return[2,{orderComponents:R,approvalActions:N}]}}))}))},e.prototype._getSigner=function(e){if(this.signer)return this.signer;if(!(this.provider instanceof c.providers.JsonRpcProvider))throw new Error("Either signer or a JsonRpcProvider must be provided");return this.provider.getSigner(e)},e.prototype._getOrderTypeFromOrderOptions=function(e){var t=e.allowPartialFills,r=e.restrictedByZone;return t?r?p.OrderType.PARTIAL_RESTRICTED:p.OrderType.PARTIAL_OPEN:r?p.OrderType.FULL_RESTRICTED:p.OrderType.FULL_OPEN},e.prototype._getDomainData=function(){return i(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.provider.getNetwork()];case 1:return e=t.sent().chainId,[2,{name:p.SEAPORT_CONTRACT_NAME,version:"1.5"===this.config.seaportVersion?p.SEAPORT_CONTRACT_VERSION_V1_5:p.SEAPORT_CONTRACT_VERSION_V1_4,chainId:e,verifyingContract:this.contract.address}]}}))}))},e.prototype._getMessageToSign=function(e){return i(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this._getDomainData()];case 1:return t=r.sent(),[2,JSON.stringify(h._TypedDataEncoder.getPayload(t,p.EIP_712_ORDER_TYPE,e))]}}))}))},e.prototype._getBulkMessageToSign=function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return o(this,(function(o){switch(o.label){case 0:return[4,this._getDomainData()];case 1:return t=o.sent(),r=(0,g.getBulkOrderTree)(e),n=r.types,i=r.getDataToSign(),[2,JSON.stringify(h._TypedDataEncoder.getPayload(t,n,{tree:i}))]}}))}))},e.prototype.signOrder=function(e,t){return i(this,void 0,void 0,(function(){var r,n,i;return o(this,(function(o){switch(o.label){case 0:return r=this._getSigner(t),[4,this._getDomainData()];case 1:return n=o.sent(),[4,r._signTypedData(n,p.EIP_712_ORDER_TYPE,e)];case 2:return i=o.sent(),[2,c.ethers.utils.splitSignature(i).compact]}}))}))},e.prototype.signBulkOrder=function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,s,a,u,l;return o(this,(function(o){switch(o.label){case 0:return r=this._getSigner(t),[4,this._getDomainData()];case 1:return n=o.sent(),i=(0,g.getBulkOrderTree)(e),s=i.types,a=i.getDataToSign(),u={tree:a},[4,r._signTypedData(n,s,u)];case 2:return l=o.sent(),l=c.ethers.utils.splitSignature(l).compact,[2,e.map((function(e,t){return{parameters:e,signature:i.getEncodedProofAndSignature(t,l)}}))]}}))}))},e.prototype.cancelOrders=function(e,t,r){var n=this._getSigner(t);return(0,A.getTransactionMethods)(this.contract.connect(n),"cancel",[e],r)},e.prototype.bulkCancelOrders=function(e,t){var r=this._getSigner(e);return(0,A.getTransactionMethods)(this.contract.connect(r),"incrementCounter",[],t)},e.prototype.validate=function(e,t,r){var n=this._getSigner(t);return(0,A.getTransactionMethods)(this.contract.connect(n),"validate",[e],r)},e.prototype.getOrderStatus=function(e){return this.contract.getOrderStatus(e)},e.prototype.getCounter=function(e){return this.contract.getCounter(e)},e.prototype.fulfillOrder=function(e){var t=e.order,r=e.unitsToFill,u=e.offerCriteria,l=void 0===u?[]:u,h=e.considerationCriteria,f=void 0===h?[]:h,d=e.tips,p=void 0===d?[]:d,m=e.extraData,g=void 0===m?"0x":m,A=e.accountAddress,E=e.conduitKey,T=void 0===E?this.defaultConduitKey:E,_=e.recipientAddress,k=void 0===_?c.ethers.constants.AddressZero:_,S=e.domain,O=void 0===S?"":S,x=e.exactApproval,C=void 0!==x&&x;return i(this,void 0,void 0,(function(){var e,i,u,h,d,m,E,_,S,x,I,P,B,R,M,N,L,F,D,U;return o(this,(function(o){switch(o.label){case 0:return e=t.parameters,i=e.offerer,u=e.offer,h=e.consideration,[4,(d=this._getSigner(A)).getAddress()];case 1:return m=o.sent(),E=this.config.conduitKeyToConduit[e.conduitKey],_=this.config.conduitKeyToConduit[T],[4,Promise.all([(0,y.getBalancesAndApprovals)({owner:i,items:u,criterias:l,multicallProvider:this.multicallProvider,operator:E}),(0,y.getBalancesAndApprovals)({owner:m,items:a(a([],s(u),!1),s(h),!1),criterias:a(a([],s(l),!1),s(f),!1),multicallProvider:this.multicallProvider,operator:_}),this.multicallProvider.getBlock("latest"),this.getOrderStatus(this.getOrderHash(e))])];case 2:return S=s.apply(void 0,[o.sent(),4]),x=S[0],I=S[1],P=S[2],B=S[3],R=P.timestamp,M=B.totalFilled,N=B.totalSize,L=(0,v.validateAndSanitizeFromOrderStatus)(t,B),F={startTime:L.parameters.startTime,endTime:L.parameters.endTime,currentBlockTimestamp:R,ascendingAmountTimestampBuffer:this.config.ascendingAmountFulfillmentBuffer},D=p.map((function(e){return n(n({},(0,w.mapInputItemToOfferItem)(e)),{recipient:e.recipient})})),U=k===c.ethers.constants.AddressZero,!r&&U&&(0,v.shouldUseBasicFulfill)(L.parameters,M)?[2,(0,v.fulfillBasicOrder)({order:L,seaportContract:this.contract,offererBalancesAndApprovals:x,fulfillerBalancesAndApprovals:I,timeBasedItemParams:F,conduitKey:T,offererOperator:E,fulfillerOperator:_,signer:d,tips:D,domain:O},C)]:[2,(0,v.fulfillStandardOrder)({order:L,unitsToFill:r,totalFilled:M,totalSize:N.eq(0)?(0,b.getMaximumSizeForOrder)(L):N,offerCriteria:l,considerationCriteria:f,tips:D,extraData:g,seaportContract:this.contract,offererBalancesAndApprovals:x,fulfillerBalancesAndApprovals:I,timeBasedItemParams:F,conduitKey:T,signer:d,offererOperator:E,fulfillerOperator:_,recipientAddress:k,domain:O},C)]}}))}))},e.prototype.fulfillOrders=function(e){var t=e.fulfillOrderDetails,r=e.accountAddress,u=e.conduitKey,l=void 0===u?this.defaultConduitKey:u,h=e.recipientAddress,f=void 0===h?c.ethers.constants.AddressZero:h,d=e.domain,p=void 0===d?"":d,m=e.exactApproval,g=void 0!==m&&m;return i(this,void 0,void 0,(function(){var e,i,u,c,h,d,m,b,A,E,T,_,k,S,O=this;return o(this,(function(o){switch(o.label){case 0:return[4,(e=this._getSigner(r)).getAddress()];case 1:return i=o.sent(),u=t.map((function(e){var t=e.order;return O.config.conduitKeyToConduit[t.parameters.conduitKey]})),c=this.config.conduitKeyToConduit[l],h=t.flatMap((function(e){return e.order.parameters.offer})),d=t.flatMap((function(e){return e.order.parameters.consideration})),m=t.flatMap((function(e){var t=e.offerCriteria;return void 0===t?[]:t})),b=t.flatMap((function(e){var t=e.considerationCriteria;return void 0===t?[]:t})),[4,Promise.all([Promise.all(t.map((function(e,t){var r=e.order,n=e.offerCriteria,i=void 0===n?[]:n;return(0,y.getBalancesAndApprovals)({owner:r.parameters.offerer,items:r.parameters.offer,criterias:i,operator:u[t],multicallProvider:O.multicallProvider})}))),(0,y.getBalancesAndApprovals)({owner:i,items:a(a([],s(h),!1),s(d),!1),criterias:a(a([],s(m),!1),s(b),!1),operator:c,multicallProvider:this.multicallProvider}),this.multicallProvider.getBlock("latest"),Promise.all(t.map((function(e){var t=e.order;return O.getOrderStatus(O.getOrderHash(t.parameters))})))])];case 2:return A=s.apply(void 0,[o.sent(),4]),E=A[0],T=A[1],_=A[2],k=A[3],S=t.map((function(e,t){var r,i,o,s,a;return{order:e.order,unitsToFill:e.unitsToFill,orderStatus:k[t],offerCriteria:null!==(r=e.offerCriteria)&&void 0!==r?r:[],considerationCriteria:null!==(i=e.considerationCriteria)&&void 0!==i?i:[],tips:null!==(s=null===(o=e.tips)||void 0===o?void 0:o.map((function(e){return n(n({},(0,w.mapInputItemToOfferItem)(e)),{recipient:e.recipient})})))&&void 0!==s?s:[],extraData:null!==(a=e.extraData)&&void 0!==a?a:"0x",offererBalancesAndApprovals:E[t],offererOperator:u[t]}})),[2,(0,v.fulfillAvailableOrders)({ordersMetadata:S,seaportContract:this.contract,fulfillerBalancesAndApprovals:T,currentBlockTimestamp:_.timestamp,ascendingAmountTimestampBuffer:this.config.ascendingAmountFulfillmentBuffer,fulfillerOperator:c,signer:e,conduitKey:l,recipientAddress:f,domain:p,exactApproval:g})]}}))}))},e.prototype.matchOrders=function(e){var t=e.orders,r=e.fulfillments,n=e.overrides,i=e.accountAddress,o=e.domain,s=void 0===o?"":o,a=this._getSigner(i);return(0,A.getTransactionMethods)(this.contract.connect(a),"matchOrders",[t,r,n],s)},e.prototype.setDomain=function(e,t){var r=this._getSigner(t);return(0,A.getTransactionMethods)(this.domainRegistry.connect(r),"setDomain",[e])},e.prototype.getNumberOfDomains=function(e){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.domainRegistry.getNumberOfDomains(e)]}))}))},e.prototype.getDomain=function(e,t){return this.domainRegistry.getDomain(e,t)},e.prototype.getDomains=function(e,t){return i(this,void 0,void 0,(function(){var r,n=this;return o(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,1,,3]),t)throw Error;return[2,this.domainRegistry.getDomains(e)];case 1:return i.sent(),[4,this.domainRegistry.getNumberOfDomains(e)];case 2:return r=i.sent().toNumber(),[2,Promise.all(a([],s(Array(r).keys()),!1).map((function(t){return n.domainRegistry.getDomain(e,t)})))];case 3:return[2]}}))}))},e}();t.Seaport=E},8471:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getApprovalActions=t.approvedItemAmount=void 0;var o=r(7640),s=r(2089),a=r(1198),u=r(7452),l=r(9919),c=r(7591);t.approvedItemAmount=function(e,t,r,c){return n(void 0,void 0,void 0,(function(){return i(this,(function(n){return(0,l.isErc721Item)(t.itemType)||(0,l.isErc1155Item)(t.itemType)?[2,new o.Contract(t.token,a.ERC721ABI,c).isApprovedForAll(e,r).then((function(e){return e?u.MAX_INT:o.BigNumber.from(0)}))]:t.itemType===u.ItemType.ERC20?[2,new o.Contract(t.token,s.ERC20ABI,c).allowance(e,r)]:[2,u.MAX_INT]}))}))},t.getApprovalActions=function(e,t,r){var h=this;return Promise.all(e.filter((function(t,r){return r===e.length-1||e[r+1].token!==t.token})).map((function(e){var f=e.token,d=e.operator,p=e.itemType,m=e.identifierOrCriteria,y=e.requiredApprovedAmount;return n(h,void 0,void 0,(function(){var e,n;return i(this,(function(i){return e=(0,l.isErc1155Item)(p),(0,l.isErc721Item)(p)||e?(n=new o.Contract(f,a.ERC721ABI,r),[2,{type:"approval",token:f,identifierOrCriteria:m,itemType:p,operator:d,transactionMethods:(0,c.getTransactionMethods)(n.connect(r),t&&!e?"approve":"setApprovalForAll",[d,!(t&&!e)||m])}]):(n=new o.Contract(f,s.ERC20ABI,r),[2,{type:"approval",token:f,identifierOrCriteria:m,itemType:p,transactionMethods:(0,c.getTransactionMethods)(n.connect(r),"approve",[d,t?y:u.MAX_INT]),operator:d}])}))}))})))}},8204:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.balanceOf=void 0;var o=r(7640),s=r(5989),a=r(2089),u=r(1198),l=r(7452),c=r(9919);t.balanceOf=function(e,t,r,h){return n(void 0,void 0,void 0,(function(){var n,f,d;return i(this,(function(i){return(0,c.isErc721Item)(t.itemType)?(d=new o.Contract(t.token,u.ERC721ABI,r),t.itemType===l.ItemType.ERC721_WITH_CRITERIA?[2,h?d.ownerOf(h.identifier).then((function(t){return o.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase()))})):d.balanceOf(e)]:[2,d.ownerOf(t.identifierOrCriteria).then((function(t){return o.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase()))}))]):(0,c.isErc1155Item)(t.itemType)?(d=new o.Contract(t.token,s.ERC1155ABI,r),t.itemType===l.ItemType.ERC1155_WITH_CRITERIA?h?[2,d.balanceOf(e,h.identifier)]:(n=o.BigNumber.from(t.startAmount),f=o.BigNumber.from(t.endAmount),[2,n.gt(f)?n:f]):[2,d.balanceOf(e,t.identifierOrCriteria)]):(0,c.isErc20Item)(t.itemType)?[2,(d=new o.Contract(t.token,a.ERC20ABI,r)).balanceOf(e)]:[2,r.getBalance(e)]}))}))}},512:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.validateStandardFulfillBalancesAndApprovals=t.validateBasicFulfillBalancesAndApprovals=t.validateOfferBalancesAndApprovals=t.getInsufficientBalanceAndApprovalAmounts=t.getBalancesAndApprovals=void 0;var u=r(7640),l=r(7452),c=r(8471),h=r(8204),f=r(5498),d=r(9919),p=function(e,t,r){var n=e.find((function(e){var n=e.token,i=e.identifierOrCriteria;return t.toLowerCase()===n.toLowerCase()&&i.toLowerCase()===r.toLowerCase()}));if(!n)throw new Error("Balances and approvals didn't contain all tokens and identifiers");return n};t.getBalancesAndApprovals=function(e){var t=e.owner,r=e.items,n=e.criterias,s=e.operator,a=e.multicallProvider;return i(void 0,void 0,void 0,(function(){var e;return o(this,(function(p){return e=(0,f.getItemToCriteriaMap)(r,n),[2,Promise.all(r.map((function(r){return i(void 0,void 0,void 0,(function(){var n,i,f,p;return o(this,(function(o){switch(o.label){case 0:return n=Promise.resolve(u.BigNumber.from(0)),n=(0,d.isErc721Item)(r.itemType)||(0,d.isErc1155Item)(r.itemType)||(0,d.isErc20Item)(r.itemType)?(0,c.approvedItemAmount)(t,r,s,a):Promise.resolve(l.MAX_INT),i={token:r.token,identifierOrCriteria:null!==(p=null===(f=e.get(r))||void 0===f?void 0:f.identifier)&&void 0!==p?p:r.identifierOrCriteria},[4,(0,h.balanceOf)(t,r,a,e.get(r))];case 1:return i.balance=o.sent(),[4,n];case 2:return[2,(i.approvedAmount=o.sent(),i.itemType=r.itemType,i)]}}))}))})))]}))}))},t.getInsufficientBalanceAndApprovalAmounts=function(e){var t=e.balancesAndApprovals,r=e.tokenAndIdentifierAmounts,n=e.operator,i=a([],s(Object.entries(r).map((function(e){var t=s(e,2),r=t[0],n=t[1];return Object.entries(n).map((function(e){var t=s(e,2),n=t[0],i=t[1];return[r,n,i]}))}))),!1).flat(),o=function(e){return i.filter((function(r){var n=s(r,3),i=n[0],o=n[1],a=n[2];return p(t,i,o)[e].lt(a)})).map((function(r){var n=s(r,3),i=n[0],o=n[1],a=n[2],u=p(t,i,o);return{token:i,identifierOrCriteria:o,requiredAmount:a,amountHave:u[e],itemType:u.itemType}}))},u=s([o("balance"),o("approvedAmount").map((function(e){return{token:e.token,identifierOrCriteria:e.identifierOrCriteria,approvedAmount:e.amountHave,requiredApprovedAmount:e.requiredAmount,itemType:e.itemType,operator:n}}))],2);return{insufficientBalances:u[0],insufficientApprovals:u[1]}},t.validateOfferBalancesAndApprovals=function(e){var r=e.offer,i=e.criterias,o=e.balancesAndApprovals,s=e.timeBasedItemParams,a=e.throwOnInsufficientBalances,u=void 0===a||a,l=e.throwOnInsufficientApprovals,c=e.operator,h=(0,t.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:o,tokenAndIdentifierAmounts:(0,d.getSummedTokenAndIdentifierAmounts)({items:r,criterias:i,timeBasedItemParams:s?n(n({},s),{isConsiderationItem:!1}):void 0}),operator:c}),f=h.insufficientBalances,p=h.insufficientApprovals;if(u&&f.length>0)throw new Error("The offerer does not have the amount needed to create or fulfill.");if(l&&p.length>0)throw new Error("The offerer does not have the sufficient approvals.");return p},t.validateBasicFulfillBalancesAndApprovals=function(e){var r=e.offer,i=e.consideration,o=e.offererBalancesAndApprovals,s=e.fulfillerBalancesAndApprovals,a=e.timeBasedItemParams,u=e.offererOperator,l=e.fulfillerOperator;(0,t.validateOfferBalancesAndApprovals)({offer:r,criterias:[],balancesAndApprovals:o,timeBasedItemParams:a,throwOnInsufficientApprovals:!0,operator:u});var c=i.filter((function(e){return e.itemType!==r[0].itemType})),h=(0,t.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:s,tokenAndIdentifierAmounts:(0,d.getSummedTokenAndIdentifierAmounts)({items:c,criterias:[],timeBasedItemParams:n(n({},a),{isConsiderationItem:!0})}),operator:l}),f=h.insufficientBalances,p=h.insufficientApprovals;if(f.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return p},t.validateStandardFulfillBalancesAndApprovals=function(e){var r=e.offer,i=e.consideration,o=e.offerCriteria,s=e.considerationCriteria,a=e.offererBalancesAndApprovals,u=e.fulfillerBalancesAndApprovals,l=e.timeBasedItemParams,c=e.offererOperator,h=e.fulfillerOperator;(0,t.validateOfferBalancesAndApprovals)({offer:r,criterias:o,balancesAndApprovals:a,timeBasedItemParams:l,throwOnInsufficientApprovals:!0,operator:c});var f=m({items:r,criterias:o,balancesAndApprovals:u,timeBasedItemParams:l}),p=(0,t.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:f,tokenAndIdentifierAmounts:(0,d.getSummedTokenAndIdentifierAmounts)({items:i,criterias:s,timeBasedItemParams:n(n({},l),{isConsiderationItem:!0})}),operator:h}),y=p.insufficientBalances,g=p.insufficientApprovals;if(y.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return g};var m=function(e){var t=e.items,r=e.criterias,i=e.timeBasedItemParams,o=e.balancesAndApprovals,a=(0,d.getSummedTokenAndIdentifierAmounts)({items:t,criterias:r,timeBasedItemParams:n(n({},i),{isConsiderationItem:!1})}),u=o.map((function(e){return n({},e)}));return Object.entries(a).forEach((function(e){var t=s(e,2),r=t[0],n=t[1];return Object.entries(n).forEach((function(e){var t=s(e,2),n=t[0],i=t[1],o=p(u,r,n),a=u.indexOf(o);u[a].balance=u[a].balance.add(i)}))})),u}},5498:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getItemToCriteriaMap=t.generateCriteriaResolvers=void 0;var o=r(7452),s=r(9919);t.generateCriteriaResolvers=function(e){var t=e.orders,r=e.offerCriterias,a=void 0===r?[[]]:r,u=e.considerationCriterias,l=void 0===u?[[]]:u,c=t.flatMap((function(e,t){return e.parameters.offer.map((function(e,r){return{orderIndex:t,item:e,index:r,side:o.Side.OFFER}})).filter((function(e){var t=e.item;return(0,s.isCriteriaItem)(t.itemType)}))})),h=t.flatMap((function(e,t){return e.parameters.consideration.map((function(e,r){return{orderIndex:t,item:e,index:r,side:o.Side.CONSIDERATION}})).filter((function(e){var t=e.item;return(0,s.isCriteriaItem)(t.itemType)}))})),f=function(e,t){return e.map((function(e){var r=e.orderIndex,n=e.item,i=e.index,o=e.side,s=n.identifierOrCriteria||"0",a=t[r][i];return{orderIndex:r,index:i,side:o,identifier:a.identifier,criteriaProof:"0"===s?[]:a.proof}}))};return i(i([],n(f(c,a)),!1),n(f(h,l)),!1)},t.getItemToCriteriaMap=function(e,t){var r=i([],n(t),!1);return e.reduce((function(e,t){return(0,s.isCriteriaItem)(t.itemType)&&e.set(t,r.shift()),e}),new Map)}},3380:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Eip712MerkleTree=void 0;var o=r(5931),s=r(6371),a=r(2162),u=r(4103),l=r(7886),c=function(){function e(e,t,r,n,i){this.types=e,this.rootType=t,this.leafType=r,this.elements=n,this.depth=i;var s,c,h=o._TypedDataEncoder.from(e);this.encoder=h,this.leafHasher=function(e){return h.hashStruct(r,e)},this.defaultNode=u.DefaultGetter.from(e,r),this.defaultLeaf=this.leafHasher(this.defaultNode),this.tree=(s=this.getCompleteLeaves(),c=this.defaultLeaf,new a.MerkleTree(s.map(l.hexToBuffer),l.bufferKeccak,{complete:!0,sort:!1,hashLeaves:!1,fillDefaultHash:(0,l.hexToBuffer)(c)}))}return Object.defineProperty(e.prototype,"completedSize",{get:function(){return Math.pow(2,this.depth)},enumerable:!1,configurable:!0}),e.prototype.getCompleteElements=function(){var e=this.elements;return(0,l.fillArray)(i([],n(e),!1),this.completedSize,this.defaultNode)},e.prototype.getCompleteLeaves=function(){var e=this.elements.map(this.leafHasher);return(0,l.fillArray)(i([],n(e),!1),this.completedSize,this.defaultLeaf)},Object.defineProperty(e.prototype,"root",{get:function(){return this.tree.getHexRoot()},enumerable:!1,configurable:!0}),e.prototype.getProof=function(e){var t=this.getCompleteLeaves()[e];return{leaf:t,proof:this.tree.getHexProof(t,e),root:this.tree.getHexRoot()}},e.prototype.getEncodedProofAndSignature=function(e,t){return function(e,t,r){return void 0===r&&(r="0x".concat("ff".repeat(64))),(0,s.hexConcat)([r,"0x".concat(e.toString(16).padStart(6,"0")),s.defaultAbiCoder.encode(["uint256[".concat(t.length,"]")],[t])])}(e,this.getProof(e).proof,t)},e.prototype.getDataToSign=function(){for(var e=this.getCompleteElements();e.length>2;)e=(0,l.chunk)(e,2);return e},e.prototype.add=function(e){this.elements.push(e)},e.prototype.getBulkOrderHash=function(){var e=this.encoder.hashStruct("BulkOrder",{tree:this.getDataToSign()}),t=this.getCompleteLeaves().map(l.hexToBuffer),r=(0,l.bufferToHex)((0,l.getRoot)(t,!1)),n=(0,s.keccak256)((0,s.toUtf8Bytes)(this.encoder._types.BulkOrder));if((0,s.keccak256)((0,s.hexConcat)([n,r]))!==e)throw new Error("expected derived bulk order hash to match");return e},e}();t.Eip712MerkleTree=c},8609:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getBulkOrderTypeHashes=t.getBulkOrderTypeHash=t.getBulkOrderTree=t.getBulkOrderTreeHeight=void 0;var s=r(6371),a=r(3380),u=r(4103),l=r(7886),c=r(7452);function h(e){var t=n({},c.EIP_712_BULK_ORDER_TYPE);return t.BulkOrder=[{name:"tree",type:"OrderComponents".concat("[2]".repeat(e))}],t}function f(e){return Math.max(Math.ceil(Math.log2(e)),1)}function d(e){var t=h(e),r=s._TypedDataEncoder.from(t),n=(0,s.toUtf8Bytes)(r._types.BulkOrder);return(0,s.keccak256)(n)}t.getBulkOrderTreeHeight=f,t.getBulkOrderTree=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=f(e.length+t));var n=h(r),s=u.DefaultGetter.from(n,"OrderComponents"),c=o([],i(e),!1);return t>0&&(c=o(o([],i((0,l.fillArray)([],t,s)),!1),i(e),!1)),new a.Eip712MerkleTree(n,"BulkOrder","OrderComponents",c,r)},t.getBulkOrderTypeHash=d,t.getBulkOrderTypeHashes=function(e){for(var t=[],r=0;r<e;r++)t.push(d(r+1));return t}},4103:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGetter=void 0;var o=r(711),s=r(6371),a=new o.Logger("defaults"),u={integer:0,address:(0,s.hexZeroPad)("0x",20),bool:!1,bytes:"0x",string:""},l=function(e){return void 0!==e&&null!=e&&(["string","number"].includes(typeof e)&&BigInt(e)===BigInt(0)||Array.isArray(e)&&e.every(l)||"object"==typeof e&&Object.values(e).every(l)||"boolean"==typeof e&&!1===e)},c=function(){function e(e){for(var t in this.types=e,this.defaultValues={},e){var r=this.getDefaultValue(t);this.defaultValues[t]=r,l(r)||a.throwError("Got non-empty value for type ".concat(t," in default generator: ").concat(r))}}return e.from=function(t,r){var n=new e(t).defaultValues;return r?n[r]:n},e.prototype.getDefaultValue=function(e){var t=this;if(this.defaultValues[e])return this.defaultValues[e];var r=function(e){var t,r=i(null!==(t=e.match(/^bytes(\d+)$/))&&void 0!==t?t:[],2)[1];return r?(0,s.hexZeroPad)("0x",parseInt(r)):(e.match(/^(u?)int(\d*)$/)&&(e="integer"),u[e])}(e);if(void 0!==r)return r;var o=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(o){var l=o[1],c=parseInt(o[3]);if(c>0){var h=this.getDefaultValue(l);return Array(c).fill(h)}return[]}var f=this.types[e];return f?f.reduce((function(e,r){var i,o=r.name,s=r.type;return n(n({},e),((i={})[o]=t.getDefaultValue(s),i))}),{}):a.throwArgumentError("unknown type: ".concat(e),"type",e)},e}();t.DefaultGetter=c},7886:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getNextLayer=t.getRoot=t.fillArray=t.hashConcat=t.bufferKeccak=t.hexToBuffer=t.bufferToHex=t.chunk=t.makeArray=void 0;var s=r(6371);t.makeArray=function(e,t){return Array(e).fill(0).map((function(e,r){return t(r)}))},t.chunk=function(e,r){return(0,t.makeArray)(Math.ceil(e.length/r),(function(t){return e.slice(t*r,(t+1)*r)}))},t.bufferToHex=function(e){return(0,s.hexlify)(e)},t.hexToBuffer=function(e){return n.from(e.slice(2),"hex")},t.bufferKeccak=function(e){return(0,t.hexToBuffer)((0,s.keccak256)(e))},t.hashConcat=function(e){return(0,t.bufferKeccak)((0,s.hexConcat)(e))},t.fillArray=function(e,t,r){return t>e.length&&e.push.apply(e,o([],i(Array(t-e.length).fill(r)),!1)),e},t.getRoot=function(e,r){if(void 0===r&&(r=!0),0===e.length)throw new Error("empty tree");for(var i=[e.map((function(e){var i=n.isBuffer(e)?e:(0,t.hexToBuffer)(e);return r?(0,t.bufferKeccak)(i):i}))];i[i.length-1].length>1;)i.push((0,t.getNextLayer)(i[i.length-1]));return i[i.length-1][0]},t.getNextLayer=function(e){return(0,t.chunk)(e,2).map(t.hashConcat)}},5154:function(e,t,r){"use strict";var n,i,o,s,a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)},u=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},l=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},c=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},h=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getAdvancedOrderNumeratorDenominator=t.generateFulfillOrdersFulfillments=t.fulfillAvailableOrders=t.validateAndSanitizeFromOrderStatus=t.fulfillStandardOrder=t.fulfillBasicOrder=t.shouldUseBasicFulfill=void 0;var f=r(7640),d=r(7452),p=r(8471),m=r(512),y=r(5498),g=r(1526),v=r(9919),b=r(9494),w=r(7591);t.shouldUseBasicFulfill=function(e,t){var r=e.offer,n=e.consideration,i=e.offerer;if(!t.eq(0))return!1;if(r.length>1||0===n.length)return!1;var o=h(h([],c(r),!1),c(n),!1),s=o.filter((function(e){var t=e.itemType;return[d.ItemType.ERC721,d.ItemType.ERC1155].includes(t)})),a=o.filter((function(e){var t=e.itemType;return(0,v.isCriteriaItem)(t)}));if((0,v.isNativeCurrencyItem)(r[0]))return!1;if(1!==s.length||0!==a.length)return!1;if(!(0,b.areAllCurrenciesSame)({offer:r,consideration:n}))return!1;var u=o.some((function(e){return e.startAmount!==e.endAmount}));if(u)return!1;var l=c(n),p=l[0],m=l.slice(1);if(p.recipient.toLowerCase()!==i.toLowerCase())return!1;if(n.length>1&&m.every((function(e){return e.itemType===r[0].itemType}))&&(0,b.totalItemsAmount)(m).endAmount.gt(r[0].endAmount))return!1;var y=o.filter(v.isCurrencyItem),g=y.filter((function(e){return e.itemType===d.ItemType.NATIVE})).every((function(e){return e.token===f.ethers.constants.AddressZero})),w=y.every((function(e){var t=e.identifierOrCriteria;return f.BigNumber.from(t).eq(0)})),A=s.filter((function(e){return e.itemType===d.ItemType.ERC721})).every((function(e){return"1"===e.endAmount}));return g&&w&&A};var A=((n={})[d.ItemType.ERC20]=((i={})[d.ItemType.ERC721]=d.BasicOrderRouteType.ERC721_TO_ERC20,i[d.ItemType.ERC1155]=d.BasicOrderRouteType.ERC1155_TO_ERC20,i),n[d.ItemType.ERC721]=((o={})[d.ItemType.NATIVE]=d.BasicOrderRouteType.ETH_TO_ERC721,o[d.ItemType.ERC20]=d.BasicOrderRouteType.ERC20_TO_ERC721,o),n[d.ItemType.ERC1155]=((s={})[d.ItemType.NATIVE]=d.BasicOrderRouteType.ETH_TO_ERC1155,s[d.ItemType.ERC20]=d.BasicOrderRouteType.ERC20_TO_ERC1155,s),n);function E(e,t){var r=t.isValidated,n=t.isCancelled,i=t.totalFilled,o=t.totalSize;if(o.gt(0)&&i.div(o).eq(1))throw new Error("The order you are trying to fulfill is already filled");if(n)throw new Error("The order you are trying to fulfill is cancelled");return r?{parameters:a({},e.parameters),signature:"0x"}:e}function T(e){var t=function(e){var t=e.sourceOrDestination,r=e.operator,n=void 0===r?"":r,i=e.token,o=e.identifier;return"".concat(t,"-").concat(n,"-").concat(i,"-").concat(o)},r={},n={};return e.forEach((function(e,n){var i=e.order,o=e.offererOperator,s=e.offerCriteria,a=(0,y.getItemToCriteriaMap)(i.parameters.offer,s);return i.parameters.offer.forEach((function(e,s){var u,l,f,d="".concat(t({sourceOrDestination:i.parameters.offerer,operator:o,token:e.token,identifier:null!==(l=null===(u=a.get(e))||void 0===u?void 0:u.identifier)&&void 0!==l?l:e.identifierOrCriteria})).concat((0,v.isErc721Item)(e.itemType)?s:"");r[d]=h(h([],c(null!==(f=r[d])&&void 0!==f?f:[]),!1),[{orderIndex:n,itemIndex:s}],!1)}))})),e.forEach((function(e,r){var i=e.order,o=e.considerationCriteria,s=e.tips,a=(0,y.getItemToCriteriaMap)(i.parameters.consideration,o);return h(h([],c(i.parameters.consideration),!1),c(s),!1).forEach((function(e,i){var o,s,u,l="".concat(t({sourceOrDestination:e.recipient,token:e.token,identifier:null!==(s=null===(o=a.get(e))||void 0===o?void 0:o.identifier)&&void 0!==s?s:e.identifierOrCriteria})).concat((0,v.isErc721Item)(e.itemType)?i:"");n[l]=h(h([],c(null!==(u=n[l])&&void 0!==u?u:[]),!1),[{orderIndex:r,itemIndex:i}],!1)}))})),{offerFulfillments:Object.values(r),considerationFulfillments:Object.values(n)}}t.fulfillBasicOrder=function(e,t){var r,n,i=e.order,o=e.seaportContract,s=e.offererBalancesAndApprovals,y=e.fulfillerBalancesAndApprovals,g=e.timeBasedItemParams,b=e.offererOperator,E=e.fulfillerOperator,T=e.signer,_=e.tips,k=void 0===_?[]:_,S=e.conduitKey,O=void 0===S?d.NO_CONDUIT:S,x=e.domain;return u(this,void 0,void 0,(function(){var e,u,d,_,S,C,I,P,B,R,M,N,L,F,D,U,H,j;return l(this,(function(l){switch(l.label){case 0:if(e=i.parameters,u=e.offer,d=e.consideration,_=h(h([],c(d),!1),c(k),!1),S=u[0],C=c(_),I=C[0],P=C.slice(1),void 0===(B=null===(r=A[S.itemType])||void 0===r?void 0:r[I.itemType]))throw new Error("Order parameters did not result in a valid basic fulfillment");return R=P.map((function(e){return{amount:e.startAmount,recipient:e.recipient}})),M=_.filter((function(e){return e.itemType!==u[0].itemType})),N=null===(n=(0,v.getSummedTokenAndIdentifierAmounts)({items:M,criterias:[],timeBasedItemParams:a(a({},g),{isConsiderationItem:!0})})[f.ethers.constants.AddressZero])||void 0===n?void 0:n[0],L=(0,m.validateBasicFulfillBalancesAndApprovals)({offer:u,consideration:_,offererBalancesAndApprovals:s,fulfillerBalancesAndApprovals:y,timeBasedItemParams:g,offererOperator:b,fulfillerOperator:E}),F={offerer:i.parameters.offerer,offererConduitKey:i.parameters.conduitKey,zone:i.parameters.zone,basicOrderType:i.parameters.orderType+4*B,offerToken:S.token,offerIdentifier:S.identifierOrCriteria,offerAmount:S.endAmount,considerationToken:I.token,considerationIdentifier:I.identifierOrCriteria,considerationAmount:I.endAmount,startTime:i.parameters.startTime,endTime:i.parameters.endTime,salt:i.parameters.salt,totalOriginalAdditionalRecipients:i.parameters.consideration.length-1,signature:i.signature,fulfillerConduitKey:O,additionalRecipients:R,zoneHash:i.parameters.zoneHash},D={value:N},[4,(0,p.getApprovalActions)(L,t,T)];case 1:return U=l.sent(),H={type:"exchange",transactionMethods:(0,w.getTransactionMethods)(o.connect(T),"fulfillBasicOrder",[F,D],x)},[2,{actions:j=h(h([],c(U),!1),[H],!1),executeAllActions:function(){return(0,w.executeAllActions)(j)}}]}}))}))},t.fulfillStandardOrder=function(e,r){var n,i=e.order,o=e.unitsToFill,s=void 0===o?0:o,d=e.totalSize,g=e.totalFilled,A=e.offerCriteria,E=e.considerationCriteria,T=e.tips,_=void 0===T?[]:T,k=e.extraData,S=e.seaportContract,O=e.offererBalancesAndApprovals,x=e.fulfillerBalancesAndApprovals,C=e.offererOperator,I=e.fulfillerOperator,P=e.timeBasedItemParams,B=e.conduitKey,R=e.recipientAddress,M=e.signer,N=e.domain;return u(this,void 0,void 0,(function(){var e,o,u,T,L,F,D,U,H,j,z,K,G,q,V,W,J,Y,Q,Z;return l(this,(function(l){switch(l.label){case 0:if(e=s?(0,b.mapOrderAmountsFromUnitsToFill)(i,{unitsToFill:s,totalSize:d}):(0,b.mapOrderAmountsFromFilledStatus)(i,{totalFilled:g,totalSize:d}),o=e.parameters,u=o.offer,T=o.consideration,L=h(h([],c(T),!1),c(_),!1),F=u.filter((function(e){var t=e.itemType;return(0,v.isCriteriaItem)(t)})),D=L.filter((function(e){var t=e.itemType;return(0,v.isCriteriaItem)(t)})),U=F.length>0||D.length>0,F.length!==A.length||D.length!==E.length)throw new Error("You must supply the appropriate criterias for criteria based items");return H=null===(n=(0,v.getSummedTokenAndIdentifierAmounts)({items:L,criterias:E,timeBasedItemParams:a(a({},P),{isConsiderationItem:!0})})[f.ethers.constants.AddressZero])||void 0===n?void 0:n[0],j=(0,m.validateStandardFulfillBalancesAndApprovals)({offer:u,consideration:L,offerCriteria:A,considerationCriteria:E,offererBalancesAndApprovals:O,fulfillerBalancesAndApprovals:x,timeBasedItemParams:P,offererOperator:C,fulfillerOperator:I}),z={value:H},[4,(0,p.getApprovalActions)(j,r,M)];case 1:return K=l.sent(),G=R!==f.ethers.constants.AddressZero,q=Boolean(s)||U||G,V=a(a({},i),{parameters:a(a({},i.parameters),{consideration:h(h([],c(i.parameters.consideration),!1),c(_),!1),totalOriginalConsiderationItems:T.length})}),W=(0,t.getAdvancedOrderNumeratorDenominator)(i,s),J=W.numerator,Y=W.denominator,Q={type:"exchange",transactionMethods:q?(0,w.getTransactionMethods)(S.connect(M),"fulfillAdvancedOrder",[a(a({},V),{numerator:J,denominator:Y,extraData:null!=k?k:"0x"}),U?(0,y.generateCriteriaResolvers)({orders:[i],offerCriterias:[A],considerationCriterias:[E]}):[],B,R,z],N):(0,w.getTransactionMethods)(S.connect(M),"fulfillOrder",[V,B,z],N)},[2,{actions:Z=h(h([],c(K),!1),[Q],!1),executeAllActions:function(){return(0,w.executeAllActions)(Z)}}]}}))}))},t.validateAndSanitizeFromOrderStatus=E,t.fulfillAvailableOrders=function(e){var r=e.ordersMetadata,n=e.seaportContract,i=e.fulfillerBalancesAndApprovals,o=e.fulfillerOperator,s=e.currentBlockTimestamp,d=e.ascendingAmountTimestampBuffer,g=e.conduitKey,A=e.signer,_=e.recipientAddress,k=e.exactApproval,S=e.domain;return u(this,void 0,void 0,(function(){var e,u,O,x,C,I,P,B,R,M,N,L,F,D,U;return l(this,(function(l){switch(l.label){case 0:return e=r.map((function(e){return a(a({},e),{order:E(e.order,e.orderStatus)})})),u=e.map((function(e){return a(a({},e),{order:e.unitsToFill?(0,b.mapOrderAmountsFromUnitsToFill)(e.order,{unitsToFill:e.unitsToFill,totalSize:e.orderStatus.totalSize}):(0,b.mapOrderAmountsFromFilledStatus)(e.order,{totalFilled:e.orderStatus.totalFilled,totalSize:e.orderStatus.totalSize})})})),O=f.BigNumber.from(0),x=[],C=e.flatMap((function(e){return[e.order.parameters.offer,e.order.parameters.consideration]})).flat().filter((function(e){var t=e.itemType;return(0,v.isCriteriaItem)(t)})),I=C.length>0,P=function(e){e.forEach((function(e){x.find((function(t){return t.token===e.token}))||x.push(e)}))},u.forEach((function(e){var t,r,n=e.order,a=e.tips,u=e.offerCriteria,l=e.considerationCriteria,p=e.offererBalancesAndApprovals,y=e.offererOperator,g=h(h([],c(n.parameters.consideration),!1),c(a),!1),b={startTime:n.parameters.startTime,endTime:n.parameters.endTime,currentBlockTimestamp:s,ascendingAmountTimestampBuffer:d,isConsiderationItem:!0};O=O.add(null!==(r=null===(t=(0,v.getSummedTokenAndIdentifierAmounts)({items:g,criterias:l,timeBasedItemParams:b})[f.ethers.constants.AddressZero])||void 0===t?void 0:t[0])&&void 0!==r?r:f.BigNumber.from(0));var w=(0,m.validateStandardFulfillBalancesAndApprovals)({offer:n.parameters.offer,consideration:g,offerCriteria:u,considerationCriteria:l,offererBalancesAndApprovals:p,fulfillerBalancesAndApprovals:i,timeBasedItemParams:b,offererOperator:y,fulfillerOperator:o}),A=n.parameters.offer.filter((function(e){var t=e.itemType;return(0,v.isCriteriaItem)(t)})),E=g.filter((function(e){var t=e.itemType;return(0,v.isCriteriaItem)(t)}));if(A.length!==u.length||E.length!==l.length)throw new Error("You must supply the appropriate criterias for criteria based items");P(w)})),B={value:O},[4,(0,p.getApprovalActions)(x,k,A)];case 1:return R=l.sent(),M=e.map((function(e){var r=e.order,n=e.unitsToFill,i=void 0===n?0:n,o=e.tips,s=e.extraData,u=(0,t.getAdvancedOrderNumeratorDenominator)(r,i),l=u.numerator,f=u.denominator,d=h(h([],c(r.parameters.consideration),!1),c(o),!1);return a(a({},r),{parameters:a(a({},r.parameters),{consideration:d,totalOriginalConsiderationItems:r.parameters.consideration.length}),numerator:l,denominator:f,extraData:s})})),N=T(r),L=N.offerFulfillments,F=N.considerationFulfillments,D={type:"exchange",transactionMethods:(0,w.getTransactionMethods)(n.connect(A),"fulfillAvailableAdvancedOrders",[M,I?(0,y.generateCriteriaResolvers)({orders:r.map((function(e){return e.order})),offerCriterias:r.map((function(e){return e.offerCriteria})),considerationCriterias:r.map((function(e){return e.considerationCriteria}))}):[],L,F,g,_,M.length,B],S)},[2,{actions:U=h(h([],c(R),!1),[D],!1),executeAllActions:function(){return(0,w.executeAllActions)(U)}}]}}))}))},t.generateFulfillOrdersFulfillments=T,t.getAdvancedOrderNumeratorDenominator=function(e,t){var r=(0,v.getMaximumSizeForOrder)(e),n=f.BigNumber.from(t),i=(0,g.gcd)(n,r);return{numerator:t?n.div(i):f.BigNumber.from(1),denominator:t?r.div(i):f.BigNumber.from(1)}}},1526:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findGcd=t.gcd=void 0;var n=r(7640);t.gcd=function(e,r){var i=n.BigNumber.from(e),o=n.BigNumber.from(r);return i.eq(0)?o:(0,t.gcd)(o.mod(e),i)},t.findGcd=function(e){for(var r=n.BigNumber.from(e[0]),i=1;i<e.length;i++)if((r=(0,t.gcd)(e[i],r)).eq(1))return r;return r}},9919:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getMaximumSizeForOrder=t.getSummedTokenAndIdentifierAmounts=t.getPresentItemAmount=t.isCriteriaItem=t.isErc1155Item=t.isErc721Item=t.isErc20Item=t.isNativeCurrencyItem=t.isCurrencyItem=void 0;var s=r(7640),a=r(7452),u=r(5498),l=r(1526);t.isCurrencyItem=function(e){var t=e.itemType;return[a.ItemType.NATIVE,a.ItemType.ERC20].includes(t)},t.isNativeCurrencyItem=function(e){return e.itemType===a.ItemType.NATIVE},t.isErc20Item=function(e){return e===a.ItemType.ERC20},t.isErc721Item=function(e){return[a.ItemType.ERC721,a.ItemType.ERC721_WITH_CRITERIA].includes(e)},t.isErc1155Item=function(e){return[a.ItemType.ERC1155,a.ItemType.ERC1155_WITH_CRITERIA].includes(e)},t.isCriteriaItem=function(e){return[a.ItemType.ERC721_WITH_CRITERIA,a.ItemType.ERC1155_WITH_CRITERIA].includes(e)},t.getPresentItemAmount=function(e){var t=e.startAmount,r=e.endAmount,n=e.timeBasedItemParams,i=s.BigNumber.from(t),o=s.BigNumber.from(r);if(!n)return i.gt(o)?i:o;var a=n.isConsiderationItem,u=n.currentBlockTimestamp,l=n.ascendingAmountTimestampBuffer,c=n.startTime,h=n.endTime,f=s.BigNumber.from(h).sub(c),d=o.gt(t),p=s.BigNumber.from(d?u+l:u);if(p.lt(c))return i;var m=(p.gt(h)?s.BigNumber.from(h):p).sub(c),y=f.sub(m);return i.mul(y).add(o.mul(m)).add(a?f.sub(1):0).div(f)},t.getSummedTokenAndIdentifierAmounts=function(e){var r=e.items,i=e.criterias,o=e.timeBasedItemParams,a=(0,u.getItemToCriteriaMap)(r,i),l=r.reduce((function(e,r){var i,u,l,c,h,f,d=null!==(c=null===(l=a.get(r))||void 0===l?void 0:l.identifier)&&void 0!==c?c:r.identifierOrCriteria;return n(n({},e),((i={})[r.token]=n(n({},e[r.token]),((u={})[d]=(null!==(f=null===(h=e[r.token])||void 0===h?void 0:h[d])&&void 0!==f?f:s.BigNumber.from(0)).add((0,t.getPresentItemAmount)({startAmount:r.startAmount,endAmount:r.endAmount,timeBasedItemParams:o})),u)),i))}),{});return l},t.getMaximumSizeForOrder=function(e){var t=e.parameters,r=t.offer,n=t.consideration,s=o(o([],i(r),!1),i(n),!1).flatMap((function(e){return[e.startAmount,e.endAmount]}));return(0,l.findGcd)(s)}},6630:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleTree=void 0;var o=r(7640),s=r(6371),a=i(r(2162)),u=function(e){return(0,s.keccak256)(n.from(o.BigNumber.from(e).toHexString().slice(2).padStart(64,"0"),"hex"))},l=function(){function e(e){this.tree=new a.default(e.map(u),s.keccak256,{sort:!0})}return e.prototype.getProof=function(e){return this.tree.getHexProof(u(e))},e.prototype.getRoot=function(){return this.tree.getRoot().toString("hex")?this.tree.getHexRoot():"0"},e}();t.MerkleTree=l},9494:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},s=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseMatchForFulfill=t.generateRandomSaltWithDomain=t.generateRandomSalt=t.mapOrderAmountsFromUnitsToFill=t.mapOrderAmountsFromFilledStatus=t.totalItemsAmount=t.areAllCurrenciesSame=t.mapInputItemToOfferItem=t.deductFees=t.feeToConsiderationItem=void 0;var a=r(7640),u=r(6371),l=r(7452),c=r(9919),h=r(6630),f=function(e,t){return a.BigNumber.from(e).mul(a.BigNumber.from(t)).div(l.ONE_HUNDRED_PERCENT_BP)};t.feeToConsiderationItem=function(e){var t=e.fee,r=e.token,n=e.baseAmount,i=e.baseEndAmount,o=void 0===i?n:i;return{itemType:r===a.ethers.constants.AddressZero?l.ItemType.NATIVE:l.ItemType.ERC20,token:r,identifierOrCriteria:"0",startAmount:f(n,t.basisPoints).toString(),endAmount:f(o,t.basisPoints).toString(),recipient:t.recipient}},t.deductFees=function(e,t){if(!t)return e;var r=t.reduce((function(e,t){return e+t.basisPoints}),0);return e.map((function(e){return i(i({},e),{startAmount:(0,c.isCurrencyItem)(e)?a.BigNumber.from(e.startAmount).sub(f(e.startAmount,r)).toString():e.startAmount,endAmount:(0,c.isCurrencyItem)(e)?a.BigNumber.from(e.endAmount).sub(f(e.endAmount,r)).toString():e.endAmount})}))},t.mapInputItemToOfferItem=function(e){var t,r,n,i,o,s,u;if("itemType"in e){if("identifiers"in e||"criteria"in e){var c="criteria"in e?e.criteria:new h.MerkleTree(e.identifiers).getRoot();return{itemType:e.itemType===l.ItemType.ERC721?l.ItemType.ERC721_WITH_CRITERIA:l.ItemType.ERC1155_WITH_CRITERIA,token:e.token,identifierOrCriteria:c,startAmount:null!==(t=e.amount)&&void 0!==t?t:"1",endAmount:null!==(n=null!==(r=e.endAmount)&&void 0!==r?r:e.amount)&&void 0!==n?n:"1"}}return"amount"in e||"endAmount"in e?{itemType:e.itemType,token:e.token,identifierOrCriteria:e.identifier,startAmount:e.amount,endAmount:null!==(o=null!==(i=e.endAmount)&&void 0!==i?i:e.amount)&&void 0!==o?o:"1"}:{itemType:e.itemType,token:e.token,identifierOrCriteria:e.identifier,startAmount:"1",endAmount:"1"}}return{itemType:e.token&&e.token!==a.ethers.constants.AddressZero?l.ItemType.ERC20:l.ItemType.NATIVE,token:null!==(s=e.token)&&void 0!==s?s:a.ethers.constants.AddressZero,identifierOrCriteria:"0",startAmount:e.amount,endAmount:null!==(u=e.endAmount)&&void 0!==u?u:e.amount}},t.areAllCurrenciesSame=function(e){var t=e.offer,r=e.consideration,n=s(s([],o(t),!1),o(r),!1).filter(c.isCurrencyItem);return n.every((function(e){var t=e.itemType,r=e.token;return t===n[0].itemType&&r.toLowerCase()===n[0].token.toLowerCase()}))},t.totalItemsAmount=function(e){return a.BigNumber.from(0),a.BigNumber.from(0),e.map((function(e){return{startAmount:e.startAmount,endAmount:e.endAmount}})).reduce((function(e,t){var r=e.startAmount,n=e.endAmount,i=t.startAmount,o=t.endAmount;return{startAmount:r.add(i),endAmount:n.add(o)}}),{startAmount:a.BigNumber.from(0),endAmount:a.BigNumber.from(0)})},t.mapOrderAmountsFromFilledStatus=function(e,t){var r=t.totalFilled,n=t.totalSize;if(r.eq(0)||n.eq(0))return e;var o=n.sub(r).mul(l.ONE_HUNDRED_PERCENT_BP).div(n);return{parameters:i(i({},e.parameters),{offer:e.parameters.offer.map((function(e){return i(i({},e),{startAmount:f(e.startAmount,o).toString(),endAmount:f(e.endAmount,o).toString()})})),consideration:e.parameters.consideration.map((function(e){return i(i({},e),{startAmount:f(e.startAmount,o).toString(),endAmount:f(e.endAmount,o).toString()})}))}),signature:e.signature}};var d=function(e,t,r){return a.BigNumber.from(e).mul(a.BigNumber.from(t)).div(r)};t.mapOrderAmountsFromUnitsToFill=function(e,t){var r=t.unitsToFill,n=t.totalSize,o=a.BigNumber.from(r);if(o.lte(0))throw new Error("Units to fill must be greater than 1");var s=(0,c.getMaximumSizeForOrder)(e);return n.eq(0)&&(n=s),{parameters:i(i({},e.parameters),{offer:e.parameters.offer.map((function(e){return i(i({},e),{startAmount:d(e.startAmount,o,n).toString(),endAmount:d(e.endAmount,o,n).toString()})})),consideration:e.parameters.consideration.map((function(e){return i(i({},e),{startAmount:d(e.startAmount,o,n).toString(),endAmount:d(e.endAmount,o,n).toString()})}))}),signature:e.signature}},t.generateRandomSalt=function(){return"0x".concat(n.from((0,u.randomBytes)(8)).toString("hex").padStart(24,"0"))},t.generateRandomSaltWithDomain=function(e){return"0x".concat(n.from((0,u.concat)([(0,u.keccak256)((0,u.toUtf8Bytes)(e)).slice(0,10),Uint8Array.from(Array(20).fill(0)),(0,u.randomBytes)(8)])).toString("hex"))},t.shouldUseMatchForFulfill=function(){return!0}},7591:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getTagFromDomain=t.getTransactionMethods=t.executeAllActions=void 0;var u=r(6371);t.executeAllActions=function(e){return i(void 0,void 0,void 0,(function(){var t,r,n;return o(this,(function(i){switch(i.label){case 0:t=0,i.label=1;case 1:return t<e.length-1?"approval"!==(r=e[t]).type?[3,4]:[4,r.transactionMethods.transact()]:[3,5];case 2:return[4,i.sent().wait()];case 3:i.sent(),i.label=4;case 4:return t++,[3,1];case 5:switch((n=e[e.length-1]).type){case"create":return[2,n.createOrder()];case"createBulk":return[2,n.createBulkOrders()];default:return[2,n.transactionMethods.transact()]}return[2]}}))}))},t.getTransactionMethods=function(e,r,u,l){void 0===l&&(l="");var c,h,f,d=u[u.length-1];f=["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","type","accessList","customData","ccipReadEnabled","value","blockTag","CallOverrides"],(void 0===(h=d)||Object.keys(h).every((function(e){return f.includes(e)})))&&(c=d,u.pop());var p=function(h){return i(void 0,void 0,void 0,(function(){var i,f,d,p;return o(this,(function(o){switch(o.label){case 0:return i=n(n({},c),h),[4,(p=e.populateTransaction)[r].apply(p,a([],s(a(a([],s(u),!1),[i],!1)),!1))];case 1:return f=o.sent(),d=(0,t.getTagFromDomain)(l),f.data=f.data+d,[2,f]}}))}))};return{callStatic:function(t){var i,o=n(n({},c),t);return(i=e.callStatic)[r].apply(i,a([],s(a(a([],s(u),!1),[o],!1)),!1))},estimateGas:function(t){var i,o=n(n({},c),t);return(i=e.estimateGas)[r].apply(i,a([],s(a(a([],s(u),!1),[o],!1)),!1))},transact:function(t){return i(void 0,void 0,void 0,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:return r=n(n({},c),t),[4,p(r)];case 1:return i=o.sent(),[2,e.signer.sendTransaction(i)]}}))}))},buildTransaction:p}},t.getTagFromDomain=function(e){return(0,u.keccak256)((0,u.toUtf8Bytes)(e)).slice(2,10)}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),c=0,h=u>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;a<l;a+=s)o.push(u(e,a,a+s>l?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2882:e=>{"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<32;n++){var i=t.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function o(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}for(t=o(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=o(t)^31&i}return t}function a(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var a=(e=n).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var u=e.slice(0,a),l=e.slice(a+1);if(l.length<6)return"Data too short";var c=s(u);if("string"==typeof c)return c;for(var h=[],f=0;f<l.length;++f){var d=l.charAt(f),p=r[d];if(void 0===p)return"Unknown character "+d;c=o(c)^p,f+6>=l.length||h.push(p)}return 1!==c?"Invalid checksum for "+e:{prefix:u,words:h}}function u(e,t,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=t)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}e.exports={decodeUnsafe:function(){var e=a.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=a.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,r,n){if(n=n||90,e.length+7+r.length>n)throw new TypeError("Exceeds length limit");var i=s(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var a=e+"1",u=0;u<r.length;++u){var l=r[u];if(l>>5!=0)throw new Error("Non 5-bit word");i=o(i)^l,a+=t.charAt(l)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u)a+=t.charAt(i>>5*(5-u)&31);return a},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},3550:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function l(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u<a;u++){var l=e.charCodeAt(u)-48;o*=i,s=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s<i,"Invalid character"),o+=s}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c<a;c+=n)u=l(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=l(e,c,e.length,t),c=0;c<s;c++)h*=t;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){c(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(e){o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","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"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var l=1;l<n;l++){for(var c=u>>>26,h=67108863&u,f=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=f;d++){var p=l-d|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[d])+h)/67108864|0,h=67108863&s}r.words[l]=0|h,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=d[e],c=p[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modrn(c).toString(e);r=(h=h.idivn(c)).isZero()?m+r:f[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var y=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,l=0,c=0|s[0],h=8191&c,f=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,y=0|s[2],g=8191&y,v=y>>>13,b=0|s[3],w=8191&b,A=b>>>13,E=0|s[4],T=8191&E,_=E>>>13,k=0|s[5],S=8191&k,O=k>>>13,x=0|s[6],C=8191&x,I=x>>>13,P=0|s[7],B=8191&P,R=P>>>13,M=0|s[8],N=8191&M,L=M>>>13,F=0|s[9],D=8191&F,U=F>>>13,H=0|a[0],j=8191&H,z=H>>>13,K=0|a[1],G=8191&K,q=K>>>13,V=0|a[2],W=8191&V,J=V>>>13,Y=0|a[3],Q=8191&Y,Z=Y>>>13,X=0|a[4],$=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,le=ae>>>13,ce=0|a[8],he=8191&ce,fe=ce>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(l+(n=Math.imul(h,j))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(f,j)|0))<<13)|0;l=((o=Math.imul(f,z))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,j),i=(i=Math.imul(p,z))+Math.imul(m,j)|0,o=Math.imul(m,z);var ge=(l+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(f,G)|0))<<13)|0;l=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,j),i=(i=Math.imul(g,z))+Math.imul(v,j)|0,o=Math.imul(v,z),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,q)|0;var ve=(l+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,W)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,j),i=(i=Math.imul(w,z))+Math.imul(A,j)|0,o=Math.imul(A,z),n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0;var be=(l+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,Q)|0))<<13)|0;l=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(T,j),i=(i=Math.imul(T,z))+Math.imul(_,j)|0,o=Math.imul(_,z),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(l+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(f,$)|0))<<13)|0;l=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,j),i=(i=Math.imul(S,z))+Math.imul(O,j)|0,o=Math.imul(O,z),n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var Ae=(l+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(f,re)|0))<<13)|0;l=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,j),i=(i=Math.imul(C,z))+Math.imul(I,j)|0,o=Math.imul(I,z),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Ee=(l+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(f,oe)|0))<<13)|0;l=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,j),i=(i=Math.imul(B,z))+Math.imul(R,j)|0,o=Math.imul(R,z),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Te=(l+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(f,ue)|0))<<13)|0;l=((o=o+Math.imul(f,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(N,j),i=(i=Math.imul(N,z))+Math.imul(L,j)|0,o=Math.imul(L,z),n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,q)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,le)|0;var _e=(l+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(f,he)|0))<<13)|0;l=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(D,j),i=(i=Math.imul(D,z))+Math.imul(U,j)|0,o=Math.imul(U,z),n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,le)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,fe)|0;var ke=(l+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(f,pe)|0))<<13)|0;l=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,q))+Math.imul(U,G)|0,o=Math.imul(U,q),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,le)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,fe)|0;var Se=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,J))+Math.imul(U,W)|0,o=Math.imul(U,J),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,le)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,fe)|0;var Oe=(l+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,pe)|0))<<13)|0;l=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,Z))+Math.imul(U,Q)|0,o=Math.imul(U,Z),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,le)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,fe)|0;var xe=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,le)|0,n=n+Math.imul(S,he)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(O,he)|0,o=o+Math.imul(O,fe)|0;var Ce=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(_,pe)|0))<<13)|0;l=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,se)|0,n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,le)|0,n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(I,he)|0,o=o+Math.imul(I,fe)|0;var Ie=(l+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(O,pe)|0))<<13)|0;l=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,le)|0,n=n+Math.imul(B,he)|0,i=(i=i+Math.imul(B,fe)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,fe)|0;var Pe=(l+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;l=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,le))+Math.imul(U,ue)|0,o=Math.imul(U,le),n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(L,he)|0,o=o+Math.imul(L,fe)|0;var Be=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(R,pe)|0))<<13)|0;l=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(D,he),i=(i=Math.imul(D,fe))+Math.imul(U,he)|0,o=Math.imul(U,fe);var Re=(l+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(L,pe)|0))<<13)|0;l=((o=o+Math.imul(L,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Me=(l+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,me))+Math.imul(U,pe)|0))<<13)|0;return l=((o=Math.imul(U,me))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=Ee,u[7]=Te,u[8]=_e,u[9]=ke,u[10]=Se,u[11]=Oe,u[12]=xe,u[13]=Ce,u[14]=Ie,u[15]=Pe,u[16]=Be,u[17]=Re,u[18]=Me,0!==l&&(u[19]=l,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var c=o-l,h=(0|e.words[c])*(0|t.words[l]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(y=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?m(this,e,t):r<1024?g(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),l=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var h=u,f=l,d=0;d<s;d++){var p=r[c+d],m=n[c+d],y=r[c+d+s],g=n[c+d+s],v=h*y-f*g;g=h*g+f*y,y=v,r[c+d]=p+y,n[c+d]=m+g,r[c+d+s]=p-y,n[c+d+s]=m-g,d!==a&&(v=u*h-l*f,f=u*f+l*h,h=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),l=new Array(n),c=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,l,n),this.transform(s,o,a,u,n,i),this.transform(l,o,c,h,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var l=0;l<s;l++)u.words[l]=this.words[l];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var l=0;l<a.length;l++)a.words[l]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var f=0,d=1;0==(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function A(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function T(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){S.call(this,e),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)}A.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},i(E,A),E.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(T,A),i(_,A),i(k,A),k.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new T;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var m=d,y=0;0!==m.cmp(a);y++)m=m.redSqr();n(y<p);var g=this.pow(h,new o(1).iushln(p-y-1));f=f.redMul(g),h=g.redSqr(),d=d.redMul(h),p=y}return f},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var h=l>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,S),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6351:(e,t,r)=>{var n=r(8764).Buffer;e.exports=function(e){for(var t=new n(e.length),r=0,i=e.length-1;r<=i;++r,--i)t[r]=e[i],t[i]=e[r];return t}},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?a(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return c(e),a(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(i)return n?-1:V(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(l(e,o)===l(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(l(e,o+n)!==l(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Q(n))return s;e[r+s]=n}return s}function A(e,t,r,n){return J(V(t,e.length-r),e,r,n)}function E(e,t,r,n){return J(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function T(e,t,r,n){return J(W(t),e,r,n)}function _(e,t,r,n){return J(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return h(e)},u.allocUnsafeSlow=function(e){return h(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Y(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).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}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(Y(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==c[e]){o=l[e],s=c[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function x(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function C(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function P(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function B(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n,i){z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function N(e,t,r,n,i){z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const U={};function H(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function j(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function z(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,i,o)}function K(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw K(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}H("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),H("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),H("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=j(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},452:function(e,t,r){var n;e.exports=(n=r(8249),r(8269),r(8214),r(888),r(5109),function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],s=[],a=[],u=[],l=[],c=[],h=[],f=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var m=e[r],y=e[m],g=e[y],v=257*e[p]^16843008*p;s[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,u[r]=v<<8|v>>>24,l[r]=v,v=16843009*g^65537*y^257*m^16843008*r,c[p]=v<<24|v>>>8,h[p]=v<<16|v>>>16,f[p]=v<<8|v>>>24,d[p]=v,r?(r=m^e[e[e[g^m]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s<n;s++)if(s<r)o[s]=t[s];else{var a=o[s-1];s%r?r>6&&s%r==4&&(a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a]):(a=i[(a=a<<8|a>>>24)>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a],a^=p[s/r|0]<<24),o[s]=o[s-r]^a}for(var u=this._invKeySchedule=[],l=0;l<n;l++)s=n-l,a=l%4?o[s]:o[s-4],u[l]=l<4||s<=4?a:c[i[a>>>24]]^h[i[a>>>16&255]]^f[i[a>>>8&255]]^d[i[255&a]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,u,l,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,c,h,f,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,s,a){for(var u=this._nRounds,l=e[t]^r[0],c=e[t+1]^r[1],h=e[t+2]^r[2],f=e[t+3]^r[3],d=4,p=1;p<u;p++){var m=n[l>>>24]^i[c>>>16&255]^o[h>>>8&255]^s[255&f]^r[d++],y=n[c>>>24]^i[h>>>16&255]^o[f>>>8&255]^s[255&l]^r[d++],g=n[h>>>24]^i[f>>>16&255]^o[l>>>8&255]^s[255&c]^r[d++],v=n[f>>>24]^i[l>>>16&255]^o[c>>>8&255]^s[255&h]^r[d++];l=m,c=y,h=g,f=v}m=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[d++],y=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&l])^r[d++],g=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^r[d++],v=(a[f>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[d++],e[t]=m,e[t+1]=y,e[t+2]=g,e[t+3]=v},keySize:8});e.AES=t._createHelper(m)}(),n.AES)},5109:function(e,t,r){var n,i,o,s,a,u,l,c,h,f,d,p,m,y,g,v,b,w,A;e.exports=(n=r(8249),r(888),void(n.lib.Cipher||(i=n,o=i.lib,s=o.Base,a=o.WordArray,u=o.BufferedBlockAlgorithm,l=i.enc,l.Utf8,c=l.Base64,h=i.algo.EvpKDF,f=o.Cipher=u.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){u.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?A:b}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),o.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=i.mode={},p=o.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=d.CBC=function(){var e=p.extend();function t(e,t,r){var n=this._iv;if(n){var i=n;this._iv=void 0}else i=this._prevBlock;for(var o=0;o<r;o++)e[t+o]^=i[o]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i),n.encryptBlock(e,r),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=e.slice(r,r+i);n.decryptBlock(e,r),t.call(this,e,r,i),this._prevBlock=o}}),e}(),y=(i.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,o=[],s=0;s<n;s+=4)o.push(i);var u=a.create(o,n);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},o.BlockCipher=f.extend({cfg:f.cfg.extend({mode:m,padding:y}),reset:function(){f.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else n=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4}),g=o.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),v=(i.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else n=t;return n.toString(c)},parse:function(e){var t=c.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return g.create({ciphertext:t,salt:n})}},b=o.SerializableCipher=s.extend({cfg:s.extend({format:v}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),s=i.cfg;return g.create({ciphertext:o,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),w=(i.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=h.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,g.create({key:i,iv:o,salt:n})}},A=o.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:w}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=b.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,b.decrypt.call(this,e,t,i.key,n)}}))))},8249:function(e,t){var r;e.exports=(r=r||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o<i;o+=4)t[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o<t;o+=4){var a=i(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new s.init(n,t)}}),a=n.enc={},u=a.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new s.init(r,t/2)}},l=a.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new s.init(r,t)}},c=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,a=i/(4*o),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*u,i);if(u){for(var c=0;c<u;c+=o)this._doProcessBlock(n,c);var h=n.splice(0,u);r.sigBytes-=l}return new s.init(h,l)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),f=(i.Hasher=h.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new f.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math),r)},8269:function(e,t,r){var n,i,o;e.exports=(n=r(8249),o=(i=n).lib.WordArray,i.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o<r;o+=3)for(var s=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<r;a++)i.push(n.charAt(s>>>6*(3-a)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var i=0;i<r.length;i++)n[r.charCodeAt(i)]=i}var s=r.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return function(e,t,r){for(var n=[],i=0,s=0;s<t;s++)if(s%4){var a=r[e.charCodeAt(s-1)]<<s%4*2,u=r[e.charCodeAt(s)]>>>6-s%4*2;n[i>>>2]|=(a|u)<<24-i%4*8,i++}return o.create(n,i)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)},298:function(e,t,r){var n;e.exports=(n=r(8249),function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var o=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},r.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var s=i(t[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o<r;o++)n[o>>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),n.enc.Utf16)},888:function(e,t,r){var n,i,o,s,a,u,l,c;e.exports=(c=r(8249),r(2783),r(9824),o=(i=(n=c).lib).Base,s=i.WordArray,u=(a=n.algo).MD5,l=a.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:u,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),i=s.create(),o=i.words,a=r.keySize,u=r.iterations;o.length<a;){l&&n.update(l);var l=n.update(e).finalize(t);n.reset();for(var c=1;c<u;c++)l=n.finalize(l),n.reset();i.concat(l)}return i.sigBytes=4*a,i}}),n.EvpKDF=function(e,t,r){return l.create(r).compute(e,t)},c.EvpKDF)},2209:function(e,t,r){var n,i,o,s;e.exports=(s=r(8249),r(5109),i=(n=s).lib.CipherParams,o=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}},s.format.Hex)},9824:function(e,t,r){var n,i,o;e.exports=(i=(n=r(8249)).lib.Base,o=n.enc.Utf8,void(n.algo.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),s=this._iKey=t.clone(),a=i.words,u=s.words,l=0;l<r;l++)a[l]^=1549556828,u[l]^=909522486;i.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))},1354:function(e,t,r){var n;e.exports=(n=r(8249),r(4938),r(4433),r(298),r(8269),r(8214),r(2783),r(2153),r(7792),r(34),r(7460),r(3327),r(706),r(9824),r(2112),r(888),r(5109),r(8568),r(493),r(9968),r(7660),r(1148),r(3615),r(2807),r(1077),r(6475),r(6991),r(2209),r(452),r(4253),r(1857),r(4454),r(3974),n)},4433:function(e,t,r){var n;e.exports=(n=r(8249),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init,r=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)};r.prototype=e}}(),n.lib.WordArray)},8214:function(e,t,r){var n;e.exports=(n=r(8249),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var u=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],u=e[t+1],d=e[t+2],p=e[t+3],m=e[t+4],y=e[t+5],g=e[t+6],v=e[t+7],b=e[t+8],w=e[t+9],A=e[t+10],E=e[t+11],T=e[t+12],_=e[t+13],k=e[t+14],S=e[t+15],O=o[0],x=o[1],C=o[2],I=o[3];O=l(O,x,C,I,s,7,a[0]),I=l(I,O,x,C,u,12,a[1]),C=l(C,I,O,x,d,17,a[2]),x=l(x,C,I,O,p,22,a[3]),O=l(O,x,C,I,m,7,a[4]),I=l(I,O,x,C,y,12,a[5]),C=l(C,I,O,x,g,17,a[6]),x=l(x,C,I,O,v,22,a[7]),O=l(O,x,C,I,b,7,a[8]),I=l(I,O,x,C,w,12,a[9]),C=l(C,I,O,x,A,17,a[10]),x=l(x,C,I,O,E,22,a[11]),O=l(O,x,C,I,T,7,a[12]),I=l(I,O,x,C,_,12,a[13]),C=l(C,I,O,x,k,17,a[14]),O=c(O,x=l(x,C,I,O,S,22,a[15]),C,I,u,5,a[16]),I=c(I,O,x,C,g,9,a[17]),C=c(C,I,O,x,E,14,a[18]),x=c(x,C,I,O,s,20,a[19]),O=c(O,x,C,I,y,5,a[20]),I=c(I,O,x,C,A,9,a[21]),C=c(C,I,O,x,S,14,a[22]),x=c(x,C,I,O,m,20,a[23]),O=c(O,x,C,I,w,5,a[24]),I=c(I,O,x,C,k,9,a[25]),C=c(C,I,O,x,p,14,a[26]),x=c(x,C,I,O,b,20,a[27]),O=c(O,x,C,I,_,5,a[28]),I=c(I,O,x,C,d,9,a[29]),C=c(C,I,O,x,v,14,a[30]),O=h(O,x=c(x,C,I,O,T,20,a[31]),C,I,y,4,a[32]),I=h(I,O,x,C,b,11,a[33]),C=h(C,I,O,x,E,16,a[34]),x=h(x,C,I,O,k,23,a[35]),O=h(O,x,C,I,u,4,a[36]),I=h(I,O,x,C,m,11,a[37]),C=h(C,I,O,x,v,16,a[38]),x=h(x,C,I,O,A,23,a[39]),O=h(O,x,C,I,_,4,a[40]),I=h(I,O,x,C,s,11,a[41]),C=h(C,I,O,x,p,16,a[42]),x=h(x,C,I,O,g,23,a[43]),O=h(O,x,C,I,w,4,a[44]),I=h(I,O,x,C,T,11,a[45]),C=h(C,I,O,x,S,16,a[46]),O=f(O,x=h(x,C,I,O,d,23,a[47]),C,I,s,6,a[48]),I=f(I,O,x,C,v,10,a[49]),C=f(C,I,O,x,k,15,a[50]),x=f(x,C,I,O,y,21,a[51]),O=f(O,x,C,I,T,6,a[52]),I=f(I,O,x,C,p,10,a[53]),C=f(C,I,O,x,A,15,a[54]),x=f(x,C,I,O,u,21,a[55]),O=f(O,x,C,I,b,6,a[56]),I=f(I,O,x,C,S,10,a[57]),C=f(C,I,O,x,g,15,a[58]),x=f(x,C,I,O,_,21,a[59]),O=f(O,x,C,I,m,6,a[60]),I=f(I,O,x,C,E,10,a[61]),C=f(C,I,O,x,d,15,a[62]),x=f(x,C,I,O,w,21,a[63]),o[0]=o[0]+O|0,o[1]=o[1]+x|0,o[2]=o[2]+C|0,o[3]=o[3]+I|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,u=a.words,l=0;l<4;l++){var c=u[l];u[l]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,r,n,i,o,s){var a=e+(t&r|~t&n)+i+s;return(a<<o|a>>>32-o)+t}function c(e,t,r,n,i,o,s){var a=e+(t&n|r&~n)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,r,n,i,o,s){var a=e+(t^r^n)+i+s;return(a<<o|a>>>32-o)+t}function f(e,t,r,n,i,o,s){var a=e+(r^(t|~n))+i+s;return(a<<o|a>>>32-o)+t}t.MD5=o._createHelper(u),t.HmacMD5=o._createHmacHelper(u)}(Math),n.MD5)},8568:function(e,t,r){var n;e.exports=(n=r(8249),r(5109),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,r,n){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;n.encryptBlock(o,0);for(var s=0;s<r;s++)e[t+s]^=o[s]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i,n),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=e.slice(r,r+i);t.call(this,e,r,i,n),this._prevBlock=o}}),e}(),n.mode.CFB)},9968:function(e,t,r){var n;e.exports=(n=r(8249),r(5109),n.mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var r=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(s);var a=s.slice(0);n.encryptBlock(a,0);for(var u=0;u<i;u++)e[r+u]^=a[u]}});return e.Decryptor=r,e}(),n.mode.CTRGladman)},493:function(e,t,r){var n,i,o;e.exports=(o=r(8249),r(5109),o.mode.CTR=(i=(n=o.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var s=o.slice(0);r.encryptBlock(s,0),o[n-1]=o[n-1]+1|0;for(var a=0;a<n;a++)e[t+a]^=s[a]}}),n.Decryptor=i,n),o.mode.CTR)},1148:function(e,t,r){var n,i;e.exports=(i=r(8249),r(5109),i.mode.ECB=((n=i.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),i.mode.ECB)},7660:function(e,t,r){var n,i,o;e.exports=(o=r(8249),r(5109),o.mode.OFB=(i=(n=o.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var s=0;s<n;s++)e[t+s]^=o[s]}}),n.Decryptor=i,n),o.mode.OFB)},3615:function(e,t,r){var n;e.exports=(n=r(8249),r(5109),n.pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,o=r+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},2807:function(e,t,r){var n;e.exports=(n=r(8249),r(5109),n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},1077:function(e,t,r){var n;e.exports=(n=r(8249),r(5109),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},6991:function(e,t,r){var n;e.exports=(n=r(8249),r(5109),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},6475:function(e,t,r){var n;e.exports=(n=r(8249),r(5109),n.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},n.pad.ZeroPadding)},2112:function(e,t,r){var n,i,o,s,a,u,l,c,h;e.exports=(h=r(8249),r(2783),r(9824),o=(i=(n=h).lib).Base,s=i.WordArray,u=(a=n.algo).SHA1,l=a.HMAC,c=a.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:u,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=l.create(r.hasher,e),i=s.create(),o=s.create([1]),a=i.words,u=o.words,c=r.keySize,h=r.iterations;a.length<c;){var f=n.update(t).finalize(o);n.reset();for(var d=f.words,p=d.length,m=f,y=1;y<h;y++){m=n.finalize(m),n.reset();for(var g=m.words,v=0;v<p;v++)d[v]^=g[v]}i.concat(f),u[0]++}return i.sigBytes=4*c,i}}),n.PBKDF2=function(e,t,r){return c.create(r).compute(e,t)},h.PBKDF2)},3974:function(e,t,r){var n;e.exports=(n=r(8249),r(8269),r(8214),r(888),r(5109),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],s=[],a=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)u.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,s=o[0],a=o[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=l>>>16|4294901760&c,f=c<<16|65535&l;for(n[0]^=l,n[1]^=h,n[2]^=c,n[3]^=f,n[4]^=l,n[5]^=h,n[6]^=c,n[7]^=f,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,u=((i*i>>>17)+i*a>>>15)+a*a,l=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=u^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(a)}(),n.RabbitLegacy)},4454:function(e,t,r){var n;e.exports=(n=r(8249),r(8269),r(8214),r(888),r(5109),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],s=[],a=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)u.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,s=o[0],a=o[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=l>>>16|4294901760&c,f=c<<16|65535&l;for(i[0]^=l,i[1]^=h,i[2]^=c,i[3]^=f,i[4]^=l,i[5]^=h,i[6]^=c,i[7]^=f,r=0;r<4;r++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,u=((i*i>>>17)+i*a>>>15)+a*a,l=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=u^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(a)}(),n.Rabbit)},1857:function(e,t,r){var n;e.exports=(n=r(8249),r(8269),r(8214),r(888),r(5109),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var s=i%r,a=t[s>>>2]>>>24-s%4*8&255;o=(o+n[i]+a)%256;var u=n[i];n[i]=n[o],n[o]=u}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(s)}(),n.RC4)},706:function(e,t,r){var n;e.exports=(n=r(8249),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=i.create([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]),u=i.create([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]),l=i.create([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]),c=i.create([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]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,s,d,w,A,E,T,_,k,S,O,x=this._hash.words,C=h.words,I=f.words,P=a.words,B=u.words,R=l.words,M=c.words;for(E=o=x[0],T=s=x[1],_=d=x[2],k=w=x[3],S=A=x[4],r=0;r<80;r+=1)O=o+e[t+P[r]]|0,O+=r<16?p(s,d,w)+C[0]:r<32?m(s,d,w)+C[1]:r<48?y(s,d,w)+C[2]:r<64?g(s,d,w)+C[3]:v(s,d,w)+C[4],O=(O=b(O|=0,R[r]))+A|0,o=A,A=w,w=b(d,10),d=s,s=O,O=E+e[t+B[r]]|0,O+=r<16?v(T,_,k)+I[0]:r<32?g(T,_,k)+I[1]:r<48?y(T,_,k)+I[2]:r<64?m(T,_,k)+I[3]:p(T,_,k)+I[4],O=(O=b(O|=0,M[r]))+S|0,E=S,S=k,k=b(_,10),_=T,T=O;O=x[1]+d+k|0,x[1]=x[2]+w+S|0,x[2]=x[3]+A+E|0,x[3]=x[4]+o+T|0,x[4]=x[0]+s+_|0,x[0]=O},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function m(e,t,r){return e&t|~e&r}function y(e,t,r){return(e|~t)^r}function g(e,t,r){return e&r|t&~r}function v(e,t,r){return e^(t|~r)}function b(e,t){return e<<t|e>>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(Math),n.RIPEMD160)},2783:function(e,t,r){var n,i,o,s,a,u,l,c;e.exports=(i=(n=c=r(8249)).lib,o=i.WordArray,s=i.Hasher,a=n.algo,u=[],l=a.SHA1=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=0;l<80;l++){if(l<16)u[l]=0|e[t+l];else{var c=u[l-3]^u[l-8]^u[l-14]^u[l-16];u[l]=c<<1|c>>>31}var h=(n<<5|n>>>27)+a+u[l];h+=l<20?1518500249+(i&o|~i&s):l<40?1859775393+(i^o^s):l<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,a=s,s=o,o=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=s._createHelper(l),n.HmacSHA1=s._createHmacHelper(l),c.SHA1)},7792:function(e,t,r){var n,i,o,s,a,u;e.exports=(u=r(8249),r(2153),i=(n=u).lib.WordArray,o=n.algo,s=o.SHA256,a=o.SHA224=s.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=s._createHelper(a),n.HmacSHA224=s._createHmacHelper(a),u.SHA224)},2153:function(e,t,r){var n;e.exports=(n=r(8249),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=[],u=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(a[i]=r(e.pow(n,.5))),u[i]=r(e.pow(n,1/3)),i++),n++}();var l=[],c=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],c=r[5],h=r[6],f=r[7],d=0;d<64;d++){if(d<16)l[d]=0|e[t+d];else{var p=l[d-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=l[d-2],g=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;l[d]=m+l[d-7]+g+l[d-16]}var v=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&c^~a&h)+u[d]+l[d];f=h,h=c,c=a,a=s+w|0,s=o,o=i,i=n,n=w+(b+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(c),t.HmacSHA256=o._createHmacHelper(c)}(Math),n.SHA256)},3327:function(e,t,r){var n;e.exports=(n=r(8249),r(4938),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.x64.Word,a=t.algo,u=[],l=[],c=[];!function(){for(var e=1,t=0,r=0;r<24;r++){u[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var a=0,h=0,f=0;f<7;f++){if(1&i){var d=(1<<f)-1;d<32?h^=1<<d:a^=1<<d-32}128&i?i=i<<1^113:i<<=1}c[o]=s.create(a,h)}}();var h=[];!function(){for(var e=0;e<25;e++)h[e]=s.create()}();var f=a.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var o=e[t+2*i],s=e[t+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(x=r[i]).high^=s,x.low^=o}for(var a=0;a<24;a++){for(var f=0;f<5;f++){for(var d=0,p=0,m=0;m<5;m++)d^=(x=r[f+5*m]).high,p^=x.low;var y=h[f];y.high=d,y.low=p}for(f=0;f<5;f++){var g=h[(f+4)%5],v=h[(f+1)%5],b=v.high,w=v.low;for(d=g.high^(b<<1|w>>>31),p=g.low^(w<<1|b>>>31),m=0;m<5;m++)(x=r[f+5*m]).high^=d,x.low^=p}for(var A=1;A<25;A++){var E=(x=r[A]).high,T=x.low,_=u[A];_<32?(d=E<<_|T>>>32-_,p=T<<_|E>>>32-_):(d=T<<_-32|E>>>64-_,p=E<<_-32|T>>>64-_);var k=h[l[A]];k.high=d,k.low=p}var S=h[0],O=r[0];for(S.high=O.high,S.low=O.low,f=0;f<5;f++)for(m=0;m<5;m++){var x=r[A=f+5*m],C=h[A],I=h[(f+1)%5+5*m],P=h[(f+2)%5+5*m];x.high=C.high^~I.high&P.high,x.low=C.low^~I.low&P.low}x=r[0];var B=c[a];x.high^=B.high,x.low^=B.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,u=a/8,l=[],c=0;c<u;c++){var h=s[c],f=h.high,d=h.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),l.push(d),l.push(f)}return new i.init(l,a)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(f),t.HmacSHA3=o._createHmacHelper(f)}(Math),n.SHA3)},7460:function(e,t,r){var n,i,o,s,a,u,l,c;e.exports=(c=r(8249),r(4938),r(34),i=(n=c).x64,o=i.Word,s=i.WordArray,a=n.algo,u=a.SHA512,l=a.SHA384=u.extend({_doReset:function(){this._hash=new s.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=u._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=u._createHelper(l),n.HmacSHA384=u._createHmacHelper(l),c.SHA384)},34:function(e,t,r){var n;e.exports=(n=r(8249),r(4938),function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,o=r.WordArray,s=e.algo;function a(){return i.create.apply(i,arguments)}var u=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=a()}();var c=s.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],c=r[5],h=r[6],f=r[7],d=n.high,p=n.low,m=i.high,y=i.low,g=o.high,v=o.low,b=s.high,w=s.low,A=a.high,E=a.low,T=c.high,_=c.low,k=h.high,S=h.low,O=f.high,x=f.low,C=d,I=p,P=m,B=y,R=g,M=v,N=b,L=w,F=A,D=E,U=T,H=_,j=k,z=S,K=O,G=x,q=0;q<80;q++){var V=l[q];if(q<16)var W=V.high=0|e[t+2*q],J=V.low=0|e[t+2*q+1];else{var Y=l[q-15],Q=Y.high,Z=Y.low,X=(Q>>>1|Z<<31)^(Q>>>8|Z<<24)^Q>>>7,$=(Z>>>1|Q<<31)^(Z>>>8|Q<<24)^(Z>>>7|Q<<25),ee=l[q-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=l[q-7],se=oe.high,ae=oe.low,ue=l[q-16],le=ue.high,ce=ue.low;W=(W=(W=X+se+((J=$+ae)>>>0<$>>>0?1:0))+ne+((J+=ie)>>>0<ie>>>0?1:0))+le+((J+=ce)>>>0<ce>>>0?1:0),V.high=W,V.low=J}var he,fe=F&U^~F&j,de=D&H^~D&z,pe=C&P^C&R^P&R,me=I&B^I&M^B&M,ye=(C>>>28|I<<4)^(C<<30|I>>>2)^(C<<25|I>>>7),ge=(I>>>28|C<<4)^(I<<30|C>>>2)^(I<<25|C>>>7),ve=(F>>>14|D<<18)^(F>>>18|D<<14)^(F<<23|D>>>9),be=(D>>>14|F<<18)^(D>>>18|F<<14)^(D<<23|F>>>9),we=u[q],Ae=we.high,Ee=we.low,Te=K+ve+((he=G+be)>>>0<G>>>0?1:0),_e=ge+me;K=j,G=z,j=U,z=H,U=F,H=D,F=N+(Te=(Te=(Te=Te+fe+((he+=de)>>>0<de>>>0?1:0))+Ae+((he+=Ee)>>>0<Ee>>>0?1:0))+W+((he+=J)>>>0<J>>>0?1:0))+((D=L+he|0)>>>0<L>>>0?1:0)|0,N=R,L=M,R=P,M=B,P=C,B=I,C=Te+(ye+pe+(_e>>>0<ge>>>0?1:0))+((I=he+_e|0)>>>0<he>>>0?1:0)|0}p=n.low=p+I,n.high=d+C+(p>>>0<I>>>0?1:0),y=i.low=y+B,i.high=m+P+(y>>>0<B>>>0?1:0),v=o.low=v+M,o.high=g+R+(v>>>0<M>>>0?1:0),w=s.low=w+L,s.high=b+N+(w>>>0<L>>>0?1:0),E=a.low=E+D,a.high=A+F+(E>>>0<D>>>0?1:0),_=c.low=_+H,c.high=T+U+(_>>>0<H>>>0?1:0),S=h.low=S+z,h.high=k+j+(S>>>0<z>>>0?1:0),x=f.low=x+G,f.high=O+K+(x>>>0<G>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(c),e.HmacSHA512=t._createHmacHelper(c)}(),n.SHA512)},4253:function(e,t,r){var n;e.exports=(n=r(8249),r(8269),r(8214),r(888),r(5109),function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,o=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var l=i[o]=[],c=u[o];for(r=0;r<24;r++)l[r/6|0]|=t[(a[r]-1+c)%28]<<31-r%6,l[4+(r/6|0)]|=t[28+(a[r+24]-1+c)%28]<<31-r%6;for(l[0]=l[0]<<1|l[0]>>>31,r=1;r<7;r++)l[r]=l[r]>>>4*(r-1)+3;l[7]=l[7]<<5|l[7]>>>27}var h=this._invSubKeys=[];for(r=0;r<16;r++)h[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,s=this._rBlock,a=0,u=0;u<8;u++)a|=l[u][((s^i[u])&c[u])>>>0];this._lBlock=s,this._rBlock=o^a}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,f.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function d(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(h);var p=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=h.createEncryptor(r.create(e.slice(0,2))),this._des2=h.createEncryptor(r.create(e.slice(2,4))),this._des3=h.createEncryptor(r.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),n.TripleDES)},4938:function(e,t,r){var n,i,o,s,a,u;e.exports=(n=r(8249),o=(i=n).lib,s=o.Base,a=o.WordArray,(u=i.x64={}).Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),u.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return a.create(r,this.sigBytes)},clone:function(){for(var e=s.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),n)},7640:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BaseContract:()=>P,BigNumber:()=>f.O$,Contract:()=>B,ContractFactory:()=>R,FixedNumber:()=>M.xs,Signer:()=>c.E,VoidSigner:()=>c.b,Wallet:()=>N.Wallet,Wordlist:()=>ht.D,constants:()=>n,errors:()=>y.ErrorCode,ethers:()=>s,getDefaultProvider:()=>lt,logger:()=>Bt,providers:()=>i,utils:()=>o,version:()=>Pt,wordlists:()=>ct.E});var n={};r.r(n),r.d(n,{AddressZero:()=>L.d,EtherSymbol:()=>U,HashZero:()=>D.R,MaxInt256:()=>F.PS,MaxUint256:()=>F.Bz,MinInt256:()=>F.$B,NegativeOne:()=>F.tL,One:()=>F.fh,Two:()=>F.Py,WeiPerEther:()=>F.Ce,Zero:()=>F._Y});var i={};r.r(i),r.d(i,{AlchemyProvider:()=>ge,AlchemyWebSocketProvider:()=>ye,AnkrProvider:()=>Ae,BaseProvider:()=>j.Zk,CloudflareProvider:()=>Te,EtherscanProvider:()=>Pe,FallbackProvider:()=>Ve,Formatter:()=>z.Mb,InfuraProvider:()=>Ze,InfuraWebSocketProvider:()=>Qe,IpcProvider:()=>We,JsonRpcBatchProvider:()=>Xe,JsonRpcProvider:()=>oe,JsonRpcSigner:()=>re,NodesmithProvider:()=>et,PocketProvider:()=>nt,Provider:()=>l.zt,Resolver:()=>j.H2,StaticJsonRpcProvider:()=>fe,UrlJsonRpcProvider:()=>de,Web3Provider:()=>at,WebSocketProvider:()=>ce,getDefaultProvider:()=>lt,getNetwork:()=>H.H,isCommunityResourcable:()=>z.Ed,isCommunityResource:()=>z.Gp,showThrottleMessage:()=>z.vh});var o={};r.r(o),r.d(o,{AbiCoder:()=>ft.R,ConstructorFragment:()=>dt.Xg,ErrorFragment:()=>dt.IC,EventFragment:()=>dt.QV,FormatTypes:()=>dt.pc,Fragment:()=>dt.HY,FunctionFragment:()=>dt.YW,HDNode:()=>bt.HDNode,Indexed:()=>u.Hk,Interface:()=>u.vU,LogDescription:()=>u.CC,Logger:()=>y.Logger,ParamType:()=>dt._R,RLP:()=>kt,SigningKey:()=>St.SigningKey,SupportedAlgorithm:()=>It.p,TransactionDescription:()=>u.vk,TransactionTypes:()=>m.TransactionTypes,UnicodeNormalizationForm:()=>G.Uj,Utf8ErrorFuncs:()=>G.te,Utf8ErrorReason:()=>G.Uw,_TypedDataEncoder:()=>K.E,_fetchData:()=>q._fetchData,_toEscapedUtf8String:()=>G.U$,accessListify:()=>m.accessListify,arrayify:()=>d.arrayify,base58:()=>mt.Base58,base64:()=>pt,checkProperties:()=>p.checkProperties,checkResultErrors:()=>a.BR,commify:()=>Ct.commify,computeAddress:()=>m.computeAddress,computeHmac:()=>Et.Gy,computePublicKey:()=>St.computePublicKey,concat:()=>d.concat,deepCopy:()=>p.deepCopy,defaultAbiCoder:()=>ft.$,defaultPath:()=>bt.defaultPath,defineReadOnly:()=>p.defineReadOnly,dnsEncode:()=>yt.Kn,entropyToMnemonic:()=>bt.entropyToMnemonic,fetchJson:()=>q.fetchJson,formatBytes32String:()=>xt.s,formatEther:()=>Ct.formatEther,formatUnits:()=>Ct.formatUnits,getAccountPath:()=>bt.getAccountPath,getAddress:()=>h.getAddress,getContractAddress:()=>h.getContractAddress,getCreate2Address:()=>h.getCreate2Address,getIcapAddress:()=>h.getIcapAddress,getJsonWalletAddress:()=>wt.Rb,getStatic:()=>p.getStatic,hashMessage:()=>gt.r,hexConcat:()=>d.hexConcat,hexDataLength:()=>d.hexDataLength,hexDataSlice:()=>d.hexDataSlice,hexStripZeros:()=>d.hexStripZeros,hexValue:()=>d.hexValue,hexZeroPad:()=>d.hexZeroPad,hexlify:()=>d.hexlify,id:()=>vt.id,isAddress:()=>h.isAddress,isBytes:()=>d.isBytes,isBytesLike:()=>d.isBytesLike,isHexString:()=>d.isHexString,isValidMnemonic:()=>bt.isValidMnemonic,isValidName:()=>yt.r1,joinSignature:()=>d.joinSignature,keccak256:()=>At.keccak256,mnemonicToEntropy:()=>bt.mnemonicToEntropy,mnemonicToSeed:()=>bt.mnemonicToSeed,namehash:()=>yt.VM,nameprep:()=>Ot.Ll,parseBytes32String:()=>xt.F,parseEther:()=>Ct.parseEther,parseTransaction:()=>m.parse,parseUnits:()=>Ct.parseUnits,poll:()=>q.poll,randomBytes:()=>_t.O,recoverAddress:()=>m.recoverAddress,recoverPublicKey:()=>St.recoverPublicKey,resolveProperties:()=>p.resolveProperties,ripemd160:()=>Et.bP,serializeTransaction:()=>m.serialize,sha256:()=>Et.JQ,sha512:()=>Et.o,shallowCopy:()=>p.shallowCopy,shuffled:()=>Be.y,solidityKeccak256:()=>Tt.keccak256,solidityPack:()=>Tt.pack,soliditySha256:()=>Tt.sha256,splitSignature:()=>d.splitSignature,stripZeros:()=>d.stripZeros,toUtf8Bytes:()=>G.Y0,toUtf8CodePoints:()=>G.XL,toUtf8String:()=>G.ZN,verifyMessage:()=>N.verifyMessage,verifyTypedData:()=>N.verifyTypedData,zeroPad:()=>d.zeroPad});var s={};r.r(s),r.d(s,{BaseContract:()=>P,BigNumber:()=>f.O$,Contract:()=>B,ContractFactory:()=>R,FixedNumber:()=>M.xs,Signer:()=>c.E,VoidSigner:()=>c.b,Wallet:()=>N.Wallet,Wordlist:()=>ht.D,constants:()=>n,errors:()=>y.ErrorCode,getDefaultProvider:()=>lt,logger:()=>Bt,providers:()=>i,utils:()=>o,version:()=>Pt,wordlists:()=>ct.E});var a=r(1184),u=r(8198),l=r(4353),c=r(8171),h=r(4594),f=r(2593),d=r(3286),p=r(3587),m=r(4377),y=r(711),g=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const v=new y.Logger("contracts/5.7.0"),b={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function w(e,t){return g(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&v.throwArgumentError("invalid address or ENS name","name",r);try{return(0,h.getAddress)(r)}catch(e){}e||v.throwError("a provider or signer is needed to resolve ENS names",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&v.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function A(e,t,r){return g(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>A(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield w(e,t):"tuple"===r.type?yield A(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>A(e,t,r.arrayChildren)))):Promise.reject(v.makeError("invalid value for array",y.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function E(e,t,r){return g(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=(0,p.shallowCopy)(r.pop())),v.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=(0,p.resolveProperties)({override:w(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>g(this,void 0,void 0,(function*(){return(0,h.getAddress)(e.signer)!==e.override&&v.throwError("Contract with a Signer cannot override from",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=w(e.provider,n.from));const i=yield(0,p.resolveProperties)({args:A(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,p.resolveProperties)(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),s={data:o,to:i.address},a=i.overrides;if(null!=a.nonce&&(s.nonce=f.O$.from(a.nonce).toNumber()),null!=a.gasLimit&&(s.gasLimit=f.O$.from(a.gasLimit)),null!=a.gasPrice&&(s.gasPrice=f.O$.from(a.gasPrice)),null!=a.maxFeePerGas&&(s.maxFeePerGas=f.O$.from(a.maxFeePerGas)),null!=a.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=f.O$.from(a.maxPriorityFeePerGas)),null!=a.from&&(s.from=a.from),null!=a.type&&(s.type=a.type),null!=a.accessList&&(s.accessList=(0,m.accessListify)(a.accessList)),null==s.gasLimit&&null!=t.gas){let e=21e3;const r=(0,d.arrayify)(o);for(let t=0;t<r.length;t++)e+=4,r[t]&&(e+=64);s.gasLimit=f.O$.from(t.gas).add(e)}if(a.value){const e=f.O$.from(a.value);e.isZero()||t.payable||v.throwError("non-payable method cannot override value",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),s.value=e}a.customData&&(s.customData=(0,p.shallowCopy)(a.customData)),a.ccipReadEnabled&&(s.ccipReadEnabled=!!a.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const u=Object.keys(n).filter((e=>null!=n[e]));return u.length&&v.throwError(`cannot override ${u.map((e=>JSON.stringify(e))).join(",")}`,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),s}))}function T(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=(0,p.deepCopy)(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}function _(e,t,r){const n=e.signer||e.provider;return function(...i){return g(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=(0,p.shallowCopy)(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const s=yield E(e,t,i),a=yield n.call(s,o);try{let n=e.interface.decodeFunctionResult(t,a);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===y.Logger.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=s),t}}))}}function k(e,t,r){return t.constant?_(e,t,r):function(e,t){return function(...r){return g(this,void 0,void 0,(function*(){e.signer||v.throwError("sending a transaction requires a signer",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield E(e,t,r),i=yield e.signer.sendTransaction(n);return T(e,i),i}))}}(e,t)}function S(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class O{constructor(e,t){(0,p.defineReadOnly)(this,"tag",e),(0,p.defineReadOnly)(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&&(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((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class x extends O{constructor(){super("error",null)}}class C extends O{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&v.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(S(i),i),(0,p.defineReadOnly)(this,"address",e),(0,p.defineReadOnly)(this,"interface",t),(0,p.defineReadOnly)(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=(0,a.BR)(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class I extends O{constructor(e,t){super("*",{address:e}),(0,p.defineReadOnly)(this,"address",e),(0,p.defineReadOnly)(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=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class P{constructor(e,t,r){(0,p.defineReadOnly)(this,"interface",(0,p.getStatic)(new.target,"getInterface")(t)),null==r?((0,p.defineReadOnly)(this,"provider",null),(0,p.defineReadOnly)(this,"signer",null)):c.E.isSigner(r)?((0,p.defineReadOnly)(this,"provider",r.provider||null),(0,p.defineReadOnly)(this,"signer",r)):l.zt.isProvider(r)?((0,p.defineReadOnly)(this,"provider",r),(0,p.defineReadOnly)(this,"signer",null)):v.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,p.defineReadOnly)(this,"callStatic",{}),(0,p.defineReadOnly)(this,"estimateGas",{}),(0,p.defineReadOnly)(this,"functions",{}),(0,p.defineReadOnly)(this,"populateTransaction",{}),(0,p.defineReadOnly)(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];(0,p.defineReadOnly)(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?(0,p.defineReadOnly)(this.filters,t,this.filters[r[0]]):v.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if((0,p.defineReadOnly)(this,"_runningEvents",{}),(0,p.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&v.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,p.defineReadOnly)(this,"address",e),this.provider)(0,p.defineReadOnly)(this,"resolvedAddress",w(this.provider,e));else try{(0,p.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,h.getAddress)(e)))}catch(e){v.throwError("provider is required to use ENS name as contract address",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])v.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&(0,p.defineReadOnly)(this,e,k(this,t,!0)),null==this.functions[e]&&(0,p.defineReadOnly)(this.functions,e,k(this,t,!1)),null==this.callStatic[e]&&(0,p.defineReadOnly)(this.callStatic,e,_(this,t,!0)),null==this.populateTransaction[e]&&(0,p.defineReadOnly)(this.populateTransaction,e,function(e,t){return function(...r){return E(e,t,r)}}(this,t)),null==this.estimateGas[e]&&(0,p.defineReadOnly)(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return g(this,void 0,void 0,(function*(){r||v.throwError("estimate require a provider or signer",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield E(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&(0,p.defineReadOnly)(this,e,this[r])}catch(e){}null==this.functions[e]&&(0,p.defineReadOnly)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&(0,p.defineReadOnly)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&(0,p.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&(0,p.defineReadOnly)(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return(0,h.getContractAddress)(e)}static getInterface(e){return u.vU.isInterface(e)?e:new u.vU(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((e=>("0x"===e&&v.throwError("contract not deployed",y.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||v.throwError("sending a transactions require a signer",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=(0,p.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=t[e]&&v.throwError("cannot override "+e,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new c.b(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,p.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return u.Hk.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new x);if("event"===e)return this._normalizeRunningEvent(new O("event",null));if("*"===e)return this._normalizeRunningEvent(new I(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new C(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new C(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new O(S(t),t))}return this._normalizeRunningEvent(new I(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){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 n=(0,p.deepCopy)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||v.throwError("events require a provider or a signer with a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=(0,p.shallowCopy)(n.filter);return"string"==typeof t&&(0,d.isHexString)(t,32)?(null!=r&&v.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,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),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}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 B extends P{}class R{constructor(e,t,r){let n=null;n="string"==typeof t?t:(0,d.isBytes)(t)?(0,d.hexlify)(t):t&&"string"==typeof t.object?t.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!(0,d.isHexString)(n)||n.length%2)&&v.throwArgumentError("invalid bytecode","bytecode",t),r&&!c.E.isSigner(r)&&v.throwArgumentError("invalid signer","signer",r),(0,p.defineReadOnly)(this,"bytecode",n),(0,p.defineReadOnly)(this,"interface",(0,p.getStatic)(new.target,"getInterface")(e)),(0,p.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){t=(0,p.shallowCopy)(e.pop());for(const e in t)if(!b[e])throw new Error("unknown transaction override "+e)}return["data","from","to"].forEach((e=>{null!=t[e]&&v.throwError("cannot override "+e,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value&&(f.O$.from(t.value).isZero()||this.interface.deploy.payable||v.throwError("non-payable constructor cannot override value",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})),v.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=(0,d.hexlify)((0,d.concat)([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return g(this,void 0,void 0,(function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),v.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield A(this.signer,e,this.interface.deploy.inputs);r.push(t);const n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=(0,p.getStatic)(this.constructor,"getContractAddress")(i),s=(0,p.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return T(s,i),(0,p.defineReadOnly)(s,"deployTransaction",i),s}))}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&v.throwError("missing compiler output",y.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}static getInterface(e){return B.getInterface(e)}static getContractAddress(e){return(0,h.getContractAddress)(e)}static getContract(e,t,r){return new B(e,t,r)}}var M=r(335),N=r(4958),L=r(9279),F=r(1046),D=r(7218);const U="Ξ";var H=r(9861),j=r(7013),z=r(32),K=r(7827),G=r(4242),q=r(8341),V=r(4216),W=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const J=new y.Logger(V.i),Y=["call","estimateGas"];function Q(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=(0,d.isHexString)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=Q(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return Q(JSON.parse(e),t)}catch(e){}return null}function Z(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=Q(t,!0);if(e)return e.data;J.throwError("missing revert data in call exception; Transaction reverted without a reason string",y.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=Q(t.body,!1);null==r&&(r=Q(t,!1)),r&&J.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===y.Logger.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&J.throwError("insufficient funds for intrinsic transaction cost",y.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&J.throwError("nonce has already been used",y.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&J.throwError("replacement fee too low",y.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&J.throwError("legacy pre-eip-155 transactions not supported",y.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),Y.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&J.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function X(e){return new Promise((function(t){setTimeout(t,e)}))}function $(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function ee(e){return e?e.toLowerCase():e}const te={};class re extends c.E{constructor(e,t,r){if(super(),e!==te)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,p.defineReadOnly)(this,"provider",t),null==r&&(r=0),"string"==typeof r?((0,p.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,p.defineReadOnly)(this,"_index",null)):"number"==typeof r?((0,p.defineReadOnly)(this,"_index",r),(0,p.defineReadOnly)(this,"_address",null)):J.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return J.throwError("cannot alter JSON-RPC Signer connection",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new ne(te,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&&J.throwError("unknown account #"+this._index,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=(0,p.shallowCopy)(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=(0,p.shallowCopy)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>W(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&J.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),(0,p.resolveProperties)({tx:(0,p.resolveProperties)(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&J.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&J.throwError("user rejected transaction",y.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),Z("sendTransaction",e,n))))}))}signTransaction(e){return J.throwError("signing transactions is unsupported",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return W(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(0,q.poll)((()=>W(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return W(this,void 0,void 0,(function*(){const t="string"==typeof e?(0,G.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,d.hexlify)(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&J.throwError("user rejected signing",y.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return W(this,void 0,void 0,(function*(){const t="string"==typeof e?(0,G.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,d.hexlify)(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&J.throwError("user rejected signing",y.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return W(this,void 0,void 0,(function*(){const n=yield K.E.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(K.E.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&J.throwError("user rejected signing",y.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return W(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class ne extends re{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const ie={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class oe extends j.Zk{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=(0,p.getStatic)(this.constructor,"defaultUrl")()),"string"==typeof e?(0,p.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,p.defineReadOnly)(this,"connection",Object.freeze((0,p.shallowCopy)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(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 W(this,void 0,void 0,(function*(){yield X(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=(0,p.getStatic)(this.constructor,"getNetwork");try{return t(f.O$.from(e).toNumber())}catch(t){return J.throwError("could not detect network",y.Logger.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return J.throwError("could not detect network",y.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new re(te,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,p.deepCopy)(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=(0,q.fetchJson)(this.connection,JSON.stringify(r),$).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[ee(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[ee(t.address),t.blockTag]];case"getCode":return["eth_getCode",[ee(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[ee(t.address),(0,d.hexZeroPad)(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",[(0,p.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,p.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=ee(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return W(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&f.O$.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=(0,p.shallowCopy)(t)).transaction=(0,p.shallowCopy)(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&J.throwError(e+" not implemented",y.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return Z(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return X(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=(0,p.shallowCopy)(ie);if(t)for(const e in t)t[e]&&(r[e]=!0);(0,p.checkProperties)(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=(0,d.hexValue)(f.O$.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=(0,d.hexlify)(e[t]))})),e.accessList&&(n.accessList=(0,m.accessListify)(e.accessList)),n}}let se=null;try{if(se=WebSocket,null==se)throw new Error("inject please")}catch(e){const t=new y.Logger(V.i);se=function(){t.throwError("WebSockets not supported in this environment",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var ae=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const ue=new y.Logger(V.i);let le=1;class ce extends oe{constructor(e,t){"any"===t&&ue.throwError("WebSocketProvider does not support 'any' network yet",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"==typeof e?e:"_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof e?(0,p.defineReadOnly)(this,"_websocket",new se(this.connection.url)):(0,p.defineReadOnly)(this,"_websocket",e),(0,p.defineReadOnly)(this,"_requests",{}),(0,p.defineReadOnly)(this,"_subs",{}),(0,p.defineReadOnly)(this,"_subIds",{}),(0,p.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this.websocket.send(this._requests[e].payload)}))},this.websocket.onmessage=e=>{const t=e.data,r=JSON.parse(t);if(null!=r.id){const e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(e=new Error(r.error.message||"unknown error"),(0,p.defineReadOnly)(e,"code",r.error.code||null),(0,p.defineReadOnly)(e,"response",t)):e=new Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){ue.throwError("cannot reset events block on WebSocketProvider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){ue.throwError("cannot set polling interval on WebSocketProvider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return ae(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&ue.throwError("cannot set polling on WebSocketProvider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=le++;return new Promise(((n,i)=>{const o=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return ae(this,void 0,void 0,(function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=n);const i=yield n;this._subs[i]={tag:e,processFunc:r}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=f.O$.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const r=this._subIds[t];r&&(delete this._subIds[t],r.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return ae(this,void 0,void 0,(function*(){this.websocket.readyState===se.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}const he=new y.Logger(V.i);class fe extends oe{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return t=this,r=void 0,i=function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||he.throwError("no network detected",y.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,p.defineReadOnly)(this,"_network",t),this.emit("network",t,null))),t},new((n=void 0)||(n=Promise))((function(e,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}u((i=i.apply(t,r||[])).next())}));var t,r,n,i}}class de extends fe{constructor(e,t){he.checkAbstract(new.target,de),e=(0,p.getStatic)(new.target,"getNetwork")(e),t=(0,p.getStatic)(new.target,"getApiKey")(t),super((0,p.getStatic)(new.target,"getUrl")(e,t),e),"string"==typeof t?(0,p.defineReadOnly)(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{(0,p.defineReadOnly)(this,e,t[e])}))}_startPending(){he.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return he.throwError("API provider does not support signing",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return he.throwError("not implemented; sub-classes must override getUrl",y.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const pe=new y.Logger(V.i),me="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class ye extends ce{constructor(e,t){const r=new ge(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),(0,p.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===me}}class ge extends de{static getWebSocketProvider(e,t){return new ye(e,t)}static getApiKey(e){return null==e?me:(e&&"string"!=typeof e&&pe.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:pe.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===me&&(0,z.vh)(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===me}}const ve=new y.Logger(V.i),be="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function we(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return ve.throwArgumentError("unsupported network","name",e)}class Ae extends de{isCommunityResource(){return this.apiKey===be}static getApiKey(e){return null==e?be:e}static getUrl(e,t){null==t&&(t=be);const r={allowGzip:!0,url:"https://"+we(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===be&&(0,z.vh)(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}const Ee=new y.Logger(V.i);class Te extends de{static getApiKey(e){return null!=e&&Ee.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;return"homestead"===e.name?r="https://cloudflare-eth.com/":Ee.throwArgumentError("unsupported network","network",arguments[0]),r}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return n=this,i=void 0,s=function*(){return"getBlockNumber"===e?(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number:r.perform.call(this,e,t)},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{u(s.next(e))}catch(e){t(e)}}function a(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,a)}u((s=s.apply(n,i||[])).next())}));var n,i,o,s}}var _e=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const ke=new y.Logger(V.i);function Se(e){const t={};for(let r in e){if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,d.hexValue)((0,d.hexlify)(n)):"accessList"===r?"["+(0,m.accessListify)(n).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":(0,d.hexlify)(n),t[r]=n)}return t}function Oe(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!=typeof e.message||!e.message.match(/^OK/)){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function xe(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function Ce(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function Ie(e,t,r){if("call"===e&&t.code===y.Logger.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),(0,d.isHexString)(r))return r;ke.throwError("missing revert data in call exception",y.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===y.Logger.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?n=t.error.message:"string"==typeof t.body?n=t.body:"string"==typeof t.responseText&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&ke.throwError("insufficient funds for intrinsic transaction cost",y.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ke.throwError("nonce has already been used",y.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&ke.throwError("replacement fee too low",y.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&ke.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class Pe extends j.Zk{constructor(e,t){super(e),(0,p.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,p.defineReadOnly)(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return ke.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+=`&${r}=${n}`),e}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return _e(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,o="proxy"===e?xe:Oe;this.emit("debug",{action:"request",request:n,provider:this});const s={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&(0,z.vh)(),Promise.resolve(!0))};let a=null;i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const u=yield(0,q.fetchJson)(s,a,o||xe);return this.emit("debug",{action:"response",request:n,response:(0,p.deepCopy)(u),provider:this}),u}))}detectNetwork(){return _e(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return _e(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>Ie("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=Se(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(e){return Ie("call",e,t.transaction)}}case"estimateGas":{const e=Se(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(e){return Ie("estimateGas",e,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=Ce(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=Ce(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&ke.throwError("unsupported topic count",y.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"==typeof r&&66===r.length||ke.throwError("unsupported topic format",y.Logger.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}const r=yield this.fetch("logs",e);let n={};for(let e=0;e<r.length;e++){const t=r[e];if(null==t.blockHash){if(null==n[t.blockNumber]){const e=yield this.getBlock(t.blockNumber);e&&(n[t.blockNumber]=e.hash)}t.blockHash=n[t.blockNumber]}}return r}case"getEtherPrice":return"homestead"!==this.network.name?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return r.perform.call(this,e,t)}))}getHistory(e,t,r){return _e(this,void 0,void 0,(function*(){const n={action:"txlist",address:yield this.resolveName(e),startblock:null==t?0:t,endblock:null==r?99999999:r,sort:"asc"};return(yield this.fetch("account",n)).map((e=>{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return null==this.apiKey}}var Be=r(2472),Re=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const Me=new y.Logger(V.i);function Ne(){return(new Date).getTime()}function Le(e){let t=null;for(let r=0;r<e.length;r++){const n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||Me.throwArgumentError("provider mismatch","networks",e):t=n}return t}function Fe(e,t){e=e.slice().sort();const r=Math.floor(e.length/2);if(e.length%2)return e[r];const n=e[r-1],i=e[r];return null!=t&&Math.abs(n-i)>t?null:(n+i)/2}function De(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(f.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>De(e))));if("object"==typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let r=e[t];return r="function"==typeof r?"[function]":De(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let Ue=1;function He(e){let t=null,r=null,n=new Promise((n=>{t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:e=>(n=n.then(e),n)}}const je=[y.Logger.errors.CALL_EXCEPTION,y.Logger.errors.INSUFFICIENT_FUNDS,y.Logger.errors.NONCE_EXPIRED,y.Logger.errors.REPLACEMENT_UNDERPRICED,y.Logger.errors.UNPREDICTABLE_GAS_LIMIT],ze=["address","args","errorArgs","errorSignature","method","transaction"];function Ke(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function Ge(e,t){return Re(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:(0,q.poll)((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function qe(e,t,r,n){return Re(this,void 0,void 0,(function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ge(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ge(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ge(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ge(e,t)),"call"===r&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&(0,d.isHexString)(r.fromBlock)||r.toBlock&&(0,d.isHexString)(r.toBlock))&&(i=yield Ge(e,t)),i.getLogs(r)}}return Me.throwError("unknown method error",y.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Ve extends j.Zk{constructor(e,t){0===e.length&&Me.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(l.zt.isProvider(e)){const t=(0,z.Gp)(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=(0,p.shallowCopy)(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=(0,z.Gp)(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&Me.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,n),Object.freeze(r)})),n=r.reduce(((e,t)=>e+t.weight),0);null==t?t=n/2:t>n&&Me.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=Le(r.map((e=>e.provider.network)));null==i&&(i=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(i),(0,p.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,p.defineReadOnly)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return Re(this,void 0,void 0,(function*(){return Le(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return Re(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;t<e.length;t++){const r=e[t];if("string"==typeof r)return r}throw e[0]}-1===this._highestBlockNumber&&"getBlockNumber"!==e&&(yield this.getBlockNumber());const r=function(e,t,r){let n=De;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=Fe(t.map((e=>e.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Fe(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=(0,p.shallowCopy)(e)).confirmations=-1,De(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=(0,p.shallowCopy)(e)).transactions=e.transactions.map((e=>((e=(0,p.shallowCopy)(e)).confirmations=-1,e))),De(e))}:function(e){return null==e?null:De(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){const n={};r.forEach((t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));const i=Object.keys(n);for(let e=0;e<i.length;e++){const r=n[i[e]];if(r.count>=t)return r.result}}}(n,e.quorum)}(this,e,t),n=(0,Be.y)(this.providerConfigs.map(p.shallowCopy));n.sort(((e,t)=>e.priority-t.priority));const i=this._highestBlockNumber;let o=0,s=!0;for(;;){const a=Ne();let u=n.filter((e=>e.runner&&a-e.start<e.stallTimeout)).reduce(((e,t)=>e+t.weight),0);for(;u<this.quorum&&o<n.length;){const r=n[o++],s=Ue++;r.start=Ne(),r.staller=He(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=qe(r,i,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Ke(r,Ne()),request:{method:e,params:(0,p.deepCopy)(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Ke(r,Ne()),request:{method:e,params:(0,p.deepCopy)(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Ke(r,null),request:{method:e,params:(0,p.deepCopy)(t)},provider:this}),u+=r.weight}const l=[];n.forEach((e=>{!e.done&&e.runner&&(l.push(e.runner),e.staller&&l.push(e.staller.getPromise()))})),l.length&&(yield Promise.race(l));const c=n.filter((e=>e.done&&null==e.error));if(c.length>=this.quorum){const e=r(c);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;s||(yield He(100).getPromise()),s=!1}const h=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return je.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(h).forEach((e=>{const t=h[e];if(t.weight<this.quorum)return;n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,i={};ze.forEach((e=>{null!=r[e]&&(i[e]=r[e])})),Me.throwError(r.reason||r.message,e,i)})),0===n.filter((e=>!e.done)).length)break}return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),Me.throwError("failed to meet quorum",y.Logger.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>Ke(e))),provider:this})}))}}const We=null,Je=new y.Logger(V.i),Ye="84842078b09946638c03157f83405213";class Qe extends ce{constructor(e,t){const r=new Ze(e,t),n=r.connection;n.password&&Je.throwError("INFURA WebSocket project secrets unsupported",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"}),super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),(0,p.defineReadOnly)(this,"apiKey",r.projectId),(0,p.defineReadOnly)(this,"projectId",r.projectId),(0,p.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===Ye}}class Ze extends de{static getWebSocketProvider(e,t){return new Qe(e,t)}static getApiKey(e){const t={apiKey:Ye,projectId:Ye,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(Je.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Je.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:Je.throwError("unsupported network",y.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===Ye&&(0,z.vh)(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===Ye}}class Xe extends oe{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:(0,p.deepCopy)(t),provider:this}),(0,q.fetchJson)(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),i}}const $e=new y.Logger(V.i);class et extends de{static getApiKey(e){return e&&"string"!=typeof e&&$e.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){$e.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:$e.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const tt=new y.Logger(V.i),rt="62e1ad51b37b8e00394bda3b";class nt extends de{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=rt:"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:tt.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:tt.throwError("unsupported network",y.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={headers:{},url:`https://${r}/v1/lb/${t.applicationId}`};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}isCommunityResource(){return this.applicationId===rt}}const it=new y.Logger(V.i);let ot=1;function st(e,t){const r="Web3LegacyFetcher";return function(e,n){const i={method:e,params:n,id:ot++,jsonrpc:"2.0"};return new Promise(((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,p.deepCopy)(i),provider:this}),t(i,((t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:i,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:i,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,n(e)}e(o.result)}))}))}}class at extends oe{constructor(e,t){null==e&&it.throwArgumentError("missing provider","provider",e);let r=null,n=null,i=null;"function"==typeof e?(r="unknown:",n=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),i=e,e.request?(""===r&&(r="eip-1193:"),n=function(e){return function(t,r){null==r&&(r=[]);const n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,p.deepCopy)(n),provider:this}),e.request(n).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e}))}}(e)):e.sendAsync?n=st(0,e.sendAsync.bind(e)):e.send?n=st(0,e.send.bind(e)):it.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,p.defineReadOnly)(this,"jsonRpcFetchFunc",n),(0,p.defineReadOnly)(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const ut=new y.Logger(V.i);function lt(e,t){if(null==e&&(e="homestead"),"string"==typeof e){const t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1].toLowerCase()){case"http":case"https":return new oe(e);case"ws":case"wss":return new ce(e);default:ut.throwArgumentError("unsupported URL scheme","network",e)}}const r=(0,H.H)(e);return r&&r._defaultProvider||ut.throwError("unsupported getDefaultProvider network",y.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:Ve,AlchemyProvider:ge,AnkrProvider:Ae,CloudflareProvider:Te,EtherscanProvider:Pe,InfuraProvider:Ze,JsonRpcProvider:oe,NodesmithProvider:et,PocketProvider:nt,Web3Provider:at,IpcProvider:We},t)}var ct=r(9855),ht=r(8659),ft=r(2734),dt=r(1388),pt=r(4089),mt=r(7727),yt=r(8339),gt=r(3684),vt=r(2046),bt=r(6274),wt=r(7949),At=r(8197),Et=r(3951),Tt=r(3777),_t=r(4478),kt=r(1843),St=r(2768),Ot=r(5637),xt=r(6237),Ct=r(6441),It=r(1261);const Pt="ethers/5.7.2",Bt=new y.Logger(Pt);try{const e=window;null==e._ethers&&(e._ethers=s)}catch(e){}},6371:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var s=r(3893);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return s.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return s.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return s.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}});var a=r(4594);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var u=o(r(4089));t.base64=u;var l=r(7727);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return l.Base58}});var c=r(3286);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return c.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return c.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return c.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return c.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return c.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return c.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return c.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return c.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return c.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return c.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return c.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return c.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return c.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return c.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return c.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return c.stripZeros}});var h=r(5931);Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return h._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return h.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return h.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return h.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return h.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return h.namehash}});var f=r(6274);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return f.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return f.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return f.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return f.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return f.mnemonicToSeed}});var d=r(9380);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return d.getJsonWalletAddress}});var p=r(8197);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return p.keccak256}});var m=r(711);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return m.Logger}});var y=r(1278);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return y.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return y.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return y.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return y.sha512}});var g=r(3777);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return g.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return g.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return g.sha256}});var v=r(2118);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return v.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return v.shuffled}});var b=r(3587);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var w=o(r(1843));t.RLP=w;var A=r(2768);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return A.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return A.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return A.SigningKey}});var E=r(2741);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return E.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return E.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return E.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return E._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return E.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return E.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return E.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return E.Utf8ErrorFuncs}});var T=r(4377);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return T.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return T.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return T.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return T.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return T.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return T.TransactionTypes}});var _=r(6441);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return _.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return _.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return _.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return _.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return _.parseUnits}});var k=r(4958);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return k.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return k.verifyTypedData}});var S=r(8341);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return S._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return S.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return S.poll}});var O=r(1278);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return O.SupportedAlgorithm}});var x=r(2741);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return x.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return x.Utf8ErrorReason}})},3715:(e,t,r)=>{var n=t;n.utils=r(6436),n.common=r(5772),n.sha=r(9041),n.ripemd=r(2949),n.hmac=r(2344),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},5772:(e,t,r)=>{"use strict";var n=r(6436),i=r(9746);function o(){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}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},2344:(e,t,r)=>{"use strict";var n=r(6436),i=r(9746);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},2949:(e,t,r)=>{"use strict";var n=r(6436),i=r(5772),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,l=i.BlockHash;function c(){if(!(this instanceof c))return new c;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function f(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(c,l),t.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],l=this.h[3],c=this.h[4],v=r,b=n,w=i,A=l,E=c,T=0;T<80;T++){var _=s(o(u(r,h(T,n,i,l),e[p[T]+t],f(T)),y[T]),c);r=c,c=l,l=o(i,10),i=n,n=_,_=s(o(u(v,h(79-T,b,w,A),e[m[T]+t],d(T)),g[T]),E),v=E,E=A,A=o(w,10),w=b,b=_}_=a(this.h[1],i,A),this.h[1]=a(this.h[2],l,E),this.h[2]=a(this.h[3],c,v),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],n,w),this.h[0]=_},c.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[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],m=[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],y=[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],g=[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]},9041:(e,t,r)=>{"use strict";t.sha1=r(4761),t.sha224=r(799),t.sha256=r(9344),t.sha384=r(772),t.sha512=r(5900)},4761:(e,t,r)=>{"use strict";var n=r(6436),i=r(5772),o=r(7038),s=n.rotl32,a=n.sum32,u=n.sum32_5,l=o.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,c),e.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],c=this.h[2],f=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),m=u(s(i,5),l(p,o,c,f),d,r[n],h[p]);d=f,f=c,c=s(o,30),o=i,i=m}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],c),this.h[3]=a(this.h[3],f),this.h[4]=a(this.h[4],d)},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},799:(e,t,r)=>{"use strict";var n=r(6436),i=r(9344);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},9344:(e,t,r)=>{"use strict";var n=r(6436),i=r(5772),o=r(7038),s=r(9746),a=n.sum32,u=n.sum32_4,l=n.sum32_5,c=o.ch32,h=o.maj32,f=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,y=i.BlockHash,g=[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 v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,y),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],y=this.h[2],g=this.h[3],v=this.h[4],b=this.h[5],w=this.h[6],A=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=l(A,d(v),c(v,b,w),this.k[n],r[n]),T=a(f(i),h(i,o,y));A=w,w=b,b=v,v=a(g,E),g=y,y=o,o=i,i=a(E,T)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],y),this.h[3]=a(this.h[3],g),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],b),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],A)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},772:(e,t,r)=>{"use strict";var n=r(6436),i=r(5900);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},5900:(e,t,r)=>{"use strict";var n=r(6436),i=r(5772),o=r(9746),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,l=n.shr64_lo,c=n.sum64,h=n.sum64_hi,f=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,y=n.sum64_5_lo,g=i.BlockHash,v=[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 b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function A(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function T(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function _(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function O(e,t){var r=s(e,t,1)^s(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=a(e,t,1)^a(e,t,8)^l(e,t,7);return r<0&&(r+=4294967296),r}function C(e,t){var r=a(e,t,19)^a(t,e,29)^l(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(b,g),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=(y=r[n-4],g=r[n-3],v=void 0,(v=s(y,g,19)^s(g,y,29)^u(y,g,6))<0&&(v+=4294967296),v),o=C(r[n-4],r[n-3]),a=r[n-14],l=r[n-13],c=O(r[n-30],r[n-29]),h=x(r[n-30],r[n-29]),f=r[n-32],m=r[n-31];r[n]=d(i,o,a,l,c,h,f,m),r[n+1]=p(i,o,a,l,c,h,f,m)}var y,g,v},b.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,a=this.W,u=this.h[0],l=this.h[1],d=this.h[2],p=this.h[3],g=this.h[4],v=this.h[5],b=this.h[6],O=this.h[7],x=this.h[8],C=this.h[9],I=this.h[10],P=this.h[11],B=this.h[12],R=this.h[13],M=this.h[14],N=this.h[15];o(this.k.length===a.length);for(var L=0;L<a.length;L+=2){var F=M,D=N,U=(i=void 0,(i=s(r=x,n=C,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),H=S(x,C),j=w(x,0,I,0,B),z=A(0,C,0,P,0,R),K=this.k[L],G=this.k[L+1],q=a[L],V=a[L+1],W=m(F,D,U,H,j,z,K,G,q,V),J=y(F,D,U,H,j,z,K,G,q,V);F=_(u,l),D=k(u,l),U=E(u,0,d,0,g),H=T(0,l,0,p,0,v);var Y=h(F,D,U,H),Q=f(F,D,U,H);M=B,N=R,B=I,R=P,I=x,P=C,x=h(b,O,W,J),C=f(O,O,W,J),b=g,O=v,g=d,v=p,d=u,p=l,u=h(W,J,Y,Q),l=f(W,J,Y,Q)}c(this.h,0,u,l),c(this.h,2,d,p),c(this.h,4,g,v),c(this.h,6,b,O),c(this.h,8,x,C),c(this.h,10,I,P),c(this.h,12,B,R),c(this.h,14,M,N)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7038:(e,t,r)=>{"use strict";var n=r(6436).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},6436:(e,t,r)=>{"use strict";var n=r(9746),i=r(5717);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=u(i.toString(16))}return r},t.zero2=a,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var s=new Array(o/4),a=0,u=t;a<s.length;a++,u+=4){var l;l="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],s[a]=l>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u=0,l=t;return u+=(l=l+n>>>0)<t?1:0,u+=(l=l+o>>>0)<o?1:0,e+r+i+s+(u+=(l=l+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,l){var c=0,h=t;return c+=(h=h+n>>>0)<t?1:0,c+=(h=h+o>>>0)<o?1:0,c+=(h=h+a>>>0)<a?1:0,e+r+i+s+u+(c+=(h=h+l>>>0)<l?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,l){return t+n+o+a+l>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+d]=255&s,d+=p,s/=256,l-=8);e[r+d-p]|=128*m}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},1094:(e,t,r)=>{var n;!function(){"use strict";var i="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_SHA3_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?s=r.g:a&&(s=self);var u=!s.JS_SHA3_NO_COMMON_JS&&e.exports,l=r.amdO,c=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),f=[4,1024,262144,67108864],d=[0,8,16,24],p=[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],m=[224,256,384,512],y=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!c||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var b=function(e,t,r){return function(n){return new M(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new M(e,t,i).update(n)[r]()}},A=function(e,t,r){return function(t,n,i,o){return S["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return S["kmac"+e].update(t,n,i,o)[r]()}},T=function(e,t,r,n){for(var i=0;i<g.length;++i){var o=g[i];e[o]=t(r,n,o)}return e},_=function(e,t){var r=b(e,t,"hex");return r.create=function(){return new M(e,t,e)},r.update=function(e){return r.create().update(e)},T(r,b,e,t)},k=[{name:"keccak",padding:[1,256,65536,16777216],bits:m,createMethod:_},{name:"sha3",padding:[6,1536,393216,100663296],bits:m,createMethod:_},{name:"shake",padding:[31,7936,2031616,520093696],bits:y,createMethod:function(e,t){var r=w(e,t,"hex");return r.create=function(r){return new M(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},T(r,w,e,t)}},{name:"cshake",padding:f,bits:y,createMethod:function(e,t){var r=v[e],n=A(e,0,"hex");return n.create=function(n,i,o){return i||o?new M(e,t,n).bytepad([i,o],r):S["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},T(n,A,e,t)}},{name:"kmac",padding:f,bits:y,createMethod:function(e,t){var r=v[e],n=E(e,0,"hex");return n.create=function(n,i,o){return new N(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},T(n,E,e,t)}}],S={},O=[],x=0;x<k.length;++x)for(var C=k[x],I=C.bits,P=0;P<I.length;++P){var B=C.name+"_"+I[P];if(O.push(B),S[B]=C.createMethod(I[P],C.padding),"sha3"!==C.name){var R=C.name+I[P];O.push(R),S[R]=S[B]}}function M(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(e,t,r){M.call(this,e,t,r)}M.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||c&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,s=this.blocks,a=this.byteCount,u=e.length,l=this.blockCount,h=0,f=this.s;h<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<l+1;++n)s[n]=0;if(t)for(n=this.start;h<u&&n<a;++h)s[n>>2]|=e[h]<<d[3&n++];else for(n=this.start;h<u&&n<a;++h)(o=e.charCodeAt(h))<128?s[n>>2]|=o<<d[3&n++]:o<2048?(s[n>>2]|=(192|o>>6)<<d[3&n++],s[n>>2]|=(128|63&o)<<d[3&n++]):o<55296||o>=57344?(s[n>>2]|=(224|o>>12)<<d[3&n++],s[n>>2]|=(128|o>>6&63)<<d[3&n++],s[n>>2]|=(128|63&o)<<d[3&n++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++h)),s[n>>2]|=(240|o>>18)<<d[3&n++],s[n>>2]|=(128|o>>12&63)<<d[3&n++],s[n>>2]|=(128|o>>6&63)<<d[3&n++],s[n>>2]|=(128|63&o)<<d[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[l],n=0;n<l;++n)f[n]^=s[n];L(f),this.reset=!0}else this.start=n}return this},M.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},M.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||c&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var s=0;s<e.length;++s){var a=e.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},M.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},M.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];L(n)}},M.prototype.toString=M.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<t&&s<n;++o,++s)e=r[o],a+=h[e>>4&15]+h[15&e]+h[e>>12&15]+h[e>>8&15]+h[e>>20&15]+h[e>>16&15]+h[e>>28&15]+h[e>>24&15];s%t==0&&(L(r),o=0)}return i&&(e=r[o],a+=h[e>>4&15]+h[15&e],i>1&&(a+=h[e>>12&15]+h[e>>8&15]),i>2&&(a+=h[e>>20&15]+h[e>>16&15])),a},M.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s<n;){for(o=0;o<t&&s<n;++o,++s)u[s]=r[o];s%t==0&&L(r)}return i&&(u[o]=r[o],e=e.slice(0,a)),e},M.prototype.buffer=M.prototype.arrayBuffer,M.prototype.digest=M.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)e=a<<2,t=n[s],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&L(n)}return o&&(e=a<<2,t=n[s],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},N.prototype=new M,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),M.prototype.finalize.call(this)};var L=function(e){var t,r,n,i,o,s,a,u,l,c,h,f,d,m,y,g,v,b,w,A,E,T,_,k,S,O,x,C,I,P,B,R,M,N,L,F,D,U,H,j,z,K,G,q,V,W,J,Y,Q,Z,X,$,ee,te,re,ne,ie,oe,se,ae,ue,le,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|l>>>31),r=o^(l<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(c<<1|h>>>31),r=a^(h<<1|c>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(f<<1|d>>>31),r=l^(d<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=c^(i<<1|o>>>31),r=h^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],y=e[1],W=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,K=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,B=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,M=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,H=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,q=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,O=e[18]<<20|e[19]>>>12,x=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,j=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,T=e[48]<<14|e[49]>>>18,_=e[49]<<14|e[48]>>>18,e[0]=m^~g&b,e[1]=y^~v&w,e[10]=k^~O&C,e[11]=S^~x&I,e[20]=N^~F&U,e[21]=L^~D&H,e[30]=q^~W&Y,e[31]=V^~J&Q,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=g^~b&A,e[3]=v^~w&E,e[12]=O^~C&P,e[13]=x^~I&B,e[22]=F^~U&j,e[23]=D^~H&z,e[32]=W^~Y&Z,e[33]=J^~Q&X,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=b^~A&T,e[5]=w^~E&_,e[14]=C^~P&R,e[15]=I^~B&M,e[24]=U^~j&K,e[25]=H^~z&G,e[34]=Y^~Z&$,e[35]=Q^~X&ee,e[44]=oe^~ae&le,e[45]=se^~ue&ce,e[6]=A^~T&m,e[7]=E^~_&y,e[16]=P^~R&k,e[17]=B^~M&S,e[26]=j^~K&N,e[27]=z^~G&L,e[36]=Z^~$&q,e[37]=X^~ee&V,e[46]=ae^~le&te,e[47]=ue^~ce&re,e[8]=T^~m&g,e[9]=_^~y&v,e[18]=R^~k&O,e[19]=M^~S&x,e[28]=K^~N&F,e[29]=G^~L&D,e[38]=$^~q&W,e[39]=ee^~V&J,e[48]=le^~te&ne,e[49]=ce^~re&ie,e[0]^=p[n],e[1]^=p[n+1]};if(u)e.exports=S;else{for(x=0;x<O.length;++x)s[O[x]]=S[O[x]];l&&(void 0===(n=function(){return S}.call(t,r,t,e))||(e.exports=n))}}()},5117:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Base=void 0;const i=r(8764),o=n(r(1354));class s{print(){s.print(this)}bufferIndexOf(e,t,r=!1){return r?this.binarySearch(e,t,i.Buffer.compare):this.linearSearch(e,t,((e,t)=>e.equals(t)))}static binarySearch(e,t,r){let n=0,i=e.length-1;for(;n<=i;){const o=Math.floor((n+i)/2),s=r(e[o],t);if(0===s){for(let n=o-1;n>=0;n--)if(0!==r(e[n],t))return n+1;return 0}s<0?n=o+1:i=o-1}return-1}binarySearch(e,t,r){return s.binarySearch(e,t,r)}static linearSearch(e,t,r){for(let n=0;n<e.length;n++)if(r(e[n],t))return n;return-1}linearSearch(e,t,r){return s.linearSearch(e,t,r)}static bufferify(e){if(!i.Buffer.isBuffer(e)){if("object"==typeof e&&e.words)return i.Buffer.from(e.toString(o.default.enc.Hex),"hex");if(s.isHexString(e))return i.Buffer.from(e.replace(/^0x/,""),"hex");if("string"==typeof e)return i.Buffer.from(e);if("bigint"==typeof e)return i.Buffer.from(e.toString(16),"hex");if(e instanceof Uint8Array)return i.Buffer.from(e.buffer);if("number"==typeof e){let t=e.toString();return t.length%2&&(t=`0${t}`),i.Buffer.from(t,"hex")}if(ArrayBuffer.isView(e))return i.Buffer.from(e.buffer,e.byteOffset,e.byteLength)}return e}bigNumberify(e){return s.bigNumberify(e)}static bigNumberify(e){if("bigint"==typeof e)return e;if("string"==typeof e)return e.startsWith("0x")&&s.isHexString(e)?BigInt("0x"+e.replace("0x","").toString()):BigInt(e);if(i.Buffer.isBuffer(e))return BigInt("0x"+e.toString("hex"));if(e instanceof Uint8Array)return BigInt(e);if("number"==typeof e)return BigInt(e);throw new Error("cannot bigNumberify")}static isHexString(e){return"string"==typeof e&&/^(0x)?[0-9A-Fa-f]*$/.test(e)}static print(e){console.log(e.toString())}bufferToHex(e,t=!0){return s.bufferToHex(e,t)}static bufferToHex(e,t=!0){return`${t?"0x":""}${(e||i.Buffer.alloc(0)).toString("hex")}`}bufferify(e){return s.bufferify(e)}bufferifyFn(e){return t=>{const r=e(t);return i.Buffer.isBuffer(r)?r:this.isHexString(r)?i.Buffer.from(r.replace("0x",""),"hex"):"string"==typeof r?i.Buffer.from(r):"bigint"==typeof r?i.Buffer.from(t.toString(16),"hex"):ArrayBuffer.isView(r)?i.Buffer.from(r.buffer,r.byteOffset,r.byteLength):i.Buffer.from(e(o.default.enc.Hex.parse(t.toString("hex"))).toString(o.default.enc.Hex),"hex")}}isHexString(e){return s.isHexString(e)}log2(e){return 1===e?0:1+this.log2(e/2|0)}zip(e,t){return e.map(((e,r)=>[e,t[r]]))}static hexZeroPad(e,t){return"0x"+e.replace("0x","").padStart(t,"0")}}t.Base=s,t.default=s},466:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IncrementalMerkleTree=void 0;const i=n(r(5117)),o=n(r(9269));class s extends i.default{constructor(e,t){if(super(),this.hashFn=e,t.depth&&(this.depth=t.depth),t.arity&&(this.arity=t.arity),this.depth<1)throw new Error("depth must be greater than 0");if(this.arity<1)throw new Error("arity must be greater than 0");const r=[];let n=t.zeroValue;if(this.zeroValue=n,this.zeroes=[],this.depth)for(let e=0;e<this.depth;e++)this.zeroes.push(n),r[e]=[],n=this.hashFn(Array(this.arity).fill(n));this.nodes=r,this.root=n}getRoot(){return this.root}getHexRoot(){return this.bufferToHex(this.bufferify(this.getRoot()))}insert(e){if(this.depth&&this.arity&&this.nodes[0].length>=this.getMaxLeaves())throw new Error("tree is full");let t=e,r=this.nodes[0].length;for(let e=0;e<this.depth;e+=1){const n=r-r%this.arity,i=n+this.arity,o=[];this.nodes[e][r]=t;for(let t=n;t<i;t+=1)t<this.nodes[e].length?o.push(this.nodes[e][t]):o.push(this.zeroes[e]);t=this.hashFn(o),r=Math.floor(r/this.arity)}this.root=t}delete(e){this.update(e,this.zeroValue)}update(e,t){if(e<0||e>=this.nodes[0].length)throw new Error("out of bounds");let r=t;for(let t=0;t<this.depth;t+=1){const n=e-e%this.arity,i=n+this.arity,o=[];this.nodes[t][e]=r;for(let e=n;e<i;e+=1)e<this.nodes[t].length?o.push(this.nodes[t][e]):o.push(this.zeroes[t]);r=this.hashFn(o),e=Math.floor(e/this.arity)}this.root=r}getDepth(){return this.depth}getArity(){return this.arity}getMaxLeaves(){return Math.pow(this.depth,this.arity)}indexOf(e){return this.nodes[0].indexOf(e)}getLeaves(){const e=this.copyList(this.nodes[0]);for(let t=this.nodes[0].length;t<this.getMaxLeaves();t++)e[t]=this.zeroValue;return e}copyList(e){return e.map((e=>BigInt(e)))}getLayers(){const e=[];for(const t of this.nodes)e.push(this.copyList(t));if(e[0].length<this.getMaxLeaves()){let t=e[0].length;for(let r=t;r<this.getMaxLeaves();r++)e[0][r]=this.zeroValue;for(let r=0;r<this.depth;r++){const n=t-t%this.arity,i=n+this.arity;for(let t=n;t<i;t++)t>=e[r].length&&(e[r][t]=this.zeroes[r]);t=Math.floor(t/this.arity)}}return e.push([this.root]),e}getHexLayers(){return this.getLayers().reduce(((e,t)=>(Array.isArray(t)?e.push(t.map((e=>this.bufferToHex(this.bufferify(e))))):e.push(t),e)),[])}getLayersAsObject(){const e=this.getLayers().map((e=>e.map((e=>this.bufferToHex(this.bufferify(e),!1))))),t=[];for(let r=0;r<e.length;r++){const n=[];for(let i=0;i<e[r].length;i++){const o={[e[r][i]]:null};if(t.length){o[e[r][i]]={};const n=t.shift(),s=Object.keys(n)[0];if(o[e[r][i]][s]=n[s],t.length){const n=t.shift(),s=Object.keys(n)[0];o[e[r][i]][s]=n[s]}}n.push(o)}t.push(...n)}return t[0]}computeRoot(){let e,t=this.nodes[0].length;for(let r=0;r<this.depth;r+=1){const n=t-t%this.arity,i=n+this.arity,o=[];for(let e=n;e<i;e+=1)e<this.nodes[r].length?o.push(this.nodes[r][e]):o.push(this.zeroes[r]);e=this.hashFn(o),t=Math.floor(t/this.arity)}return e}getProof(e){if(e<0||e>=this.nodes[0].length)throw new Error("The leaf does not exist in this tree");const t=[],r=[],n=e;for(let n=0;n<this.depth;n+=1){const i=e%this.arity,o=e-i,s=o+this.arity;r[n]=i,t[n]=[];for(let r=o;r<s;r+=1)r!==e&&(r<this.nodes[n].length?t[n].push(this.nodes[n][r]):t[n].push(this.zeroes[n]));e=Math.floor(e/this.arity)}return{root:this.root,leaf:this.nodes[0][n],pathIndices:r,siblings:t}}verify(e){let t=e.leaf;for(let r=0;r<e.siblings.length;r+=1){const n=e.siblings[r].slice();n.splice(e.pathIndices[r],0,t),t=this.hashFn(n)}return e.root===t}toString(){return this.toTreeString()}toTreeString(){const e=this.getLayersAsObject();return o.default.asTree(e,!0)}}t.IncrementalMerkleTree=s,"undefined"!=typeof window&&(window.IncrementalMerkleTree=s),t.default=s},4413:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleMountainRange=void 0;const i=r(8764),o=n(r(2153)),s=n(r(5117));class a extends s.default{constructor(e=o.default,t=[],r,n,s){super(),this.root=i.Buffer.alloc(0),this.size=0,this.width=0,this.hashes={},this.data={},t=t.map(this.bufferify),this.hashFn=this.bufferifyFn(e),this.hashLeafFn=r,this.peakBaggingFn=n,this.hashBranchFn=s;for(const e of t)this.append(e)}append(e){e=this.bufferify(e);const t=this.hashFn(e),r=this.bufferToHex(t);this.data[r]&&this.bufferToHex(this.hashFn(this.data[r]))===r||(this.data[r]=e);const n=this.hashLeaf(this.size+1,t);this.hashes[this.size+1]=n,this.width+=1;const i=this.getPeakIndexes(this.width);this.size=this.getSize(this.width);const o=[];for(let e=0;e<i.length;e++)o[e]=this._getOrCreateNode(i[e]);this.root=this.peakBagging(this.width,o)}hashLeaf(e,t){return t=this.bufferify(t),this.hashLeafFn?this.bufferify(this.hashLeafFn(e,t)):this.hashFn(i.Buffer.concat([this.bufferify(e),t]))}hashBranch(e,t,r){return this.hashBranchFn?this.bufferify(this.hashBranchFn(e,t,r)):this.hashFn(i.Buffer.concat([this.bufferify(e),this.bufferify(t),this.bufferify(r)]))}getPeaks(){const e=this.getPeakIndexes(this.width),t=[];for(let r=0;r<e.length;r++)t[r]=this.hashes[e[r]];return t}getLeafIndex(e){return e%2==1?this.getSize(e):this.getSize(e-1)+1}getPeakIndexes(e){const t=this.numOfPeaks(e),r=[];let n=0,i=0;for(let o=255;o>0&&!(0!=(e&1<<o-1)&&(i=i+(1<<o)-1,r[n++]=i,r.length>=t));o--);if(n!==r.length)throw new Error("invalid bit calculation");return r}numOfPeaks(e){let t=e,r=0;for(;t>0;)t%2==1&&r++,t>>=1;return r}peakBagging(e,t){const r=this.getSize(e);if(this.numOfPeaks(e)!==t.length)throw new Error("received invalid number of peaks");return 0!==e||t.length?this.peakBaggingFn?this.bufferify(this.peakBaggingFn(r,t)):this.hashFn(i.Buffer.concat([this.bufferify(r),...t.map(this.bufferify)])):i.Buffer.alloc(0)}getSize(e){return(e<<1)-this.numOfPeaks(e)}getRoot(){return this.root}getHexRoot(){return this.bufferToHex(this.getRoot())}getNode(e){return this.hashes[e]}mountainHeight(e){let t=1;for(;1<<t<=e+t;)t++;return t-1}heightAt(e){let t=e,r=0,n=0;for(;t>r;)t-=(1<<n)-1,n=this.mountainHeight(t),r=(1<<n)-1;return n-(r-t)}isLeaf(e){return 1===this.heightAt(e)}getChildren(e){const t=e-(1<<this.heightAt(e)-1),r=e-1;if(t===r)throw new Error("not a parent");return[t,r]}getMerkleProof(e){if(e>this.size)throw new Error("out of range");if(!this.isLeaf(e))throw new Error("not a leaf");const t=this.root,r=this.width,n=this.getPeakIndexes(this.width),i=[];let o=0;for(let t=0;t<n.length;t++)i[t]=this.hashes[n[t]],n[t]>=e&&0===o&&(o=n[t]);let s=0,a=0,u=this.heightAt(o);const l=[];for(;o!==e;)u--,[s,a]=this.getChildren(o),o=e<=s?s:a,l[u-1]=this.hashes[e<=s?a:s];return{root:t,width:r,peakBagging:i,siblings:l}}verify(e,t,r,n,i,o){if(n=this.bufferify(n),this.getSize(t)<r)throw new Error("index is out of range");if(!e.equals(this.peakBagging(t,i)))throw new Error("invalid root hash from the peaks");let s,a=0;const u=this.getPeakIndexes(t);for(let e=0;e<u.length;e++)if(u[e]>=r){s=i[e],a=u[e];break}if(!s)throw new Error("target not found");let l=o.length+1;const c=new Array(l);let h,f=0,d=0;for(;l>0&&(c[--l]=a,a!==r);)[f,d]=this.getChildren(a),a=r>f?d:f;for(;l<c.length;)a=c[l],h=0===l?this.hashLeaf(a,this.hashFn(n)):a-1===c[l-1]?this.hashBranch(a,o[l-1],h):this.hashBranch(a,h,o[l-1]),l++;if(!h.equals(s))throw new Error("hashed peak is invalid");return!0}peaksToPeakMap(e,t){const r={};let n=0,i=0,o=t.length;for(let s=1;s<=32;s++)n=32-s,i=1<<s-1,r[n]=0!=(e&i)?t[--o]:0;if(0!==o)throw new Error("invalid number of peaks");return r}peakMapToPeaks(e,t){const r=this.numOfPeaks(e),n=new Array(r);let i=0;for(let e=0;e<32;e++)0!==t[e]&&(n[i++]=t[e]);if(i!==r)throw new Error("invalid number of peaks");return n}peakUpdate(e,t,r){const n={},i=e+1;let o=this.getLeafIndex(i),s=this.hashLeaf(o,r),a=0,u=0,l=!1,c=!1,h=!1;for(let r=1;r<=32;r++)a=32-r,h?n[a]=t[a]:(u=1<<r-1,l=0!=(e&u),c=0!=(i&u),o++,l&&(s=this.hashBranch(o,t[a],s)),c?(n[a]=l?t[a]:s,h=!0):n[a]=0);return n}rollUp(e,t,r,n){if(!e.equals(this.peakBagging(t,r)))throw new Error("invalid root hash from the peaks");let i=t,o=this.peaksToPeakMap(t,r);for(let e=0;e<n.length;e++)o=this.peakUpdate(i,o,n[e]),i++;return this.peakBagging(i,this.peakMapToPeaks(i,o))}_getOrCreateNode(e){if(e>this.size)throw new Error("out of range");if(!this.hashes[e]){const[t,r]=this.getChildren(e),n=this._getOrCreateNode(t),i=this._getOrCreateNode(r);this.hashes[e]=this.hashBranch(e,n,i)}return this.hashes[e]}}t.MerkleMountainRange=a,"undefined"!=typeof window&&(window.MerkleMountainRange=a),t.default=a},5028:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleSumTree=t.ProofStep=t.Leaf=t.Bucket=void 0;const i=r(5117);class o{constructor(e,t){this.size=BigInt(e),this.hashed=t,this.parent=null,this.left=null,this.right=null}}t.Bucket=o,t.Leaf=class{constructor(e,t,r){this.hashFn=e,this.rng=t.map((e=>BigInt(e))),this.data=r}getBucket(){let e;return e=this.data?this.hashFn(this.data):n.alloc(32),new o(BigInt(this.rng[1])-BigInt(this.rng[0]),e)}};class s{constructor(e,t){this.bucket=e,this.right=t}}t.ProofStep=s;class a extends i.Base{constructor(e,t){super(),this.leaves=e,this.hashFn=t,a.checkConsecutive(e),this.buckets=[];for(const t of e)this.buckets.push(t.getBucket());let r=[];for(const e of this.buckets)r.push(e);for(;1!==r.length;){const e=[];for(;r.length;)if(r.length>=2){const t=r.shift(),i=r.shift(),s=t.size+i.size,a=this.hashFn(n.concat([this.sizeToBuffer(t.size),this.bufferify(t.hashed),this.sizeToBuffer(i.size),this.bufferify(i.hashed)])),u=new o(s,a);i.parent=u,t.parent=i.parent,t.right=i,i.left=t,e.push(u)}else e.push(r.shift());r=e}this.root=r[0]}sizeToBuffer(e){const t=n.alloc(8);return new DataView(t.buffer).setBigInt64(0,BigInt(e),!1),t}static checkConsecutive(e){let t=BigInt(0);for(const r of e){if(r.rng[0]!==t)throw new Error("leaf ranges are invalid");t=BigInt(r.rng[1])}}getProof(e){let t=this.buckets[Number(e)];const r=[];for(;t&&t.parent;){const e=!!t.right,n=t.right?t.right:t.left;t=t.parent,r.push(new s(n,e))}return r}sum(e){let t=BigInt(0);for(const r of e)t+=BigInt(r);return t}verifyProof(e,t,r){const i=[this.sum(r.filter((e=>!e.right)).map((e=>e.bucket.size))),BigInt(e.size)-this.sum(r.filter((e=>e.right)).map((e=>e.bucket.size)))];if(i[0]!==t.rng[0]||i[1]!==t.rng[1])return!1;let s,a=t.getBucket();for(const e of r)s=e.right?this.hashFn(n.concat([this.sizeToBuffer(a.size),this.bufferify(a.hashed),this.sizeToBuffer(e.bucket.size),this.bufferify(e.bucket.hashed)])):this.hashFn(n.concat([this.sizeToBuffer(e.bucket.size),this.bufferify(e.bucket.hashed),this.sizeToBuffer(a.size),this.bufferify(a.hashed)])),a=new o(BigInt(a.size)+BigInt(e.bucket.size),s);return a.size===e.size&&a.hashed.toString("hex")===e.hashed.toString("hex")}}t.MerkleSumTree=a,"undefined"!=typeof window&&(window.MerkleSumTree=a),t.default=a},8493:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleTree=void 0;const i=r(8764),o=n(r(6351)),s=n(r(2153)),a=n(r(9269)),u=n(r(5117));class l extends u.default{constructor(e,t=s.default,r={}){if(super(),this.duplicateOdd=!1,this.concatenator=i.Buffer.concat,this.hashLeaves=!1,this.isBitcoinTree=!1,this.leaves=[],this.layers=[],this.sortLeaves=!1,this.sortPairs=!1,this.sort=!1,this.fillDefaultHash=null,this.complete=!1,r.complete){if(r.isBitcoinTree)throw new Error('option "complete" is incompatible with "isBitcoinTree"');if(r.duplicateOdd)throw new Error('option "complete" is incompatible with "duplicateOdd"')}if(this.isBitcoinTree=!!r.isBitcoinTree,this.hashLeaves=!!r.hashLeaves,this.sortLeaves=!!r.sortLeaves,this.sortPairs=!!r.sortPairs,this.complete=!!r.complete,r.fillDefaultHash)if("function"==typeof r.fillDefaultHash)this.fillDefaultHash=r.fillDefaultHash;else{if(!i.Buffer.isBuffer(r.fillDefaultHash)&&"string"!=typeof r.fillDefaultHash)throw new Error('method "fillDefaultHash" must be a function, Buffer, or string');this.fillDefaultHash=(e,t)=>r.fillDefaultHash}this.sort=!!r.sort,this.sort&&(this.sortLeaves=!0,this.sortPairs=!0),this.duplicateOdd=!!r.duplicateOdd,r.concatenator&&(this.concatenator=r.concatenator),this.hashFn=this.bufferifyFn(t),this.processLeaves(e)}getOptions(){var e,t;return{complete:this.complete,isBitcoinTree:this.isBitcoinTree,hashLeaves:this.hashLeaves,sortLeaves:this.sortLeaves,sortPairs:this.sortPairs,sort:this.sort,fillDefaultHash:null!==(t=null===(e=this.fillDefaultHash)||void 0===e?void 0:e.toString())&&void 0!==t?t:null,duplicateOdd:this.duplicateOdd}}processLeaves(e){if(this.hashLeaves&&(e=e.map(this.hashFn)),this.leaves=e.map(this.bufferify),this.sortLeaves&&(this.leaves=this.leaves.sort(i.Buffer.compare)),this.fillDefaultHash)for(let e=this.leaves.length;e<Math.pow(2,Math.ceil(Math.log2(this.leaves.length)));e++)this.leaves.push(this.bufferify(this.fillDefaultHash(e,this.hashFn)));this.createHashes(this.leaves)}createHashes(e){for(this.layers=[e];e.length>1;){const t=this.layers.length;this.layers.push([]);const r=this.complete&&1===t&&!Number.isInteger(Math.log2(e.length))?2*e.length-Math.pow(2,Math.ceil(Math.log2(e.length))):e.length;for(let n=0;n<e.length;n+=2){if(n>=r){this.layers[t].push(...e.slice(r));break}if(n+1===e.length&&e.length%2==1){const r=e[e.length-1];let i=r;if(this.isBitcoinTree){i=this.hashFn(this.concatenator([o.default(r),o.default(r)])),i=o.default(this.hashFn(i)),this.layers[t].push(i);continue}if(!this.duplicateOdd){this.layers[t].push(e[n]);continue}}const s=e[n],a=n+1===e.length?s:e[n+1];let u=null;u=this.isBitcoinTree?[o.default(s),o.default(a)]:[s,a],this.sortPairs&&u.sort(i.Buffer.compare);let l=this.hashFn(this.concatenator(u));this.isBitcoinTree&&(l=o.default(this.hashFn(l))),this.layers[t].push(l)}e=this.layers[t]}}addLeaf(e,t=!1){t&&(e=this.hashFn(e)),this.processLeaves(this.leaves.concat(e))}addLeaves(e,t=!1){t&&(e=e.map(this.hashFn)),this.processLeaves(this.leaves.concat(e))}getLeaves(e){return Array.isArray(e)?(this.hashLeaves&&(e=e.map(this.hashFn),this.sortLeaves&&(e=e.sort(i.Buffer.compare))),this.leaves.filter((t=>-1!==this.bufferIndexOf(e,t,this.sortLeaves)))):this.leaves}getLeaf(e){return e<0||e>this.leaves.length-1?i.Buffer.from([]):this.leaves[e]}getLeafIndex(e){e=this.bufferify(e);const t=this.getLeaves();for(let r=0;r<t.length;r++)if(t[r].equals(e))return r;return-1}getLeafCount(){return this.leaves.length}getHexLeaves(){return this.leaves.map((e=>this.bufferToHex(e)))}static marshalLeaves(e){return JSON.stringify(e.map((e=>l.bufferToHex(e))),null,2)}static unmarshalLeaves(e){let t=null;if("string"==typeof e)t=JSON.parse(e);else{if(!(e instanceof Object))throw new Error("Expected type of string or object");t=e}if(!t)return[];if(!Array.isArray(t))throw new Error("Expected JSON string to be array");return t.map(l.bufferify)}getLayers(){return this.layers}getHexLayers(){return this.layers.reduce(((e,t)=>(Array.isArray(t)?e.push(t.map((e=>this.bufferToHex(e)))):e.push(t),e)),[])}getLayersFlat(){const e=this.layers.reduce(((e,t)=>(Array.isArray(t)?e.unshift(...t):e.unshift(t),e)),[]);return e.unshift(i.Buffer.from([0])),e}getHexLayersFlat(){return this.getLayersFlat().map((e=>this.bufferToHex(e)))}getLayerCount(){return this.getLayers().length}getRoot(){return 0===this.layers.length?i.Buffer.from([]):this.layers[this.layers.length-1][0]||i.Buffer.from([])}getHexRoot(){return this.bufferToHex(this.getRoot())}getProof(e,t){if(void 0===e)throw new Error("leaf is required");e=this.bufferify(e);const r=[];if(!Number.isInteger(t)){t=-1;for(let r=0;r<this.leaves.length;r++)0===i.Buffer.compare(e,this.leaves[r])&&(t=r)}if(t<=-1)return[];for(let e=0;e<this.layers.length;e++){const n=this.layers[e],i=t%2,o=i?t-1:this.isBitcoinTree&&t===n.length-1&&e<this.layers.length-1?t:t+1;o<n.length&&r.push({position:i?"left":"right",data:n[o]}),t=t/2|0}return r}getHexProof(e,t){return this.getProof(e,t).map((e=>this.bufferToHex(e.data)))}getProofs(){const e=[];return this.getProofsDFS(this.layers.length-1,0,[],e),e}getProofsDFS(e,t,r,n){const i=t%2;if(-1===e)return void(i||n.push([...r].reverse()));if(t>=this.layers[e].length)return;const o=this.layers[e],s=i?t-1:t+1;let a=!1;s<o.length&&(a=!0,r.push({position:i?"left":"right",data:o[s]}));const u=2*t,l=2*t+1;this.getProofsDFS(e-1,u,r,n),this.getProofsDFS(e-1,l,r,n),a&&r.splice(r.length-1,1)}getHexProofs(){return this.getProofs().map((e=>this.bufferToHex(e.data)))}getPositionalHexProof(e,t){return this.getProof(e,t).map((e=>["left"===e.position?0:1,this.bufferToHex(e.data)]))}static marshalProof(e){const t=e.map((e=>"string"==typeof e?e:i.Buffer.isBuffer(e)?l.bufferToHex(e):{position:e.position,data:l.bufferToHex(e.data)}));return JSON.stringify(t,null,2)}static unmarshalProof(e){let t=null;if("string"==typeof e)t=JSON.parse(e);else{if(!(e instanceof Object))throw new Error("Expected type of string or object");t=e}if(!t)return[];if(!Array.isArray(t))throw new Error("Expected JSON string to be array");return t.map((e=>{if("string"==typeof e)return l.bufferify(e);if(e instanceof Object)return{position:e.position,data:l.bufferify(e.data)};throw new Error("Expected item to be of type string or object")}))}static marshalTree(e){const t=e.getHexRoot(),r=e.leaves.map((e=>l.bufferToHex(e))),n=e.getHexLayers(),i=e.getOptions();return JSON.stringify({options:i,root:t,layers:n,leaves:r},null,2)}static unmarshalTree(e,t=s.default,r={}){let n=null;if("string"==typeof e)n=JSON.parse(e);else{if(!(e instanceof Object))throw new Error("Expected type of string or object");n=e}if(!n)throw new Error("could not parse json");return r=Object.assign({},n.options||{},r),new l(n.leaves,t,r)}getProofIndices(e,t){const r=Math.pow(2,t);let n=new Set;for(const t of e){let e=r+t;for(;e>1;)n.add(1^e),e=e/2|0}const i=e.map((e=>r+e)),o=Array.from(n).sort(((e,t)=>e-t)).reverse();n=i.concat(o);const s=new Set,a=[];for(let e of n)if(!s.has(e))for(a.push(e);e>1&&(s.add(e),s.has(1^e));)e=e/2|0;return a.filter((t=>!e.includes(t-r)))}getProofIndicesForUnevenTree(e,t){const r=Math.ceil(Math.log2(t)),n=[];for(let e=0;e<r;e++)t%2!=0&&n.push({index:e,leavesCount:t}),t=Math.ceil(t/2);const i=[];let o=e;for(let e=0;e<r;e++){let t=o.map((e=>e%2==0?e+1:e-1)).filter((e=>!o.includes(e)));const r=n.find((({index:t})=>t===e));r&&o.includes(r.leavesCount-1)&&(t=t.slice(0,-1)),i.push(t),o=[...new Set(o.map((e=>e%2==0?e/2:e%2==0?(e+1)/2:(e-1)/2)))]}return i}getMultiProof(e,t){if(this.complete||console.warn("Warning: For correct multiProofs it's strongly recommended to set complete: true"),t||(t=e,e=this.getLayersFlat()),this.isUnevenTree()&&t.every(Number.isInteger))return this.getMultiProofForUnevenTree(t);if(!t.every(Number.isInteger)){let e=t;this.sortPairs&&(e=e.sort(i.Buffer.compare));let r=e.map((e=>this.bufferIndexOf(this.leaves,e,this.sortLeaves))).sort(((e,t)=>e===t?0:e>t?1:-1));if(!r.every((e=>-1!==e)))throw new Error("Element does not exist in Merkle tree");const n=[],o=[];let s=[];for(let e=0;e<this.layers.length;e++){const t=this.layers[e];for(let e=0;e<r.length;e++){const i=r[e],a=this.getPairNode(t,i);n.push(t[i]),a&&o.push(a),s.push(i/2|0)}r=s.filter(((e,t,r)=>r.indexOf(e)===t)),s=[]}return o.filter((e=>!n.includes(e)))}return this.getProofIndices(t,Math.log2(e.length/2|0)).map((t=>e[t]))}getMultiProofForUnevenTree(e,t){t||(t=e,e=this.getLayers());let r=[],n=t;for(const t of e){const e=[];for(const r of n){if(r%2==0){const i=r+1;if(!n.includes(i)&&t[i]){e.push(t[i]);continue}}const i=r-1;n.includes(i)||!t[i]||e.push(t[i])}r=r.concat(e);const i=new Set;for(const e of n)e%2!=0?e%2!=0?i.add((e-1)/2):i.add((e+1)/2):i.add(e/2);n=Array.from(i)}return r}getHexMultiProof(e,t){return this.getMultiProof(e,t).map((e=>this.bufferToHex(e)))}getProofFlags(e,t){if(!Array.isArray(e)||e.length<=0)throw new Error("Invalid Inputs!");let r;if(r=e.every(Number.isInteger)?[...e].sort(((e,t)=>e===t?0:e>t?1:-1)):e.map((e=>this.bufferIndexOf(this.leaves,e,this.sortLeaves))).sort(((e,t)=>e===t?0:e>t?1:-1)),!r.every((e=>-1!==e)))throw new Error("Element does not exist in Merkle tree");const n=t.map((e=>this.bufferify(e))),i=[],o=[];for(let e=0;e<this.layers.length;e++){const t=this.layers[e];r=r.reduce(((e,r)=>{if(!i.includes(t[r])){const e=this.getPairNode(t,r),s=n.includes(t[r])||n.includes(e);e&&o.push(!s),i.push(t[r]),i.push(e)}return e.push(r/2|0),e}),[])}return o}verify(e,t,r){let n=this.bufferify(t);if(r=this.bufferify(r),!Array.isArray(e)||!t||!r)return!1;for(let t=0;t<e.length;t++){const r=e[t];let s=null,a=null;if("string"==typeof r)s=this.bufferify(r),a=!0;else if(Array.isArray(r))a=0===r[0],s=this.bufferify(r[1]);else if(i.Buffer.isBuffer(r))s=r,a=!0;else{if(!(r instanceof Object))throw new Error("Expected node to be of type string or object");s=this.bufferify(r.data),a="left"===r.position}const u=[];this.isBitcoinTree?(u.push(o.default(n)),u[a?"unshift":"push"](o.default(s)),n=this.hashFn(this.concatenator(u)),n=o.default(this.hashFn(n))):this.sortPairs?-1===i.Buffer.compare(n,s)?(u.push(n,s),n=this.hashFn(this.concatenator(u))):(u.push(s,n),n=this.hashFn(this.concatenator(u))):(u.push(n),u[a?"unshift":"push"](s),n=this.hashFn(this.concatenator(u)))}return 0===i.Buffer.compare(n,r)}verifyMultiProof(e,t,r,n,o){if(this.isUnevenTree())return this.verifyMultiProofForUnevenTree(e,t,r,n,o);const s=Math.ceil(Math.log2(n));e=this.bufferify(e),r=r.map((e=>this.bufferify(e))),o=o.map((e=>this.bufferify(e)));const a={};for(const[e,n]of this.zip(t,r))a[Math.pow(2,s)+e]=n;for(const[e,r]of this.zip(this.getProofIndices(t,s),o))a[e]=r;let u=Object.keys(a).map((e=>+e)).sort(((e,t)=>e-t));u=u.slice(0,u.length-1);let l=0;for(;l<u.length;){const e=u[l];if(e>=2&&{}.hasOwnProperty.call(a,1^e)){let t=[a[e-e%2],a[e-e%2+1]];this.sortPairs&&(t=t.sort(i.Buffer.compare));const r=t[1]?this.hashFn(this.concatenator(t)):t[0];a[e/2|0]=r,u.push(e/2|0)}l+=1}return!t.length||{}.hasOwnProperty.call(a,1)&&a[1].equals(e)}verifyMultiProofWithFlags(e,t,r,n){e=this.bufferify(e),t=t.map(this.bufferify),r=r.map(this.bufferify);const o=t.length,s=n.length,a=[];let u=0,l=0,c=0;for(let e=0;e<s;e++){const s=[n[e]?u<o?t[u++]:a[l++]:r[c++],u<o?t[u++]:a[l++]].sort(i.Buffer.compare);a[e]=this.hashFn(this.concatenator(s))}return 0===i.Buffer.compare(a[s-1],e)}verifyMultiProofForUnevenTree(e,t,r,n,i){e=this.bufferify(e),r=r.map((e=>this.bufferify(e))),i=i.map((e=>this.bufferify(e)));const o=this.calculateRootForUnevenTree(t,r,n,i);return e.equals(o)}getDepth(){return this.getLayers().length-1}getLayersAsObject(){const e=this.getLayers().map((e=>e.map((e=>this.bufferToHex(e,!1))))),t=[];for(let r=0;r<e.length;r++){const n=[];for(let i=0;i<e[r].length;i++){const o={[e[r][i]]:null};if(t.length){o[e[r][i]]={};const n=t.shift(),s=Object.keys(n)[0];if(o[e[r][i]][s]=n[s],t.length){const n=t.shift(),s=Object.keys(n)[0];o[e[r][i]][s]=n[s]}}n.push(o)}t.push(...n)}return t[0]}static verify(e,t,r,n=s.default,i={}){return new l([],n,i).verify(e,t,r)}static getMultiProof(e,t){return new l([]).getMultiProof(e,t)}resetTree(){this.leaves=[],this.layers=[]}getPairNode(e,t){const r=t%2==0?t+1:t-1;return r<e.length?e[r]:null}toTreeString(){const e=this.getLayersAsObject();return a.default.asTree(e,!0)}toString(){return this.toTreeString()}isUnevenTree(e){const t=(null==e?void 0:e.length)||this.getDepth();return!this.isPowOf2(t)}isPowOf2(e){return e&&!(e&e-1)}calculateRootForUnevenTree(e,t,r,n){const i=this.zip(e,t).sort((([e],[t])=>e-t)),o=i.map((([e])=>e)),s=this.getProofIndicesForUnevenTree(o,r);let a=0;const u=[];for(let e=0;e<s.length;e++){const t=s[e],r=a;a+=t.length,u[e]=this.zip(t,n.slice(r,a))}const l=[i];for(let e=0;e<u.length;e++){const t=u[e].concat(l[e]).sort((([e],[t])=>e-t)).map((([,e])=>e)),r=l[e].map((([e])=>e)),n=[...new Set(r.map((e=>e%2==0?e/2:e%2==0?(e+1)/2:(e-1)/2)))],i=[];for(let e=0;e<n.length;e++){const r=n[e],o=t[2*e],s=t[2*e+1],a=s?this.hashFn(this.concatenator([o,s])):o;i.push([r,a])}l.push(i)}return l[l.length-1][0][1]}}t.MerkleTree=l,"undefined"!=typeof window&&(window.MerkleTree=l),t.default=l},2162:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleTree=void 0;const i=n(r(8493));t.MerkleTree=i.default;var o=r(4413);Object.defineProperty(t,"MerkleMountainRange",{enumerable:!0,get:function(){return o.MerkleMountainRange}});var s=r(466);Object.defineProperty(t,"IncrementalMerkleTree",{enumerable:!0,get:function(){return s.IncrementalMerkleTree}});var a=r(5028);Object.defineProperty(t,"MerkleSumTree",{enumerable:!0,get:function(){return a.MerkleSumTree}}),t.default=i.default},9746:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},7635:function(e){"use strict";!function(t){const r=2147483647;function n(e){const t=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 r=1779033703,n=3144134277,i=1013904242,o=2773480762,s=1359893119,a=2600822924,u=528734635,l=1541459225;const c=new Uint32Array(64);function h(e){let h=0,f=e.length;for(;f>=64;){let d,p,m,y,g,v=r,b=n,w=i,A=o,E=s,T=a,_=u,k=l;for(p=0;p<16;p++)m=h+4*p,c[p]=(255&e[m])<<24|(255&e[m+1])<<16|(255&e[m+2])<<8|255&e[m+3];for(p=16;p<64;p++)d=c[p-2],y=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,d=c[p-15],g=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,c[p]=(y+c[p-7]|0)+(g+c[p-16]|0)|0;for(p=0;p<64;p++)y=(((E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7))+(E&T^~E&_)|0)+(k+(t[p]+c[p]|0)|0)|0,g=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&b^v&w^b&w)|0,k=_,_=T,T=E,E=A+y|0,A=w,w=b,b=v,v=y+g|0;r=r+v|0,n=n+b|0,i=i+w|0,o=o+A|0,s=s+E|0,a=a+T|0,u=u+_|0,l=l+k|0,h+=64,f-=64}}h(e);let f,d=e.length%64,p=e.length/536870912|0,m=e.length<<3,y=d<56?56:120,g=e.slice(e.length-d,e.length);for(g.push(128),f=d+1;f<y;f++)g.push(0);return g.push(p>>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),g.push(m>>>24&255),g.push(m>>>16&255),g.push(m>>>8&255),g.push(m>>>0&255),h(g),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,l>>>24&255,l>>>16&255,l>>>8&255,l>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),s=new Array(64);let a,u=[];for(a=0;a<64;a++)o[a]=54;for(a=0;a<e.length;a++)o[a]^=e[a];for(a=0;a<t.length;a++)o[64+a]=t[a];for(a=i-4;a<i;a++)o[a]=0;for(a=0;a<64;a++)s[a]=92;for(a=0;a<e.length;a++)s[a]^=e[a];function l(){for(let e=i-1;e>=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)l(),u=u.concat(n(s.concat(n(o)))),r-=32;return r>0&&(l(),u=u.concat(n(s.concat(n(o))).slice(0,r))),u}function o(e,t,r,n,i){let o;for(l(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)u(e,16*o,i,16),a(i,n),l(i,0,e,t+16*o,16);for(o=0;o<r;o++)l(e,t+2*o*16,e,16*o,16);for(o=0;o<r;o++)l(e,t+16*(2*o+1),e,16*(o+r),16)}function s(e,t){return e<<t|e>>>32-t}function a(e,t){l(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=s(t[0]+t[12],7),t[8]^=s(t[4]+t[0],9),t[12]^=s(t[8]+t[4],13),t[0]^=s(t[12]+t[8],18),t[9]^=s(t[5]+t[1],7),t[13]^=s(t[9]+t[5],9),t[1]^=s(t[13]+t[9],13),t[5]^=s(t[1]+t[13],18),t[14]^=s(t[10]+t[6],7),t[2]^=s(t[14]+t[10],9),t[6]^=s(t[2]+t[14],13),t[10]^=s(t[6]+t[2],18),t[3]^=s(t[15]+t[11],7),t[7]^=s(t[3]+t[15],9),t[11]^=s(t[7]+t[3],13),t[15]^=s(t[11]+t[7],18),t[1]^=s(t[0]+t[3],7),t[2]^=s(t[1]+t[0],9),t[3]^=s(t[2]+t[1],13),t[0]^=s(t[3]+t[2],18),t[6]^=s(t[5]+t[4],7),t[7]^=s(t[6]+t[5],9),t[4]^=s(t[7]+t[6],13),t[5]^=s(t[4]+t[7],18),t[11]^=s(t[10]+t[9],7),t[8]^=s(t[11]+t[10],9),t[9]^=s(t[8]+t[11],13),t[10]^=s(t[9]+t[8],18),t[12]^=s(t[15]+t[14],7),t[13]^=s(t[12]+t[15],9),t[14]^=s(t[13]+t[12],13),t[15]^=s(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function u(e,t,r,n){for(let i=0;i<n;i++)r[i]^=e[t+i]}function l(e,t,r,n,i){for(;i--;)r[n++]=e[t++]}function c(e){if(!e||"number"!=typeof e.length)return!1;for(let t=0;t<e.length;t++){const r=e[t];if("number"!=typeof r||r%1||r<0||r>=256)return!1}return!0}function h(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function f(e,t,n,s,a,f,d){if(n=h(n,"N"),s=h(s,"r"),a=h(a,"p"),f=h(f,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/s)throw new Error("N too large");if(s>r/128/a)throw new Error("r too large");if(!c(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!c(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=i(e,t,128*a*s);const m=new Uint32Array(32*a*s);for(let e=0;e<m.length;e++){const t=4*e;m[e]=(255&p[t+3])<<24|(255&p[t+2])<<16|(255&p[t+1])<<8|(255&p[t+0])<<0}const y=new Uint32Array(64*s),g=new Uint32Array(32*s*n),v=32*s,b=new Uint32Array(16),w=new Uint32Array(16),A=a*n*2;let E,T,_=0,k=null,S=!1,O=0,x=0;const C=d?parseInt(1e3/s):4294967295,I="undefined"!=typeof setImmediate?setImmediate:setTimeout,P=function(){if(S)return d(new Error("cancelled"),_/A);let t;switch(O){case 0:T=32*x*s,l(m,T,y,0,v),O=1,E=0;case 1:t=n-E,t>C&&(t=C);for(let e=0;e<t;e++)l(y,0,g,(E+e)*v,v),o(y,v,s,b,w);if(E+=t,_+=t,d){const e=parseInt(1e3*_/A);if(e!==k){if(S=d(null,_/A),S)break;k=e}}if(E<n)break;E=0,O=2;case 2:t=n-E,t>C&&(t=C);for(let e=0;e<t;e++){const e=y[16*(2*s-1)]&n-1;u(g,e*v,y,v),o(y,v,s,b,w)}if(E+=t,_+=t,d){const e=parseInt(1e3*_/A);if(e!==k){if(S=d(null,_/A),S)break;k=e}}if(E<n)break;if(l(y,0,m,T,v),x++,x<a){O=0;break}p=[];for(let e=0;e<m.length;e++)p.push(m[e]>>0&255),p.push(m[e]>>8&255),p.push(m[e]>>16&255),p.push(m[e]>>24&255);const r=i(e,p,f);return d&&d(null,1,r),r}d&&I(P)};if(!d)for(;;){const e=P();if(null!=e)return e}P()}const d={scrypt:function(e,t,r,n,i,o,s){return new Promise((function(a,u){let l=0;s&&s(0),f(e,t,r,n,i,o,(function(e,t,r){if(e)u(e);else if(r)s&&1!==l&&s(1),a(new Uint8Array(r));else if(s&&t!==l)return l=t,s(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(f(e,t,r,n,i,o))}};e.exports=d}()},9269:function(e){e.exports=function(){function e(t,r,n,i,o,s,a){var u,l,c="",h=0,f=i.slice(0);if(f.push([r,n])&&i.length>0&&(i.forEach((function(e,t){t>0&&(c+=(e[1]?" ":"│")+"  "),l||e[0]!==r||(l=!0)})),c+=function(e,t){return(t?"└":"├")+(e?"─ ":"──┐")}(t,n)+t,o&&("object"!=typeof r||r instanceof Date)&&(c+=": "+r),l&&(c+=" (circular ref.)"),a(c)),!l&&"object"==typeof r){var d=function(e,t){var r=[];for(var n in e)e.hasOwnProperty(n)&&(t&&"function"==typeof e[n]||r.push(n));return r}(r,s);d.forEach((function(t){u=++h===d.length,e(t,r[t],u,f,o,s,a)}))}}return{asLines:function(t,r,n,i){e(".",t,!1,[],r,"function"!=typeof n&&n,i||n)},asTree:function(t,r,n){var i="";return e(".",t,!1,[],r,n,(function(e){i+=e+"\n"})),i}}}()},6601:()=>{}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),seaport=r(8272),window.seaport=seaport})();