Files
to_session/text/3.65.22_0/scripts/ui/chunk-M3ECH327.js
Administrator a0720d80dc fefdwef
2025-11-12 12:54:37 +08:00

10 lines
309 KiB
JavaScript

import{a as du}from"./chunk-J3GMOYOU.js";import{a as Io,b as Lr}from"./chunk-BO2NVVQH.js";import{a as dr,b as Fo,c as Ot}from"./chunk-6JFRAZNP.js";import{a as St,c as lr,d as Ti,e as re}from"./chunk-4XEB4VJJ.js";import{a as U,b as ee,c as Oe}from"./chunk-OKJNV4PS.js";import{k as lu}from"./chunk-IAFVNOEB.js";import{c as E,o as d,q as h}from"./chunk-QTLWQ5AJ.js";var jo=E(un=>{"use strict";d();h();Object.defineProperty(un,"__esModule",{value:!0});un.version=void 0;un.version="abstract-signer/5.7.0"});var fn=E(Ae=>{"use strict";d();h();var hu=Ae&&Ae.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),je=Ae&&Ae.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},qe=Ae&&Ae.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.VoidSigner=Ae.Signer=void 0;var hr=re(),tr=U(),xu=jo(),Re=new tr.Logger(xu.version),pu=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],bu=[tr.Logger.errors.INSUFFICIENT_FUNDS,tr.Logger.errors.NONCE_EXPIRED,tr.Logger.errors.REPLACEMENT_UNDERPRICED],qo=function(){function i(){var r=this.constructor;Re.checkAbstract(r,i),(0,hr.defineReadOnly)(this,"_isSigner",!0)}return i.prototype.getBalance=function(r){return je(this,void 0,void 0,function(){return qe(this,function(e){switch(e.label){case 0:return this._checkProvider("getBalance"),[4,this.provider.getBalance(this.getAddress(),r)];case 1:return[2,e.sent()]}})})},i.prototype.getTransactionCount=function(r){return je(this,void 0,void 0,function(){return qe(this,function(e){switch(e.label){case 0:return this._checkProvider("getTransactionCount"),[4,this.provider.getTransactionCount(this.getAddress(),r)];case 1:return[2,e.sent()]}})})},i.prototype.estimateGas=function(r){return je(this,void 0,void 0,function(){var e;return qe(this,function(t){switch(t.label){case 0:return this._checkProvider("estimateGas"),[4,(0,hr.resolveProperties)(this.checkTransaction(r))];case 1:return e=t.sent(),[4,this.provider.estimateGas(e)];case 2:return[2,t.sent()]}})})},i.prototype.call=function(r,e){return je(this,void 0,void 0,function(){var t;return qe(this,function(n){switch(n.label){case 0:return this._checkProvider("call"),[4,(0,hr.resolveProperties)(this.checkTransaction(r))];case 1:return t=n.sent(),[4,this.provider.call(t,e)];case 2:return[2,n.sent()]}})})},i.prototype.sendTransaction=function(r){return je(this,void 0,void 0,function(){var e,t;return qe(this,function(n){switch(n.label){case 0:return this._checkProvider("sendTransaction"),[4,this.populateTransaction(r)];case 1:return e=n.sent(),[4,this.signTransaction(e)];case 2:return t=n.sent(),[4,this.provider.sendTransaction(t)];case 3:return[2,n.sent()]}})})},i.prototype.getChainId=function(){return je(this,void 0,void 0,function(){var r;return qe(this,function(e){switch(e.label){case 0:return this._checkProvider("getChainId"),[4,this.provider.getNetwork()];case 1:return r=e.sent(),[2,r.chainId]}})})},i.prototype.getGasPrice=function(){return je(this,void 0,void 0,function(){return qe(this,function(r){switch(r.label){case 0:return this._checkProvider("getGasPrice"),[4,this.provider.getGasPrice()];case 1:return[2,r.sent()]}})})},i.prototype.getFeeData=function(){return je(this,void 0,void 0,function(){return qe(this,function(r){switch(r.label){case 0:return this._checkProvider("getFeeData"),[4,this.provider.getFeeData()];case 1:return[2,r.sent()]}})})},i.prototype.resolveName=function(r){return je(this,void 0,void 0,function(){return qe(this,function(e){switch(e.label){case 0:return this._checkProvider("resolveName"),[4,this.provider.resolveName(r)];case 1:return[2,e.sent()]}})})},i.prototype.checkTransaction=function(r){for(var e in r)pu.indexOf(e)===-1&&Re.throwArgumentError("invalid transaction key: "+e,"transaction",r);var t=(0,hr.shallowCopy)(r);return t.from==null?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then(function(n){return n[0].toLowerCase()!==n[1].toLowerCase()&&Re.throwArgumentError("from address mismatch","transaction",r),n[0]}),t},i.prototype.populateTransaction=function(r){return je(this,void 0,void 0,function(){var e,t,n,o,s=this;return qe(this,function(c){switch(c.label){case 0:return[4,(0,hr.resolveProperties)(this.checkTransaction(r))];case 1:return e=c.sent(),e.to!=null&&(e.to=Promise.resolve(e.to).then(function(u){return je(s,void 0,void 0,function(){var a;return qe(this,function(f){switch(f.label){case 0:return u==null?[2,null]:[4,this.resolveName(u)];case 1:return a=f.sent(),a==null&&Re.throwArgumentError("provided ENS name resolves to null","tx.to",u),[2,a]}})})}),e.to.catch(function(u){})),t=e.maxFeePerGas!=null||e.maxPriorityFeePerGas!=null,e.gasPrice!=null&&(e.type===2||t)?Re.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",r):(e.type===0||e.type===1)&&t&&Re.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",r),(e.type===2||e.type==null)&&e.maxFeePerGas!=null&&e.maxPriorityFeePerGas!=null?(e.type=2,[3,5]):[3,2];case 2:return e.type===0||e.type===1?(e.gasPrice==null&&(e.gasPrice=this.getGasPrice()),[3,5]):[3,3];case 3:return[4,this.getFeeData()];case 4:n=c.sent(),e.type==null?n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null?(e.type=2,e.gasPrice!=null?(o=e.gasPrice,delete e.gasPrice,e.maxFeePerGas=o,e.maxPriorityFeePerGas=o):(e.maxFeePerGas==null&&(e.maxFeePerGas=n.maxFeePerGas),e.maxPriorityFeePerGas==null&&(e.maxPriorityFeePerGas=n.maxPriorityFeePerGas))):n.gasPrice!=null?(t&&Re.throwError("network does not support EIP-1559",tr.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),e.gasPrice==null&&(e.gasPrice=n.gasPrice),e.type=0):Re.throwError("failed to get consistent fee data",tr.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):e.type===2&&(e.maxFeePerGas==null&&(e.maxFeePerGas=n.maxFeePerGas),e.maxPriorityFeePerGas==null&&(e.maxPriorityFeePerGas=n.maxPriorityFeePerGas)),c.label=5;case 5:return e.nonce==null&&(e.nonce=this.getTransactionCount("pending")),e.gasLimit==null&&(e.gasLimit=this.estimateGas(e).catch(function(u){if(bu.indexOf(u.code)>=0)throw u;return Re.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",tr.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:u,tx:e})})),e.chainId==null?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then(function(u){return u[1]!==0&&u[0]!==u[1]&&Re.throwArgumentError("chainId address mismatch","transaction",r),u[0]}),[4,(0,hr.resolveProperties)(e)];case 6:return[2,c.sent()]}})})},i.prototype._checkProvider=function(r){this.provider||Re.throwError("missing provider",tr.Logger.errors.UNSUPPORTED_OPERATION,{operation:r||"_checkProvider"})},i.isSigner=function(r){return!!(r&&r._isSigner)},i}();Ae.Signer=qo;var gu=function(i){hu(r,i);function r(e,t){var n=i.call(this)||this;return(0,hr.defineReadOnly)(n,"address",e),(0,hr.defineReadOnly)(n,"provider",t||null),n}return r.prototype.getAddress=function(){return Promise.resolve(this.address)},r.prototype._fail=function(e,t){return Promise.resolve().then(function(){Re.throwError(e,tr.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})},r.prototype.signMessage=function(e){return this._fail("VoidSigner cannot sign messages","signMessage")},r.prototype.signTransaction=function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")},r.prototype._signTypedData=function(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")},r.prototype.connect=function(e){return new r(this.address,e)},r}(qo);Ae.VoidSigner=gu});var Gr=E(ln=>{"use strict";d();h();Object.defineProperty(ln,"__esModule",{value:!0});ln.version=void 0;ln.version="abi/5.7.0"});var yn=E(C=>{"use strict";d();h();var pn=C&&C.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(C,"__esModule",{value:!0});C.ErrorFragment=C.FunctionFragment=C.ConstructorFragment=C.EventFragment=C.Fragment=C.ParamType=C.FormatTypes=void 0;var Bi=Oe(),yu=re(),bn=U(),vu=Gr(),M=new bn.Logger(vu.version),Br={},Do={calldata:!0,memory:!0,storage:!0},mu={calldata:!0,memory:!0};function dn(i,r){if(i==="bytes"||i==="string"){if(Do[r])return!0}else if(i==="address"){if(r==="payable")return!0}else if((i.indexOf("[")>=0||i==="tuple")&&mu[r])return!0;return(Do[r]||r==="payable")&&M.throwArgumentError("invalid modifier","name",r),!1}function _u(i,r){var e=i;function t(l){M.throwArgumentError("unexpected character at position "+l,"param",i)}i=i.replace(/\s/g," ");function n(l){var p={type:"",name:"",parent:l,state:{allowType:!0}};return r&&(p.indexed=!1),p}for(var o={type:"",name:"",state:{allowType:!0}},s=o,c=0;c<i.length;c++){var u=i[c];switch(u){case"(":s.state.allowType&&s.type===""?s.type="tuple":s.state.allowParams||t(c),s.state.allowType=!1,s.type=Hr(s.type),s.components=[n(s)],s=s.components[0];break;case")":delete s.state,s.name==="indexed"&&(r||t(c),s.indexed=!0,s.name=""),dn(s.type,s.name)&&(s.name=""),s.type=Hr(s.type);var a=s;s=s.parent,s||t(c),delete a.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,s.name==="indexed"&&(r||t(c),s.indexed=!0,s.name=""),dn(s.type,s.name)&&(s.name=""),s.type=Hr(s.type);var f=n(s.parent);s.parent.components.push(f),delete s.parent,s=f;break;case" ":s.state.allowType&&s.type!==""&&(s.type=Hr(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&s.name!==""&&(s.name==="indexed"?(r||t(c),s.indexed&&t(c),s.indexed=!0,s.name=""):dn(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||t(c),s.type+=u,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||t(c),s.type+=u,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=u,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=u,delete s.state.allowArray):s.state.readArray?s.type+=u:t(c)}}return s.parent&&M.throwArgumentError("unexpected eof","param",i),delete o.state,s.name==="indexed"?(r||t(e.length-7),s.indexed&&t(e.length-7),s.indexed=!0,s.name=""):dn(s.type,s.name)&&(s.name=""),o.type=Hr(o.type),o}function hn(i,r){for(var e in r)(0,yu.defineReadOnly)(i,e,r[e])}C.FormatTypes=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"});var wu=new RegExp(/^(.*)\[([0-9]*)\]$/),Ir=function(){function i(r,e){r!==Br&&M.throwError("use fromString",bn.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),hn(this,e);var t=this.type.match(wu);t?hn(this,{arrayLength:parseInt(t[2]||"-1"),arrayChildren:i.fromObject({type:t[1],components:this.components}),baseType:"array"}):hn(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return i.prototype.format=function(r){if(r||(r=C.FormatTypes.sighash),C.FormatTypes[r]||M.throwArgumentError("invalid format type","format",r),r===C.FormatTypes.json){var e={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map(function(n){return JSON.parse(n.format(r))})),JSON.stringify(e)}var t="";return this.baseType==="array"?(t+=this.arrayChildren.format(r),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(r!==C.FormatTypes.sighash&&(t+=this.type),t+="("+this.components.map(function(n){return n.format(r)}).join(r===C.FormatTypes.full?", ":",")+")"):t+=this.type,r!==C.FormatTypes.sighash&&(this.indexed===!0&&(t+=" indexed"),r===C.FormatTypes.full&&this.name&&(t+=" "+this.name)),t},i.from=function(r,e){return typeof r=="string"?i.fromString(r,e):i.fromObject(r)},i.fromObject=function(r){return i.isParamType(r)?r:new i(Br,{name:r.name||null,type:Hr(r.type),indexed:r.indexed==null?null:!!r.indexed,components:r.components?r.components.map(i.fromObject):null})},i.fromString=function(r,e){function t(n){return i.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components})}return t(_u(r,!!e))},i.isParamType=function(r){return!!(r!=null&&r._isParamType)},i}();C.ParamType=Ir;function Rt(i,r){return Pu(i).map(function(e){return Ir.fromString(e,r)})}var gn=function(){function i(r,e){r!==Br&&M.throwError("use a static from method",bn.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),hn(this,e),this._isFragment=!0,Object.freeze(this)}return i.from=function(r){return i.isFragment(r)?r:typeof r=="string"?i.fromString(r):i.fromObject(r)},i.fromObject=function(r){if(i.isFragment(r))return r;switch(r.type){case"function":return Ni.fromObject(r);case"event":return Ci.fromObject(r);case"constructor":return xn.fromObject(r);case"error":return Li.fromObject(r);case"fallback":case"receive":return null}return M.throwArgumentError("invalid fragment object","value",r)},i.fromString=function(r){return r=r.replace(/\s/g," "),r=r.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),r=r.trim(),r.split(" ")[0]==="event"?Ci.fromString(r.substring(5).trim()):r.split(" ")[0]==="function"?Ni.fromString(r.substring(8).trim()):r.split("(")[0].trim()==="constructor"?xn.fromString(r.trim()):r.split(" ")[0]==="error"?Li.fromString(r.substring(5).trim()):M.throwArgumentError("unsupported fragment","value",r)},i.isFragment=function(r){return!!(r&&r._isFragment)},i}();C.Fragment=gn;var Ci=function(i){pn(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.format=function(e){if(e||(e=C.FormatTypes.sighash),C.FormatTypes[e]||M.throwArgumentError("invalid format type","format",e),e===C.FormatTypes.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(function(n){return JSON.parse(n.format(e))})});var t="";return e!==C.FormatTypes.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map(function(n){return n.format(e)}).join(e===C.FormatTypes.full?", ":",")+") ",e!==C.FormatTypes.sighash&&this.anonymous&&(t+="anonymous "),t.trim()},r.from=function(e){return typeof e=="string"?r.fromString(e):r.fromObject(e)},r.fromObject=function(e){if(r.isEventFragment(e))return e;e.type!=="event"&&M.throwArgumentError("invalid event object","value",e);var t={name:At(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Ir.fromObject):[],type:"event"};return new r(Br,t)},r.fromString=function(e){var t=e.match(Tt);t||M.throwArgumentError("invalid event string","value",e);var n=!1;return t[3].split(" ").forEach(function(o){switch(o.trim()){case"anonymous":n=!0;break;case"":break;default:M.warn("unknown modifier: "+o)}}),r.fromObject({name:t[1].trim(),anonymous:n,inputs:Rt(t[2],!0),type:"event"})},r.isEventFragment=function(e){return e&&e._isFragment&&e.type==="event"},r}(gn);C.EventFragment=Ci;function Uo(i,r){r.gas=null;var e=i.split("@");return e.length!==1?(e.length>2&&M.throwArgumentError("invalid human-readable ABI signature","value",i),e[1].match(/^[0-9]+$/)||M.throwArgumentError("invalid human-readable ABI signature gas","value",i),r.gas=Bi.BigNumber.from(e[1]),e[0]):i}function Wo(i,r){r.constant=!1,r.payable=!1,r.stateMutability="nonpayable",i.split(" ").forEach(function(e){switch(e.trim()){case"constant":r.constant=!0;break;case"payable":r.payable=!0,r.stateMutability="payable";break;case"nonpayable":r.payable=!1,r.stateMutability="nonpayable";break;case"pure":r.constant=!0,r.stateMutability="pure";break;case"view":r.constant=!0,r.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}})}function Go(i){var r={constant:!1,payable:!0,stateMutability:"payable"};return i.stateMutability!=null?(r.stateMutability=i.stateMutability,r.constant=r.stateMutability==="view"||r.stateMutability==="pure",i.constant!=null&&!!i.constant!==r.constant&&M.throwArgumentError("cannot have constant function with mutability "+r.stateMutability,"value",i),r.payable=r.stateMutability==="payable",i.payable!=null&&!!i.payable!==r.payable&&M.throwArgumentError("cannot have payable function with mutability "+r.stateMutability,"value",i)):i.payable!=null?(r.payable=!!i.payable,i.constant==null&&!r.payable&&i.type!=="constructor"&&M.throwArgumentError("unable to determine stateMutability","value",i),r.constant=!!i.constant,r.constant?r.stateMutability="view":r.stateMutability=r.payable?"payable":"nonpayable",r.payable&&r.constant&&M.throwArgumentError("cannot have constant payable function","value",i)):i.constant!=null?(r.constant=!!i.constant,r.payable=!r.constant,r.stateMutability=r.constant?"view":"payable"):i.type!=="constructor"&&M.throwArgumentError("unable to determine stateMutability","value",i),r}var xn=function(i){pn(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.format=function(e){if(e||(e=C.FormatTypes.sighash),C.FormatTypes[e]||M.throwArgumentError("invalid format type","format",e),e===C.FormatTypes.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(function(n){return JSON.parse(n.format(e))})});e===C.FormatTypes.sighash&&M.throwError("cannot format a constructor for sighash",bn.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map(function(n){return n.format(e)}).join(e===C.FormatTypes.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(t+=this.stateMutability+" "),t.trim()},r.from=function(e){return typeof e=="string"?r.fromString(e):r.fromObject(e)},r.fromObject=function(e){if(r.isConstructorFragment(e))return e;e.type!=="constructor"&&M.throwArgumentError("invalid constructor object","value",e);var t=Go(e);t.constant&&M.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Ir.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Bi.BigNumber.from(e.gas):null};return new r(Br,n)},r.fromString=function(e){var t={type:"constructor"};e=Uo(e,t);var n=e.match(Tt);return(!n||n[1].trim()!=="constructor")&&M.throwArgumentError("invalid constructor string","value",e),t.inputs=Rt(n[2].trim(),!1),Wo(n[3].trim(),t),r.fromObject(t)},r.isConstructorFragment=function(e){return e&&e._isFragment&&e.type==="constructor"},r}(gn);C.ConstructorFragment=xn;var Ni=function(i){pn(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.format=function(e){if(e||(e=C.FormatTypes.sighash),C.FormatTypes[e]||M.throwArgumentError("invalid format type","format",e),e===C.FormatTypes.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(function(n){return JSON.parse(n.format(e))}),outputs:this.outputs.map(function(n){return JSON.parse(n.format(e))})});var t="";return e!==C.FormatTypes.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map(function(n){return n.format(e)}).join(e===C.FormatTypes.full?", ":",")+") ",e!==C.FormatTypes.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map(function(n){return n.format(e)}).join(", ")+") "),this.gas!=null&&(t+="@"+this.gas.toString()+" ")),t.trim()},r.from=function(e){return typeof e=="string"?r.fromString(e):r.fromObject(e)},r.fromObject=function(e){if(r.isFunctionFragment(e))return e;e.type!=="function"&&M.throwArgumentError("invalid function object","value",e);var t=Go(e),n={type:e.type,name:At(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Ir.fromObject):[],outputs:e.outputs?e.outputs.map(Ir.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Bi.BigNumber.from(e.gas):null};return new r(Br,n)},r.fromString=function(e){var t={type:"function"};e=Uo(e,t);var n=e.split(" returns ");n.length>2&&M.throwArgumentError("invalid function string","value",e);var o=n[0].match(Tt);if(o||M.throwArgumentError("invalid function signature","value",e),t.name=o[1].trim(),t.name&&At(t.name),t.inputs=Rt(o[2],!1),Wo(o[3].trim(),t),n.length>1){var s=n[1].match(Tt);(s[1].trim()!=""||s[3].trim()!="")&&M.throwArgumentError("unexpected tokens","value",e),t.outputs=Rt(s[2],!1)}else t.outputs=[];return r.fromObject(t)},r.isFunctionFragment=function(e){return e&&e._isFragment&&e.type==="function"},r}(xn);C.FunctionFragment=Ni;function Mo(i){var r=i.format();return(r==="Error(string)"||r==="Panic(uint256)")&&M.throwArgumentError("cannot specify user defined "+r+" error","fragment",i),i}var Li=function(i){pn(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.format=function(e){if(e||(e=C.FormatTypes.sighash),C.FormatTypes[e]||M.throwArgumentError("invalid format type","format",e),e===C.FormatTypes.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(function(n){return JSON.parse(n.format(e))})});var t="";return e!==C.FormatTypes.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map(function(n){return n.format(e)}).join(e===C.FormatTypes.full?", ":",")+") ",t.trim()},r.from=function(e){return typeof e=="string"?r.fromString(e):r.fromObject(e)},r.fromObject=function(e){if(r.isErrorFragment(e))return e;e.type!=="error"&&M.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:At(e.name),inputs:e.inputs?e.inputs.map(Ir.fromObject):[]};return Mo(new r(Br,t))},r.fromString=function(e){var t={type:"error"},n=e.match(Tt);return n||M.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&At(t.name),t.inputs=Rt(n[2],!1),Mo(r.fromObject(t))},r.isErrorFragment=function(e){return e&&e._isFragment&&e.type==="error"},r}(gn);C.ErrorFragment=Li;function Hr(i){return i.match(/^uint($|[^1-9])/)?i="uint256"+i.substring(4):i.match(/^int($|[^1-9])/)&&(i="int256"+i.substring(3)),i}var Eu=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function At(i){return(!i||!i.match(Eu))&&M.throwArgumentError('invalid identifier "'+i+'"',"value",i),i}var Tt=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Pu(i){i=i.trim();for(var r=[],e="",t=0,n=0;n<i.length;n++){var o=i[n];o===","&&t===0?(r.push(e),e=""):(e+=o,o==="("?t++:o===")"&&(t--,t===-1&&M.throwArgumentError("unbalanced parenthesis","value",i)))}return e&&r.push(e),r}});var Te=E(We=>{"use strict";d();h();Object.defineProperty(We,"__esModule",{value:!0});We.Reader=We.Writer=We.Coder=We.checkResultErrors=void 0;var xr=ee(),Ho=Oe(),Ct=re(),Ii=U(),ku=Gr(),Fi=new Ii.Logger(ku.version);function Su(i){var r=[],e=function(t,n){if(!!Array.isArray(n))for(var o in n){var s=t.slice();s.push(o);try{e(s,n[o])}catch(c){r.push({path:s,error:c})}}};return e([],i),r}We.checkResultErrors=Su;var Ou=function(){function i(r,e,t,n){this.name=r,this.type=e,this.localName=t,this.dynamic=n}return i.prototype._throwError=function(r,e){Fi.throwArgumentError(r,this.localName,e)},i}();We.Coder=Ou;var Ru=function(){function i(r){(0,Ct.defineReadOnly)(this,"wordSize",r||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(r)}return Object.defineProperty(i.prototype,"data",{get:function(){return(0,xr.hexConcat)(this._data)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"length",{get:function(){return this._dataLength},enumerable:!1,configurable:!0}),i.prototype._writeData=function(r){return this._data.push(r),this._dataLength+=r.length,r.length},i.prototype.appendWriter=function(r){return this._writeData((0,xr.concat)(r._data))},i.prototype.writeBytes=function(r){var e=(0,xr.arrayify)(r),t=e.length%this.wordSize;return t&&(e=(0,xr.concat)([e,this._padding.slice(t)])),this._writeData(e)},i.prototype._getValue=function(r){var e=(0,xr.arrayify)(Ho.BigNumber.from(r));return e.length>this.wordSize&&Fi.throwError("value out-of-bounds",Ii.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=(0,xr.concat)([this._padding.slice(e.length%this.wordSize),e])),e},i.prototype.writeValue=function(r){return this._writeData(this._getValue(r))},i.prototype.writeUpdatableValue=function(){var r=this,e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(t){r._data[e]=r._getValue(t)}},i}();We.Writer=Ru;var Au=function(){function i(r,e,t,n){(0,Ct.defineReadOnly)(this,"_data",(0,xr.arrayify)(r)),(0,Ct.defineReadOnly)(this,"wordSize",e||32),(0,Ct.defineReadOnly)(this,"_coerceFunc",t),(0,Ct.defineReadOnly)(this,"allowLoose",n),this._offset=0}return Object.defineProperty(i.prototype,"data",{get:function(){return(0,xr.hexlify)(this._data)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"consumed",{get:function(){return this._offset},enumerable:!1,configurable:!0}),i.coerce=function(r,e){var t=r.match("^u?int([0-9]+)$");return t&&parseInt(t[1])<=48&&(e=e.toNumber()),e},i.prototype.coerce=function(r,e){return this._coerceFunc?this._coerceFunc(r,e):i.coerce(r,e)},i.prototype._peekBytes=function(r,e,t){var n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&t&&this._offset+e<=this._data.length?n=e:Fi.throwError("data out-of-bounds",Ii.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)},i.prototype.subReader=function(r){return new i(this._data.slice(this._offset+r),this.wordSize,this._coerceFunc,this.allowLoose)},i.prototype.readBytes=function(r,e){var t=this._peekBytes(0,r,!!e);return this._offset+=t.length,t.slice(0,r)},i.prototype.readValue=function(){return Ho.BigNumber.from(this.readBytes(this.wordSize))},i}();We.Reader=Au});var Ko=E(Jr=>{"use strict";d();h();var Tu=Jr&&Jr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Jr,"__esModule",{value:!0});Jr.AddressCoder=void 0;var Jo=lr(),Cu=ee(),Nu=Te(),Lu=function(i){Tu(r,i);function r(e){return i.call(this,"address","address",e,!1)||this}return r.prototype.defaultValue=function(){return"0x0000000000000000000000000000000000000000"},r.prototype.encode=function(e,t){try{t=(0,Jo.getAddress)(t)}catch(n){this._throwError(n.message,t)}return e.writeValue(t)},r.prototype.decode=function(e){return(0,Jo.getAddress)((0,Cu.hexZeroPad)(e.readValue().toHexString(),20))},r}(Nu.Coder);Jr.AddressCoder=Lu});var Vo=E(Kr=>{"use strict";d();h();var Bu=Kr&&Kr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Kr,"__esModule",{value:!0});Kr.AnonymousCoder=void 0;var Iu=Te(),Fu=function(i){Bu(r,i);function r(e){var t=i.call(this,e.name,e.type,void 0,e.dynamic)||this;return t.coder=e,t}return r.prototype.defaultValue=function(){return this.coder.defaultValue()},r.prototype.encode=function(e,t){return this.coder.encode(e,t)},r.prototype.decode=function(e){return this.coder.decode(e)},r}(Iu.Coder);Kr.AnonymousCoder=Fu});var qi=E(Ge=>{"use strict";d();h();var ju=Ge&&Ge.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ArrayCoder=Ge.unpack=Ge.pack=void 0;var zr=U(),qu=Gr(),Vr=new zr.Logger(qu.version),ji=Te(),Du=Vo();function zo(i,r,e){var t=null;if(Array.isArray(e))t=e;else if(e&&typeof e=="object"){var n={};t=r.map(function(a){var f=a.localName;return f||Vr.throwError("cannot encode object for signature with missing names",zr.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:a,value:e}),n[f]&&Vr.throwError("cannot encode object for signature with duplicate names",zr.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:a,value:e}),n[f]=!0,e[f]})}else Vr.throwArgumentError("invalid tuple value","tuple",e);r.length!==t.length&&Vr.throwArgumentError("types/value length mismatch","tuple",e);var o=new ji.Writer(i.wordSize),s=new ji.Writer(i.wordSize),c=[];r.forEach(function(a,f){var l=t[f];if(a.dynamic){var p=s.length;a.encode(s,l);var y=o.writeUpdatableValue();c.push(function(S){y(S+p)})}else a.encode(o,l)}),c.forEach(function(a){a(o.length)});var u=i.appendWriter(o);return u+=i.appendWriter(s),u}Ge.pack=zo;function Zo(i,r){var e=[],t=i.subReader(0);r.forEach(function(c){var u=null;if(c.dynamic){var a=i.readValue(),f=t.subReader(a.toNumber());try{u=c.decode(f)}catch(l){if(l.code===zr.Logger.errors.BUFFER_OVERRUN)throw l;u=l,u.baseType=c.name,u.name=c.localName,u.type=c.type}}else try{u=c.decode(i)}catch(l){if(l.code===zr.Logger.errors.BUFFER_OVERRUN)throw l;u=l,u.baseType=c.name,u.name=c.localName,u.type=c.type}u!=null&&e.push(u)});var n=r.reduce(function(c,u){var a=u.localName;return a&&(c[a]||(c[a]=0),c[a]++),c},{});r.forEach(function(c,u){var a=c.localName;if(!(!a||n[a]!==1)&&(a==="length"&&(a="_length"),e[a]==null)){var f=e[u];f instanceof Error?Object.defineProperty(e,a,{enumerable:!0,get:function(){throw f}}):e[a]=f}});for(var o=function(c){var u=e[c];u instanceof Error&&Object.defineProperty(e,c,{enumerable:!0,get:function(){throw u}})},s=0;s<e.length;s++)o(s);return Object.freeze(e)}Ge.unpack=Zo;var Mu=function(i){ju(r,i);function r(e,t,n){var o=this,s=e.type+"["+(t>=0?t:"")+"]",c=t===-1||e.dynamic;return o=i.call(this,"array",s,n,c)||this,o.coder=e,o.length=t,o}return r.prototype.defaultValue=function(){for(var e=this.coder.defaultValue(),t=[],n=0;n<this.length;n++)t.push(e);return t},r.prototype.encode=function(e,t){Array.isArray(t)||this._throwError("expected array value",t);var n=this.length;n===-1&&(n=t.length,e.writeValue(t.length)),Vr.checkArgumentCount(t.length,n,"coder array"+(this.localName?" "+this.localName:""));for(var o=[],s=0;s<t.length;s++)o.push(this.coder);return zo(e,o,t)},r.prototype.decode=function(e){var t=this.length;t===-1&&(t=e.readValue().toNumber(),t*32>e._data.length&&Vr.throwError("insufficient data length",zr.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));for(var n=[],o=0;o<t;o++)n.push(new Du.AnonymousCoder(this.coder));return e.coerce(this.name,Zo(e,n))},r}(ji.Coder);Ge.ArrayCoder=Mu});var $o=E(Zr=>{"use strict";d();h();var Uu=Zr&&Zr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Zr,"__esModule",{value:!0});Zr.BooleanCoder=void 0;var Wu=Te(),Gu=function(i){Uu(r,i);function r(e){return i.call(this,"bool","bool",e,!1)||this}return r.prototype.defaultValue=function(){return!1},r.prototype.encode=function(e,t){return e.writeValue(t?1:0)},r.prototype.decode=function(e){return e.coerce(this.type,!e.readValue().isZero())},r}(Wu.Coder);Zr.BooleanCoder=Gu});var Di=E(pr=>{"use strict";d();h();var Xo=pr&&pr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(pr,"__esModule",{value:!0});pr.BytesCoder=pr.DynamicBytesCoder=void 0;var Qo=ee(),Hu=Te(),Yo=function(i){Xo(r,i);function r(e,t){return i.call(this,e,e,t,!0)||this}return r.prototype.defaultValue=function(){return"0x"},r.prototype.encode=function(e,t){t=(0,Qo.arrayify)(t);var n=e.writeValue(t.length);return n+=e.writeBytes(t),n},r.prototype.decode=function(e){return e.readBytes(e.readValue().toNumber(),!0)},r}(Hu.Coder);pr.DynamicBytesCoder=Yo;var Ju=function(i){Xo(r,i);function r(e){return i.call(this,"bytes",e)||this}return r.prototype.decode=function(e){return e.coerce(this.name,(0,Qo.hexlify)(i.prototype.decode.call(this,e)))},r}(Yo);pr.BytesCoder=Ju});var ra=E($r=>{"use strict";d();h();var Ku=$r&&$r.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty($r,"__esModule",{value:!0});$r.FixedBytesCoder=void 0;var ea=ee(),Vu=Te(),zu=function(i){Ku(r,i);function r(e,t){var n=this,o="bytes"+String(e);return n=i.call(this,o,o,t,!1)||this,n.size=e,n}return r.prototype.defaultValue=function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)},r.prototype.encode=function(e,t){var n=(0,ea.arrayify)(t);return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)},r.prototype.decode=function(e){return e.coerce(this.name,(0,ea.hexlify)(e.readBytes(this.size)))},r}(Vu.Coder);$r.FixedBytesCoder=zu});var ta=E(Xr=>{"use strict";d();h();var Zu=Xr&&Xr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Xr,"__esModule",{value:!0});Xr.NullCoder=void 0;var $u=Te(),Xu=function(i){Zu(r,i);function r(e){return i.call(this,"null","",e,!1)||this}return r.prototype.defaultValue=function(){return null},r.prototype.encode=function(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes([])},r.prototype.decode=function(e){return e.readBytes(0),e.coerce(this.name,null)},r}($u.Coder);Xr.NullCoder=Xu});var na=E(Qr=>{"use strict";d();h();var Qu=Qr&&Qr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Qr,"__esModule",{value:!0});Qr.NumberCoder=void 0;var Yu=Oe(),vn=Ti(),e0=Te(),r0=function(i){Qu(r,i);function r(e,t,n){var o=this,s=(t?"int":"uint")+e*8;return o=i.call(this,s,s,n,!1)||this,o.size=e,o.signed=t,o}return r.prototype.defaultValue=function(){return 0},r.prototype.encode=function(e,t){var n=Yu.BigNumber.from(t),o=vn.MaxUint256.mask(e.wordSize*8);if(this.signed){var s=o.mask(this.size*8-1);(n.gt(s)||n.lt(s.add(vn.One).mul(vn.NegativeOne)))&&this._throwError("value out-of-bounds",t)}else(n.lt(vn.Zero)||n.gt(o.mask(this.size*8)))&&this._throwError("value out-of-bounds",t);return n=n.toTwos(this.size*8).mask(this.size*8),this.signed&&(n=n.fromTwos(this.size*8).toTwos(8*e.wordSize)),e.writeValue(n)},r.prototype.decode=function(e){var t=e.readValue().mask(this.size*8);return this.signed&&(t=t.fromTwos(this.size*8)),e.coerce(this.name,t)},r}(e0.Coder);Qr.NumberCoder=r0});var oa=E(Yr=>{"use strict";d();h();var t0=Yr&&Yr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Yr,"__esModule",{value:!0});Yr.StringCoder=void 0;var ia=dr(),n0=Di(),i0=function(i){t0(r,i);function r(e){return i.call(this,"string",e)||this}return r.prototype.defaultValue=function(){return""},r.prototype.encode=function(e,t){return i.prototype.encode.call(this,e,(0,ia.toUtf8Bytes)(t))},r.prototype.decode=function(e){return(0,ia.toUtf8String)(i.prototype.decode.call(this,e))},r}(n0.DynamicBytesCoder);Yr.StringCoder=i0});var sa=E(et=>{"use strict";d();h();var o0=et&&et.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(et,"__esModule",{value:!0});et.TupleCoder=void 0;var a0=Te(),aa=qi(),s0=function(i){o0(r,i);function r(e,t){var n=this,o=!1,s=[];e.forEach(function(u){u.dynamic&&(o=!0),s.push(u.type)});var c="tuple("+s.join(",")+")";return n=i.call(this,"tuple",c,t,o)||this,n.coders=e,n}return r.prototype.defaultValue=function(){var e=[];this.coders.forEach(function(n){e.push(n.defaultValue())});var t=this.coders.reduce(function(n,o){var s=o.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach(function(n,o){var s=n.localName;!s||t[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[o]))}),Object.freeze(e)},r.prototype.encode=function(e,t){return(0,aa.pack)(e,this.coders,t)},r.prototype.decode=function(e){return e.coerce(this.name,(0,aa.unpack)(e,this.coders))},r}(a0.Coder);et.TupleCoder=s0});var Ui=E(rt=>{"use strict";d();h();Object.defineProperty(rt,"__esModule",{value:!0});rt.defaultAbiCoder=rt.AbiCoder=void 0;var c0=ee(),u0=re(),ua=U(),f0=Gr(),mn=new ua.Logger(f0.version),ca=Te(),l0=Ko(),d0=qi(),h0=$o(),x0=Di(),p0=ra(),b0=ta(),g0=na(),y0=oa(),_n=sa(),Mi=yn(),v0=new RegExp(/^bytes([0-9]*)$/),m0=new RegExp(/^(u?int)([0-9]*)$/),fa=function(){function i(r){(0,u0.defineReadOnly)(this,"coerceFunc",r||null)}return i.prototype._getCoder=function(r){var e=this;switch(r.baseType){case"address":return new l0.AddressCoder(r.name);case"bool":return new h0.BooleanCoder(r.name);case"string":return new y0.StringCoder(r.name);case"bytes":return new x0.BytesCoder(r.name);case"array":return new d0.ArrayCoder(this._getCoder(r.arrayChildren),r.arrayLength,r.name);case"tuple":return new _n.TupleCoder((r.components||[]).map(function(o){return e._getCoder(o)}),r.name);case"":return new b0.NullCoder(r.name)}var t=r.type.match(m0);if(t){var n=parseInt(t[2]||"256");return(n===0||n>256||n%8!==0)&&mn.throwArgumentError("invalid "+t[1]+" bit length","param",r),new g0.NumberCoder(n/8,t[1]==="int",r.name)}if(t=r.type.match(v0),t){var n=parseInt(t[1]);return(n===0||n>32)&&mn.throwArgumentError("invalid bytes length","param",r),new p0.FixedBytesCoder(n,r.name)}return mn.throwArgumentError("invalid type","type",r.type)},i.prototype._getWordSize=function(){return 32},i.prototype._getReader=function(r,e){return new ca.Reader(r,this._getWordSize(),this.coerceFunc,e)},i.prototype._getWriter=function(){return new ca.Writer(this._getWordSize())},i.prototype.getDefaultValue=function(r){var e=this,t=r.map(function(o){return e._getCoder(Mi.ParamType.from(o))}),n=new _n.TupleCoder(t,"_");return n.defaultValue()},i.prototype.encode=function(r,e){var t=this;r.length!==e.length&&mn.throwError("types/values length mismatch",ua.Logger.errors.INVALID_ARGUMENT,{count:{types:r.length,values:e.length},value:{types:r,values:e}});var n=r.map(function(c){return t._getCoder(Mi.ParamType.from(c))}),o=new _n.TupleCoder(n,"_"),s=this._getWriter();return o.encode(s,e),s.data},i.prototype.decode=function(r,e,t){var n=this,o=r.map(function(c){return n._getCoder(Mi.ParamType.from(c))}),s=new _n.TupleCoder(o,"_");return s.decode(this._getReader((0,c0.arrayify)(e),t))},i}();rt.AbiCoder=fa;rt.defaultAbiCoder=new fa});var ga=E(ve=>{"use strict";d();h();var Pn=ve&&ve.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(ve,"__esModule",{value:!0});ve.Interface=ve.Indexed=ve.ErrorDescription=ve.TransactionDescription=ve.LogDescription=ve.checkResultErrors=void 0;var _0=lr(),la=Oe(),te=ee(),wn=Ot(),da=St(),be=re(),w0=Ui(),E0=Te();Object.defineProperty(ve,"checkResultErrors",{enumerable:!0,get:function(){return E0.checkResultErrors}});var nr=yn(),En=U(),P0=Gr(),ne=new En.Logger(P0.version),xa=function(i){Pn(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r}(be.Description);ve.LogDescription=xa;var pa=function(i){Pn(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r}(be.Description);ve.TransactionDescription=pa;var ba=function(i){Pn(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r}(be.Description);ve.ErrorDescription=ba;var Wi=function(i){Pn(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.isIndexed=function(e){return!!(e&&e._isIndexed)},r}(be.Description);ve.Indexed=Wi;var k0={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function ha(i,r){var e=new Error("deferred error during ABI decoding triggered accessing "+i);return e.error=r,e}var S0=function(){function i(r){var e=this.constructor,t=this,n=[];typeof r=="string"?n=JSON.parse(r):n=r,(0,be.defineReadOnly)(this,"fragments",n.map(function(o){return nr.Fragment.from(o)}).filter(function(o){return o!=null})),(0,be.defineReadOnly)(this,"_abiCoder",(0,be.getStatic)(e,"getAbiCoder")()),(0,be.defineReadOnly)(this,"functions",{}),(0,be.defineReadOnly)(this,"errors",{}),(0,be.defineReadOnly)(this,"events",{}),(0,be.defineReadOnly)(this,"structs",{}),this.fragments.forEach(function(o){var s=null;switch(o.type){case"constructor":if(t.deploy){ne.warn("duplicate definition - constructor");return}(0,be.defineReadOnly)(t,"deploy",o);return;case"function":s=t.functions;break;case"event":s=t.events;break;case"error":s=t.errors;break;default:return}var c=o.format();if(s[c]){ne.warn("duplicate definition - "+c);return}s[c]=o}),this.deploy||(0,be.defineReadOnly)(this,"deploy",nr.ConstructorFragment.from({payable:!1,type:"constructor"})),(0,be.defineReadOnly)(this,"_isInterface",!0)}return i.prototype.format=function(r){r||(r=nr.FormatTypes.full),r===nr.FormatTypes.sighash&&ne.throwArgumentError("interface does not support formatting sighash","format",r);var e=this.fragments.map(function(t){return t.format(r)});return r===nr.FormatTypes.json?JSON.stringify(e.map(function(t){return JSON.parse(t)})):e},i.getAbiCoder=function(){return w0.defaultAbiCoder},i.getAddress=function(r){return(0,_0.getAddress)(r)},i.getSighash=function(r){return(0,te.hexDataSlice)((0,wn.id)(r.format()),0,4)},i.getEventTopic=function(r){return(0,wn.id)(r.format())},i.prototype.getFunction=function(r){if((0,te.isHexString)(r)){for(var e in this.functions)if(r===this.getSighash(e))return this.functions[e];ne.throwArgumentError("no matching function","sighash",r)}if(r.indexOf("(")===-1){var t=r.trim(),n=Object.keys(this.functions).filter(function(s){return s.split("(")[0]===t});return n.length===0?ne.throwArgumentError("no matching function","name",t):n.length>1&&ne.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}var o=this.functions[nr.FunctionFragment.fromString(r).format()];return o||ne.throwArgumentError("no matching function","signature",r),o},i.prototype.getEvent=function(r){if((0,te.isHexString)(r)){var e=r.toLowerCase();for(var t in this.events)if(e===this.getEventTopic(t))return this.events[t];ne.throwArgumentError("no matching event","topichash",e)}if(r.indexOf("(")===-1){var n=r.trim(),o=Object.keys(this.events).filter(function(c){return c.split("(")[0]===n});return o.length===0?ne.throwArgumentError("no matching event","name",n):o.length>1&&ne.throwArgumentError("multiple matching events","name",n),this.events[o[0]]}var s=this.events[nr.EventFragment.fromString(r).format()];return s||ne.throwArgumentError("no matching event","signature",r),s},i.prototype.getError=function(r){if((0,te.isHexString)(r)){var e=(0,be.getStatic)(this.constructor,"getSighash");for(var t in this.errors){var n=this.errors[t];if(r===e(n))return this.errors[t]}ne.throwArgumentError("no matching error","sighash",r)}if(r.indexOf("(")===-1){var o=r.trim(),s=Object.keys(this.errors).filter(function(u){return u.split("(")[0]===o});return s.length===0?ne.throwArgumentError("no matching error","name",o):s.length>1&&ne.throwArgumentError("multiple matching errors","name",o),this.errors[s[0]]}var c=this.errors[nr.FunctionFragment.fromString(r).format()];return c||ne.throwArgumentError("no matching error","signature",r),c},i.prototype.getSighash=function(r){if(typeof r=="string")try{r=this.getFunction(r)}catch(e){try{r=this.getError(r)}catch{throw e}}return(0,be.getStatic)(this.constructor,"getSighash")(r)},i.prototype.getEventTopic=function(r){return typeof r=="string"&&(r=this.getEvent(r)),(0,be.getStatic)(this.constructor,"getEventTopic")(r)},i.prototype._decodeParams=function(r,e){return this._abiCoder.decode(r,e)},i.prototype._encodeParams=function(r,e){return this._abiCoder.encode(r,e)},i.prototype.encodeDeploy=function(r){return this._encodeParams(this.deploy.inputs,r||[])},i.prototype.decodeErrorResult=function(r,e){typeof r=="string"&&(r=this.getError(r));var t=(0,te.arrayify)(e);return(0,te.hexlify)(t.slice(0,4))!==this.getSighash(r)&&ne.throwArgumentError("data signature does not match error "+r.name+".","data",(0,te.hexlify)(t)),this._decodeParams(r.inputs,t.slice(4))},i.prototype.encodeErrorResult=function(r,e){return typeof r=="string"&&(r=this.getError(r)),(0,te.hexlify)((0,te.concat)([this.getSighash(r),this._encodeParams(r.inputs,e||[])]))},i.prototype.decodeFunctionData=function(r,e){typeof r=="string"&&(r=this.getFunction(r));var t=(0,te.arrayify)(e);return(0,te.hexlify)(t.slice(0,4))!==this.getSighash(r)&&ne.throwArgumentError("data signature does not match function "+r.name+".","data",(0,te.hexlify)(t)),this._decodeParams(r.inputs,t.slice(4))},i.prototype.encodeFunctionData=function(r,e){return typeof r=="string"&&(r=this.getFunction(r)),(0,te.hexlify)((0,te.concat)([this.getSighash(r),this._encodeParams(r.inputs,e||[])]))},i.prototype.decodeFunctionResult=function(r,e){typeof r=="string"&&(r=this.getFunction(r));var t=(0,te.arrayify)(e),n=null,o="",s=null,c=null,u=null;switch(t.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(r.outputs,t)}catch{}break;case 4:{var a=(0,te.hexlify)(t.slice(0,4)),f=k0[a];if(f)s=this._abiCoder.decode(f.inputs,t.slice(4)),c=f.name,u=f.signature,f.reason&&(n=s[0]),c==="Error"?o="; VM Exception while processing transaction: reverted with reason string "+JSON.stringify(s[0]):c==="Panic"&&(o="; VM Exception while processing transaction: reverted with panic code "+s[0]);else try{var l=this.getError(a);s=this._abiCoder.decode(l.inputs,t.slice(4)),c=l.name,u=l.format()}catch{}break}}return ne.throwError("call revert exception"+o,En.Logger.errors.CALL_EXCEPTION,{method:r.format(),data:(0,te.hexlify)(e),errorArgs:s,errorName:c,errorSignature:u,reason:n})},i.prototype.encodeFunctionResult=function(r,e){return typeof r=="string"&&(r=this.getFunction(r)),(0,te.hexlify)(this._abiCoder.encode(r.outputs,e||[]))},i.prototype.encodeFilterTopics=function(r,e){var t=this;typeof r=="string"&&(r=this.getEvent(r)),e.length>r.inputs.length&&ne.throwError("too many arguments for "+r.format(),En.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});var n=[];r.anonymous||n.push(this.getEventTopic(r));var o=function(s,c){return s.type==="string"?(0,wn.id)(c):s.type==="bytes"?(0,da.keccak256)((0,te.hexlify)(c)):(s.type==="bool"&&typeof c=="boolean"&&(c=c?"0x01":"0x00"),s.type.match(/^u?int/)&&(c=la.BigNumber.from(c).toHexString()),s.type==="address"&&t._abiCoder.encode(["address"],[c]),(0,te.hexZeroPad)((0,te.hexlify)(c),32))};for(e.forEach(function(s,c){var u=r.inputs[c];if(!u.indexed){s!=null&&ne.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+u.name,s);return}s==null?n.push(null):u.baseType==="array"||u.baseType==="tuple"?ne.throwArgumentError("filtering with tuples or arrays not supported","contract."+u.name,s):Array.isArray(s)?n.push(s.map(function(a){return o(u,a)})):n.push(o(u,s))});n.length&&n[n.length-1]===null;)n.pop();return n},i.prototype.encodeEventLog=function(r,e){var t=this;typeof r=="string"&&(r=this.getEvent(r));var n=[],o=[],s=[];return r.anonymous||n.push(this.getEventTopic(r)),e.length!==r.inputs.length&&ne.throwArgumentError("event arguments/values mismatch","values",e),r.inputs.forEach(function(c,u){var a=e[u];if(c.indexed)if(c.type==="string")n.push((0,wn.id)(a));else if(c.type==="bytes")n.push((0,da.keccak256)(a));else{if(c.baseType==="tuple"||c.baseType==="array")throw new Error("not implemented");n.push(t._abiCoder.encode([c.type],[a]))}else o.push(c),s.push(a)}),{data:this._abiCoder.encode(o,s),topics:n}},i.prototype.decodeEventLog=function(r,e,t){if(typeof r=="string"&&(r=this.getEvent(r)),t!=null&&!r.anonymous){var n=this.getEventTopic(r);(!(0,te.isHexString)(t[0],32)||t[0].toLowerCase()!==n)&&ne.throwError("fragment/topic mismatch",En.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:t[0]}),t=t.slice(1)}var o=[],s=[],c=[];r.inputs.forEach(function(m,_){m.indexed?m.type==="string"||m.type==="bytes"||m.baseType==="tuple"||m.baseType==="array"?(o.push(nr.ParamType.fromObject({type:"bytes32",name:m.name})),c.push(!0)):(o.push(m),c.push(!1)):(s.push(m),c.push(!1))});var u=t!=null?this._abiCoder.decode(o,(0,te.concat)(t)):null,a=this._abiCoder.decode(s,e,!0),f=[],l=0,p=0;r.inputs.forEach(function(m,_){if(m.indexed)if(u==null)f[_]=new Wi({_isIndexed:!0,hash:null});else if(c[_])f[_]=new Wi({_isIndexed:!0,hash:u[p++]});else try{f[_]=u[p++]}catch(L){f[_]=L}else try{f[_]=a[l++]}catch(L){f[_]=L}if(m.name&&f[m.name]==null){var T=f[_];T instanceof Error?Object.defineProperty(f,m.name,{enumerable:!0,get:function(){throw ha("property "+JSON.stringify(m.name),T)}}):f[m.name]=T}});for(var y=function(m){var _=f[m];_ instanceof Error&&Object.defineProperty(f,m,{enumerable:!0,get:function(){throw ha("index "+m,_)}})},S=0;S<f.length;S++)y(S);return Object.freeze(f)},i.prototype.parseTransaction=function(r){var e=this.getFunction(r.data.substring(0,10).toLowerCase());return e?new pa({args:this._abiCoder.decode(e.inputs,"0x"+r.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:la.BigNumber.from(r.value||"0")}):null},i.prototype.parseLog=function(r){var e=this.getEvent(r.topics[0]);return!e||e.anonymous?null:new xa({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,r.data,r.topics)})},i.prototype.parseError=function(r){var e=(0,te.hexlify)(r),t=this.getError(e.substring(0,10).toLowerCase());return t?new ba({args:this._abiCoder.decode(t.inputs,"0x"+e.substring(10)),errorFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t)}):null},i.isInterface=function(r){return!!(r&&r._isInterface)},i}();ve.Interface=S0});var va=E(K=>{"use strict";d();h();Object.defineProperty(K,"__esModule",{value:!0});K.TransactionDescription=K.LogDescription=K.checkResultErrors=K.Indexed=K.Interface=K.defaultAbiCoder=K.AbiCoder=K.FormatTypes=K.ParamType=K.FunctionFragment=K.Fragment=K.EventFragment=K.ErrorFragment=K.ConstructorFragment=void 0;var Fr=yn();Object.defineProperty(K,"ConstructorFragment",{enumerable:!0,get:function(){return Fr.ConstructorFragment}});Object.defineProperty(K,"ErrorFragment",{enumerable:!0,get:function(){return Fr.ErrorFragment}});Object.defineProperty(K,"EventFragment",{enumerable:!0,get:function(){return Fr.EventFragment}});Object.defineProperty(K,"FormatTypes",{enumerable:!0,get:function(){return Fr.FormatTypes}});Object.defineProperty(K,"Fragment",{enumerable:!0,get:function(){return Fr.Fragment}});Object.defineProperty(K,"FunctionFragment",{enumerable:!0,get:function(){return Fr.FunctionFragment}});Object.defineProperty(K,"ParamType",{enumerable:!0,get:function(){return Fr.ParamType}});var ya=Ui();Object.defineProperty(K,"AbiCoder",{enumerable:!0,get:function(){return ya.AbiCoder}});Object.defineProperty(K,"defaultAbiCoder",{enumerable:!0,get:function(){return ya.defaultAbiCoder}});var Nt=ga();Object.defineProperty(K,"checkResultErrors",{enumerable:!0,get:function(){return Nt.checkResultErrors}});Object.defineProperty(K,"Indexed",{enumerable:!0,get:function(){return Nt.Indexed}});Object.defineProperty(K,"Interface",{enumerable:!0,get:function(){return Nt.Interface}});Object.defineProperty(K,"LogDescription",{enumerable:!0,get:function(){return Nt.LogDescription}});Object.defineProperty(K,"TransactionDescription",{enumerable:!0,get:function(){return Nt.TransactionDescription}})});var ma=E(kn=>{"use strict";d();h();Object.defineProperty(kn,"__esModule",{value:!0});kn.version=void 0;kn.version="abstract-provider/5.7.0"});var tt=E(le=>{"use strict";d();h();var On=le&&le.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),O0=le&&le.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},R0=le&&le.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(le,"__esModule",{value:!0});le.Provider=le.TransactionOrderForkEvent=le.TransactionForkEvent=le.BlockForkEvent=le.ForkEvent=void 0;var A0=Oe(),Sn=ee(),Gi=re(),T0=U(),C0=ma(),Lt=new T0.Logger(C0.version),Rn=function(i){On(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.isForkEvent=function(e){return!!(e&&e._isForkEvent)},r}(Gi.Description);le.ForkEvent=Rn;var N0=function(i){On(r,i);function r(e,t){var n=this;return(0,Sn.isHexString)(e,32)||Lt.throwArgumentError("invalid blockHash","blockHash",e),n=i.call(this,{_isForkEvent:!0,_isBlockForkEvent:!0,expiry:t||0,blockHash:e})||this,n}return r}(Rn);le.BlockForkEvent=N0;var L0=function(i){On(r,i);function r(e,t){var n=this;return(0,Sn.isHexString)(e,32)||Lt.throwArgumentError("invalid transaction hash","hash",e),n=i.call(this,{_isForkEvent:!0,_isTransactionForkEvent:!0,expiry:t||0,hash:e})||this,n}return r}(Rn);le.TransactionForkEvent=L0;var B0=function(i){On(r,i);function r(e,t,n){var o=this;return(0,Sn.isHexString)(e,32)||Lt.throwArgumentError("invalid transaction hash","beforeHash",e),(0,Sn.isHexString)(t,32)||Lt.throwArgumentError("invalid transaction hash","afterHash",t),o=i.call(this,{_isForkEvent:!0,_isTransactionOrderForkEvent:!0,expiry:n||0,beforeHash:e,afterHash:t})||this,o}return r}(Rn);le.TransactionOrderForkEvent=B0;var I0=function(){function i(){var r=this.constructor;Lt.checkAbstract(r,i),(0,Gi.defineReadOnly)(this,"_isProvider",!0)}return i.prototype.getFeeData=function(){return O0(this,void 0,void 0,function(){var r,e,t,n,o,s;return R0(this,function(c){switch(c.label){case 0:return[4,(0,Gi.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(function(u){return null})})];case 1:return r=c.sent(),e=r.block,t=r.gasPrice,n=null,o=null,s=null,e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=A0.BigNumber.from("1500000000"),o=e.baseFeePerGas.mul(2).add(s)),[2,{lastBaseFeePerGas:n,maxFeePerGas:o,maxPriorityFeePerGas:s,gasPrice:t}]}})})},i.prototype.addListener=function(r,e){return this.on(r,e)},i.prototype.removeListener=function(r,e){return this.off(r,e)},i.isProvider=function(r){return!!(r&&r._isProvider)},i}();le.Provider=I0});var _a=E(An=>{"use strict";d();h();Object.defineProperty(An,"__esModule",{value:!0});An.version=void 0;An.version="contracts/5.7.0"});var K0=E(me=>{"use strict";d();h();var Nn=me&&me.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),gr=me&&me.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},yr=me&&me.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},F0=me&&me.__spreadArray||function(i,r,e){if(e||arguments.length===2)for(var t=0,n=r.length,o;t<n;t++)(o||!(t in r))&&(o||(o=Array.prototype.slice.call(r,0,t)),o[t]=r[t]);return i.concat(o||Array.prototype.slice.call(r))};Object.defineProperty(me,"__esModule",{value:!0});me.ContractFactory=me.Contract=me.BaseContract=void 0;var Tn=va(),j0=tt(),Hi=fn(),It=lr(),br=Oe(),jr=ee(),O=re(),q0=Lr(),ge=U(),D0=_a(),z=new ge.Logger(D0.version),M0={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 Cn(i,r){return gr(this,void 0,void 0,function(){var e,t;return yr(this,function(n){switch(n.label){case 0:return[4,r];case 1:e=n.sent(),typeof e!="string"&&z.throwArgumentError("invalid address or ENS name","name",e);try{return[2,(0,It.getAddress)(e)]}catch{}return i||z.throwError("a provider or signer is needed to resolve ENS names",ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),[4,i.resolveName(e)];case 2:return t=n.sent(),t==null&&z.throwArgumentError("resolver or addr is not configured for ENS name","name",e),[2,t]}})})}function Bt(i,r,e){return gr(this,void 0,void 0,function(){return yr(this,function(t){switch(t.label){case 0:return Array.isArray(e)?[4,Promise.all(e.map(function(n,o){return Bt(i,Array.isArray(r)?r[o]:r[n.name],n)}))]:[3,2];case 1:return[2,t.sent()];case 2:return e.type!=="address"?[3,4]:[4,Cn(i,r)];case 3:return[2,t.sent()];case 4:return e.type!=="tuple"?[3,6]:[4,Bt(i,r,e.components)];case 5:return[2,t.sent()];case 6:return e.baseType!=="array"?[3,8]:Array.isArray(r)?[4,Promise.all(r.map(function(n){return Bt(i,n,e.arrayChildren)}))]:[2,Promise.reject(z.makeError("invalid value for array",ge.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:r}))];case 7:return[2,t.sent()];case 8:return[2,r]}})})}function Ln(i,r,e){return gr(this,void 0,void 0,function(){var t,n,o,s,c,u,a,f,l,p,y=this;return yr(this,function(S){switch(S.label){case 0:return t={},e.length===r.inputs.length+1&&typeof e[e.length-1]=="object"&&(t=(0,O.shallowCopy)(e.pop())),z.checkArgumentCount(e.length,r.inputs.length,"passed to contract"),i.signer?t.from?t.from=(0,O.resolveProperties)({override:Cn(i.signer,t.from),signer:i.signer.getAddress()}).then(function(m){return gr(y,void 0,void 0,function(){return yr(this,function(_){return(0,It.getAddress)(m.signer)!==m.override&&z.throwError("Contract with a Signer cannot override from",ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),[2,m.override]})})}):t.from=i.signer.getAddress():t.from&&(t.from=Cn(i.provider,t.from)),[4,(0,O.resolveProperties)({args:Bt(i.signer||i.provider,e,r.inputs),address:i.resolvedAddress,overrides:(0,O.resolveProperties)(t)||{}})];case 1:if(n=S.sent(),o=i.interface.encodeFunctionData(r,n.args),s={data:o,to:n.address},c=n.overrides,c.nonce!=null&&(s.nonce=br.BigNumber.from(c.nonce).toNumber()),c.gasLimit!=null&&(s.gasLimit=br.BigNumber.from(c.gasLimit)),c.gasPrice!=null&&(s.gasPrice=br.BigNumber.from(c.gasPrice)),c.maxFeePerGas!=null&&(s.maxFeePerGas=br.BigNumber.from(c.maxFeePerGas)),c.maxPriorityFeePerGas!=null&&(s.maxPriorityFeePerGas=br.BigNumber.from(c.maxPriorityFeePerGas)),c.from!=null&&(s.from=c.from),c.type!=null&&(s.type=c.type),c.accessList!=null&&(s.accessList=(0,q0.accessListify)(c.accessList)),s.gasLimit==null&&r.gas!=null){for(u=21e3,a=(0,jr.arrayify)(o),f=0;f<a.length;f++)u+=4,a[f]&&(u+=64);s.gasLimit=br.BigNumber.from(r.gas).add(u)}return c.value&&(l=br.BigNumber.from(c.value),!l.isZero()&&!r.payable&&z.throwError("non-payable method cannot override value",ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value}),s.value=l),c.customData&&(s.customData=(0,O.shallowCopy)(c.customData)),c.ccipReadEnabled&&(s.ccipReadEnabled=!!c.ccipReadEnabled),delete t.nonce,delete t.gasLimit,delete t.gasPrice,delete t.from,delete t.value,delete t.type,delete t.accessList,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.customData,delete t.ccipReadEnabled,p=Object.keys(t).filter(function(m){return t[m]!=null}),p.length&&z.throwError("cannot override "+p.map(function(m){return JSON.stringify(m)}).join(","),ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:p}),[2,s]}})})}function U0(i,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ln(i,r,e)}}function W0(i,r){var e=i.signer||i.provider;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return gr(this,void 0,void 0,function(){var o;return yr(this,function(s){switch(s.label){case 0:return e||z.throwError("estimate require a provider or signer",ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),[4,Ln(i,r,t)];case 1:return o=s.sent(),[4,e.estimateGas(o)];case 2:return[2,s.sent()]}})})}}function ka(i,r){var e=r.wait.bind(r);r.wait=function(t){return e(t).then(function(n){return n.events=n.logs.map(function(o){var s=(0,O.deepCopy)(o),c=null;try{c=i.interface.parseLog(o)}catch{}return c&&(s.args=c.args,s.decode=function(u,a){return i.interface.decodeEventLog(c.eventFragment,u,a)},s.event=c.name,s.eventSignature=c.signature),s.removeListener=function(){return i.provider},s.getBlock=function(){return i.provider.getBlock(n.blockHash)},s.getTransaction=function(){return i.provider.getTransaction(n.transactionHash)},s.getTransactionReceipt=function(){return Promise.resolve(n)},s}),n})}}function Sa(i,r,e){var t=i.signer||i.provider;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return gr(this,void 0,void 0,function(){var s,c,u,a,f;return yr(this,function(l){switch(l.label){case 0:return s=void 0,n.length===r.inputs.length+1&&typeof n[n.length-1]=="object"?(c=(0,O.shallowCopy)(n.pop()),c.blockTag==null?[3,2]:[4,c.blockTag]):[3,3];case 1:s=l.sent(),l.label=2;case 2:delete c.blockTag,n.push(c),l.label=3;case 3:return i.deployTransaction==null?[3,5]:[4,i._deployed(s)];case 4:l.sent(),l.label=5;case 5:return[4,Ln(i,r,n)];case 6:return u=l.sent(),[4,t.call(u,s)];case 7:a=l.sent();try{return f=i.interface.decodeFunctionResult(r,a),e&&r.outputs.length===1&&(f=f[0]),[2,f]}catch(p){throw p.code===ge.Logger.errors.CALL_EXCEPTION&&(p.address=i.address,p.args=n,p.transaction=u),p}return[2]}})})}}function G0(i,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return gr(this,void 0,void 0,function(){var n,o;return yr(this,function(s){switch(s.label){case 0:return i.signer||z.throwError("sending a transaction requires a signer",ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),i.deployTransaction==null?[3,2]:[4,i._deployed()];case 1:s.sent(),s.label=2;case 2:return[4,Ln(i,r,e)];case 3:return n=s.sent(),[4,i.signer.sendTransaction(n)];case 4:return o=s.sent(),ka(i,o),[2,o]}})})}}function wa(i,r,e){return r.constant?Sa(i,r,e):G0(i,r)}function Oa(i){return i.address&&(i.topics==null||i.topics.length===0)?"*":(i.address||"*")+"@"+(i.topics?i.topics.map(function(r){return Array.isArray(r)?r.join("|"):r}).join(":"):"")}var Ft=function(){function i(r,e){(0,O.defineReadOnly)(this,"tag",r),(0,O.defineReadOnly)(this,"filter",e),this._listeners=[]}return i.prototype.addListener=function(r,e){this._listeners.push({listener:r,once:e})},i.prototype.removeListener=function(r){var e=!1;this._listeners=this._listeners.filter(function(t){return e||t.listener!==r?!0:(e=!0,!1)})},i.prototype.removeAllListeners=function(){this._listeners=[]},i.prototype.listeners=function(){return this._listeners.map(function(r){return r.listener})},i.prototype.listenerCount=function(){return this._listeners.length},i.prototype.run=function(r){var e=this,t=this.listenerCount();return this._listeners=this._listeners.filter(function(n){var o=r.slice();return setTimeout(function(){n.listener.apply(e,o)},0),!n.once}),t},i.prototype.prepareEvent=function(r){},i.prototype.getEmit=function(r){return[r]},i}(),H0=function(i){Nn(r,i);function r(){return i.call(this,"error",null)||this}return r}(Ft),Ea=function(i){Nn(r,i);function r(e,t,n,o){var s=this,c={address:e},u=t.getEventTopic(n);return o?(u!==o[0]&&z.throwArgumentError("topic mismatch","topics",o),c.topics=o.slice()):c.topics=[u],s=i.call(this,Oa(c),c)||this,(0,O.defineReadOnly)(s,"address",e),(0,O.defineReadOnly)(s,"interface",t),(0,O.defineReadOnly)(s,"fragment",n),s}return r.prototype.prepareEvent=function(e){var t=this;i.prototype.prepareEvent.call(this,e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=function(n,o){return t.interface.decodeEventLog(t.fragment,n,o)};try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(n){e.args=null,e.decodeError=n}},r.prototype.getEmit=function(e){var t=(0,Tn.checkResultErrors)(e.args);if(t.length)throw t[0].error;var n=(e.args||[]).slice();return n.push(e),n},r}(Ft),Pa=function(i){Nn(r,i);function r(e,t){var n=i.call(this,"*",{address:e})||this;return(0,O.defineReadOnly)(n,"address",e),(0,O.defineReadOnly)(n,"interface",t),n}return r.prototype.prepareEvent=function(e){var t=this;i.prototype.prepareEvent.call(this,e);try{var n=this.interface.parseLog(e);e.event=n.name,e.eventSignature=n.signature,e.decode=function(o,s){return t.interface.decodeEventLog(n.eventFragment,o,s)},e.args=n.args}catch{}},r}(Ft),Ra=function(){function i(r,e,t){var n=this.constructor,o=this;(0,O.defineReadOnly)(this,"interface",(0,O.getStatic)(n,"getInterface")(e)),t==null?((0,O.defineReadOnly)(this,"provider",null),(0,O.defineReadOnly)(this,"signer",null)):Hi.Signer.isSigner(t)?((0,O.defineReadOnly)(this,"provider",t.provider||null),(0,O.defineReadOnly)(this,"signer",t)):j0.Provider.isProvider(t)?((0,O.defineReadOnly)(this,"provider",t),(0,O.defineReadOnly)(this,"signer",null)):z.throwArgumentError("invalid signer or provider","signerOrProvider",t),(0,O.defineReadOnly)(this,"callStatic",{}),(0,O.defineReadOnly)(this,"estimateGas",{}),(0,O.defineReadOnly)(this,"functions",{}),(0,O.defineReadOnly)(this,"populateTransaction",{}),(0,O.defineReadOnly)(this,"filters",{});{var s={};Object.keys(this.interface.events).forEach(function(a){var f=o.interface.events[a];(0,O.defineReadOnly)(o.filters,a,function(){for(var l=[],p=0;p<arguments.length;p++)l[p]=arguments[p];return{address:o.address,topics:o.interface.encodeFilterTopics(f,l)}}),s[f.name]||(s[f.name]=[]),s[f.name].push(a)}),Object.keys(s).forEach(function(a){var f=s[a];f.length===1?(0,O.defineReadOnly)(o.filters,a,o.filters[f[0]]):z.warn("Duplicate definition of "+a+" ("+f.join(", ")+")")})}if((0,O.defineReadOnly)(this,"_runningEvents",{}),(0,O.defineReadOnly)(this,"_wrappedEmits",{}),r==null&&z.throwArgumentError("invalid contract address or ENS name","addressOrName",r),(0,O.defineReadOnly)(this,"address",r),this.provider)(0,O.defineReadOnly)(this,"resolvedAddress",Cn(this.provider,r));else try{(0,O.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,It.getAddress)(r)))}catch{z.throwError("provider is required to use ENS name as contract address",ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(function(a){});var c={},u={};Object.keys(this.interface.functions).forEach(function(a){var f=o.interface.functions[a];if(u[a]){z.warn("Duplicate ABI entry for "+JSON.stringify(a));return}u[a]=!0;{var l=f.name;c["%"+l]||(c["%"+l]=[]),c["%"+l].push(a)}o[a]==null&&(0,O.defineReadOnly)(o,a,wa(o,f,!0)),o.functions[a]==null&&(0,O.defineReadOnly)(o.functions,a,wa(o,f,!1)),o.callStatic[a]==null&&(0,O.defineReadOnly)(o.callStatic,a,Sa(o,f,!0)),o.populateTransaction[a]==null&&(0,O.defineReadOnly)(o.populateTransaction,a,U0(o,f)),o.estimateGas[a]==null&&(0,O.defineReadOnly)(o.estimateGas,a,W0(o,f))}),Object.keys(c).forEach(function(a){var f=c[a];if(!(f.length>1)){a=a.substring(1);var l=f[0];try{o[a]==null&&(0,O.defineReadOnly)(o,a,o[l])}catch{}o.functions[a]==null&&(0,O.defineReadOnly)(o.functions,a,o.functions[l]),o.callStatic[a]==null&&(0,O.defineReadOnly)(o.callStatic,a,o.callStatic[l]),o.populateTransaction[a]==null&&(0,O.defineReadOnly)(o.populateTransaction,a,o.populateTransaction[l]),o.estimateGas[a]==null&&(0,O.defineReadOnly)(o.estimateGas,a,o.estimateGas[l])}})}return i.getContractAddress=function(r){return(0,It.getContractAddress)(r)},i.getInterface=function(r){return Tn.Interface.isInterface(r)?r:new Tn.Interface(r)},i.prototype.deployed=function(){return this._deployed()},i.prototype._deployed=function(r){var e=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(function(){return e}):this._deployedPromise=this.provider.getCode(this.address,r).then(function(t){return t==="0x"&&z.throwError("contract not deployed",ge.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:e.address,operation:"getDeployed"}),e})),this._deployedPromise},i.prototype.fallback=function(r){var e=this;this.signer||z.throwError("sending a transactions require a signer",ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var t=(0,O.shallowCopy)(r||{});return["from","to"].forEach(function(n){t[n]!=null&&z.throwError("cannot override "+n,ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:n})}),t.to=this.resolvedAddress,this.deployed().then(function(){return e.signer.sendTransaction(t)})},i.prototype.connect=function(r){typeof r=="string"&&(r=new Hi.VoidSigner(r,this.provider));var e=new this.constructor(this.address,this.interface,r);return this.deployTransaction&&(0,O.defineReadOnly)(e,"deployTransaction",this.deployTransaction),e},i.prototype.attach=function(r){return new this.constructor(r,this.interface,this.signer||this.provider)},i.isIndexed=function(r){return Tn.Indexed.isIndexed(r)},i.prototype._normalizeRunningEvent=function(r){return this._runningEvents[r.tag]?this._runningEvents[r.tag]:r},i.prototype._getRunningEvent=function(r){if(typeof r=="string"){if(r==="error")return this._normalizeRunningEvent(new H0);if(r==="event")return this._normalizeRunningEvent(new Ft("event",null));if(r==="*")return this._normalizeRunningEvent(new Pa(this.address,this.interface));var e=this.interface.getEvent(r);return this._normalizeRunningEvent(new Ea(this.address,this.interface,e))}if(r.topics&&r.topics.length>0){try{var t=r.topics[0];if(typeof t!="string")throw new Error("invalid topic");var e=this.interface.getEvent(t);return this._normalizeRunningEvent(new Ea(this.address,this.interface,e,r.topics))}catch{}var n={address:this.address,topics:r.topics};return this._normalizeRunningEvent(new Ft(Oa(n),n))}return this._normalizeRunningEvent(new Pa(this.address,this.interface))},i.prototype._checkRunningEvents=function(r){if(r.listenerCount()===0){delete this._runningEvents[r.tag];var e=this._wrappedEmits[r.tag];e&&r.filter&&(this.provider.off(r.filter,e),delete this._wrappedEmits[r.tag])}},i.prototype._wrapEvent=function(r,e,t){var n=this,o=(0,O.deepCopy)(e);return o.removeListener=function(){!t||(r.removeListener(t),n._checkRunningEvents(r))},o.getBlock=function(){return n.provider.getBlock(e.blockHash)},o.getTransaction=function(){return n.provider.getTransaction(e.transactionHash)},o.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(e.transactionHash)},r.prepareEvent(o),o},i.prototype._addEventListener=function(r,e,t){var n=this;if(this.provider||z.throwError("events require a provider or a signer with a provider",ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),r.addListener(e,t),this._runningEvents[r.tag]=r,!this._wrappedEmits[r.tag]){var o=function(s){var c=n._wrapEvent(r,s,e);if(c.decodeError==null)try{var u=r.getEmit(c);n.emit.apply(n,F0([r.filter],u,!1))}catch(a){c.decodeError=a.error}r.filter!=null&&n.emit("event",c),c.decodeError!=null&&n.emit("error",c.decodeError,c)};this._wrappedEmits[r.tag]=o,r.filter!=null&&this.provider.on(r.filter,o)}},i.prototype.queryFilter=function(r,e,t){var n=this,o=this._getRunningEvent(r),s=(0,O.shallowCopy)(o.filter);return typeof e=="string"&&(0,jr.isHexString)(e,32)?(t!=null&&z.throwArgumentError("cannot specify toBlock with blockhash","toBlock",t),s.blockHash=e):(s.fromBlock=e??0,s.toBlock=t??"latest"),this.provider.getLogs(s).then(function(c){return c.map(function(u){return n._wrapEvent(o,u,null)})})},i.prototype.on=function(r,e){return this._addEventListener(this._getRunningEvent(r),e,!1),this},i.prototype.once=function(r,e){return this._addEventListener(this._getRunningEvent(r),e,!0),this},i.prototype.emit=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!this.provider)return!1;var n=this._getRunningEvent(r),o=n.run(e)>0;return this._checkRunningEvents(n),o},i.prototype.listenerCount=function(r){var e=this;return this.provider?r==null?Object.keys(this._runningEvents).reduce(function(t,n){return t+e._runningEvents[n].listenerCount()},0):this._getRunningEvent(r).listenerCount():0},i.prototype.listeners=function(r){if(!this.provider)return[];if(r==null){var e=[];for(var t in this._runningEvents)this._runningEvents[t].listeners().forEach(function(n){e.push(n)});return e}return this._getRunningEvent(r).listeners()},i.prototype.removeAllListeners=function(r){if(!this.provider)return this;if(r==null){for(var e in this._runningEvents){var t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}var n=this._getRunningEvent(r);return n.removeAllListeners(),this._checkRunningEvents(n),this},i.prototype.off=function(r,e){if(!this.provider)return this;var t=this._getRunningEvent(r);return t.removeListener(e),this._checkRunningEvents(t),this},i.prototype.removeListener=function(r,e){return this.off(r,e)},i}();me.BaseContract=Ra;var Ji=function(i){Nn(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r}(Ra);me.Contract=Ji;var J0=function(){function i(r,e,t){var n=this.constructor,o=null;typeof e=="string"?o=e:(0,jr.isBytes)(e)?o=(0,jr.hexlify)(e):e&&typeof e.object=="string"?o=e.object:o="!",o.substring(0,2)!=="0x"&&(o="0x"+o),(!(0,jr.isHexString)(o)||o.length%2)&&z.throwArgumentError("invalid bytecode","bytecode",e),t&&!Hi.Signer.isSigner(t)&&z.throwArgumentError("invalid signer","signer",t),(0,O.defineReadOnly)(this,"bytecode",o),(0,O.defineReadOnly)(this,"interface",(0,O.getStatic)(n,"getInterface")(r)),(0,O.defineReadOnly)(this,"signer",t||null)}return i.prototype.getDeployTransaction=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t={};if(r.length===this.interface.deploy.inputs.length+1&&typeof r[r.length-1]=="object"){t=(0,O.shallowCopy)(r.pop());for(var n in t)if(!M0[n])throw new Error("unknown transaction override "+n)}if(["data","from","to"].forEach(function(s){t[s]!=null&&z.throwError("cannot override "+s,ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:s})}),t.value){var o=br.BigNumber.from(t.value);!o.isZero()&&!this.interface.deploy.payable&&z.throwError("non-payable constructor cannot override value",ge.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return z.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=(0,jr.hexlify)((0,jr.concat)([this.bytecode,this.interface.encodeDeploy(r)])),t},i.prototype.deploy=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return gr(this,void 0,void 0,function(){var t,n,o,s,c,u;return yr(this,function(a){switch(a.label){case 0:return t={},r.length===this.interface.deploy.inputs.length+1&&(t=r.pop()),z.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),[4,Bt(this.signer,r,this.interface.deploy.inputs)];case 1:return n=a.sent(),n.push(t),o=this.getDeployTransaction.apply(this,n),[4,this.signer.sendTransaction(o)];case 2:return s=a.sent(),c=(0,O.getStatic)(this.constructor,"getContractAddress")(s),u=(0,O.getStatic)(this.constructor,"getContract")(c,this.interface,this.signer),ka(u,s),(0,O.defineReadOnly)(u,"deployTransaction",s),[2,u]}})})},i.prototype.attach=function(r){return this.constructor.getContract(r,this.interface,this.signer)},i.prototype.connect=function(r){return new this.constructor(this.interface,this.bytecode,r)},i.fromSolidity=function(r,e){r==null&&z.throwError("missing compiler output",ge.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),typeof r=="string"&&(r=JSON.parse(r));var t=r.abi,n=null;return r.bytecode?n=r.bytecode:r.evm&&r.evm.bytecode&&(n=r.evm.bytecode),new this(t,n,e)},i.getInterface=function(r){return Ji.getInterface(r)},i.getContractAddress=function(r){return(0,It.getContractAddress)(r)},i.getContract=function(r,e,t){return new Ji(r,e,t)},i}();me.ContractFactory=J0});var Aa=E(Bn=>{"use strict";d();h();Object.defineProperty(Bn,"__esModule",{value:!0});Bn.version=void 0;Bn.version="wordlists/5.7.0"});var Ki=E(qr=>{"use strict";d();h();Object.defineProperty(qr,"__esModule",{value:!0});qr.Wordlist=qr.logger=void 0;var V0=!1,z0=Ot(),Ta=re(),Z0=U(),$0=Aa();qr.logger=new Z0.Logger($0.version);var X0=function(){function i(r){var e=this.constructor;qr.logger.checkAbstract(e,i),(0,Ta.defineReadOnly)(this,"locale",r)}return i.prototype.split=function(r){return r.toLowerCase().split(/ +/g)},i.prototype.join=function(r){return r.join(" ")},i.check=function(r){for(var e=[],t=0;t<2048;t++){var n=r.getWord(t);if(t!==r.getWordIndex(n))return"0x";e.push(n)}return(0,z0.id)(e.join(`
`)+`
`)},i.register=function(r,e){if(e||(e=r.locale),V0)try{var t=window;t._ethers&&t._ethers.wordlists&&(t._ethers.wordlists[e]||(0,Ta.defineReadOnly)(t._ethers.wordlists,e,r))}catch{}},i}();qr.Wordlist=X0});var La=E(nt=>{"use strict";d();h();var Q0=nt&&nt.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(nt,"__esModule",{value:!0});nt.langEn=void 0;var Vi=Ki(),Y0="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",jt=null;function Ca(i){if(jt==null&&(jt=Y0.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Vi.Wordlist.check(i)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw jt=null,new Error("BIP39 Wordlist for en (English) FAILED")}var ef=function(i){Q0(r,i);function r(){return i.call(this,"en")||this}return r.prototype.getWord=function(e){return Ca(this),jt[e]},r.prototype.getWordIndex=function(e){return Ca(this),jt.indexOf(e)},r}(Vi.Wordlist),Na=new ef;nt.langEn=Na;Vi.Wordlist.register(Na)});var Ba=E(In=>{"use strict";d();h();Object.defineProperty(In,"__esModule",{value:!0});In.wordlists=void 0;var He=La();In.wordlists={cz:He.langEn,en:He.langEn,es:He.langEn,fr:He.langEn,it:He.langEn,ja:He.langEn,ko:He.langEn,zh:He.langEn,zh_cn:He.langEn,zh_tw:He.langEn}});var Fa=E(vr=>{"use strict";d();h();Object.defineProperty(vr,"__esModule",{value:!0});vr.wordlists=vr.Wordlist=vr.logger=void 0;var Ia=Ki();Object.defineProperty(vr,"logger",{enumerable:!0,get:function(){return Ia.logger}});Object.defineProperty(vr,"Wordlist",{enumerable:!0,get:function(){return Ia.Wordlist}});var rf=Ba();Object.defineProperty(vr,"wordlists",{enumerable:!0,get:function(){return rf.wordlists}})});var Zi=E(mr=>{"use strict";d();h();Object.defineProperty(mr,"__esModule",{value:!0});mr.Base58=mr.Base32=mr.BaseX=void 0;var ja=ee(),Fn=re(),zi=function(){function i(r){(0,Fn.defineReadOnly)(this,"alphabet",r),(0,Fn.defineReadOnly)(this,"base",r.length),(0,Fn.defineReadOnly)(this,"_alphabetMap",{}),(0,Fn.defineReadOnly)(this,"_leader",r.charAt(0));for(var e=0;e<r.length;e++)this._alphabetMap[r.charAt(e)]=e}return i.prototype.encode=function(r){var e=(0,ja.arrayify)(r);if(e.length===0)return"";for(var t=[0],n=0;n<e.length;++n){for(var o=e[n],s=0;s<t.length;++s)o+=t[s]<<8,t[s]=o%this.base,o=o/this.base|0;for(;o>0;)t.push(o%this.base),o=o/this.base|0}for(var c="",u=0;e[u]===0&&u<e.length-1;++u)c+=this._leader;for(var a=t.length-1;a>=0;--a)c+=this.alphabet[t[a]];return c},i.prototype.decode=function(r){if(typeof r!="string")throw new TypeError("Expected String");var e=[];if(r.length===0)return new Uint8Array(e);e.push(0);for(var t=0;t<r.length;t++){var n=this._alphabetMap[r[t]];if(n===void 0)throw new Error("Non-base"+this.base+" character");for(var o=n,s=0;s<e.length;++s)o+=e[s]*this.base,e[s]=o&255,o>>=8;for(;o>0;)e.push(o&255),o>>=8}for(var c=0;r[c]===this._leader&&c<r.length-1;++c)e.push(0);return(0,ja.arrayify)(new Uint8Array(e.reverse()))},i}();mr.BaseX=zi;var tf=new zi("abcdefghijklmnopqrstuvwxyz234567");mr.Base32=tf;var nf=new zi("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");mr.Base58=nf});var $i=E(qt=>{"use strict";d();h();Object.defineProperty(qt,"__esModule",{value:!0});qt.SupportedAlgorithm=void 0;var of;(function(i){i.sha256="sha256",i.sha512="sha512"})(of=qt.SupportedAlgorithm||(qt.SupportedAlgorithm={}))});var qa=E(jn=>{"use strict";d();h();Object.defineProperty(jn,"__esModule",{value:!0});jn.version=void 0;jn.version="sha2/5.7.0"});var Ma=E(Ce=>{"use strict";d();h();var af=Ce&&Ce.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.computeHmac=Ce.sha512=Ce.sha256=Ce.ripemd160=void 0;var Dt=af(lu()),Mt=ee(),sf=$i(),Da=U(),cf=qa(),uf=new Da.Logger(cf.version);function ff(i){return"0x"+Dt.default.ripemd160().update((0,Mt.arrayify)(i)).digest("hex")}Ce.ripemd160=ff;function lf(i){return"0x"+Dt.default.sha256().update((0,Mt.arrayify)(i)).digest("hex")}Ce.sha256=lf;function df(i){return"0x"+Dt.default.sha512().update((0,Mt.arrayify)(i)).digest("hex")}Ce.sha512=df;function hf(i,r,e){return sf.SupportedAlgorithm[i]||uf.throwError("unsupported algorithm "+i,Da.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:i}),"0x"+Dt.default.hmac(Dt.default[i],(0,Mt.arrayify)(r)).update((0,Mt.arrayify)(e)).digest("hex")}Ce.computeHmac=hf});var Ut=E(Ne=>{"use strict";d();h();Object.defineProperty(Ne,"__esModule",{value:!0});Ne.SupportedAlgorithm=Ne.sha512=Ne.sha256=Ne.ripemd160=Ne.computeHmac=void 0;var qn=Ma();Object.defineProperty(Ne,"computeHmac",{enumerable:!0,get:function(){return qn.computeHmac}});Object.defineProperty(Ne,"ripemd160",{enumerable:!0,get:function(){return qn.ripemd160}});Object.defineProperty(Ne,"sha256",{enumerable:!0,get:function(){return qn.sha256}});Object.defineProperty(Ne,"sha512",{enumerable:!0,get:function(){return qn.sha512}});var xf=$i();Object.defineProperty(Ne,"SupportedAlgorithm",{enumerable:!0,get:function(){return xf.SupportedAlgorithm}})});var Wa=E(Dn=>{"use strict";d();h();Object.defineProperty(Dn,"__esModule",{value:!0});Dn.pbkdf2=void 0;var it=ee(),Ua=Ut();function pf(i,r,e,t,n){i=(0,it.arrayify)(i),r=(0,it.arrayify)(r);var o,s=1,c=new Uint8Array(t),u=new Uint8Array(r.length+4);u.set(r);for(var a,f,l=1;l<=s;l++){u[r.length]=l>>24&255,u[r.length+1]=l>>16&255,u[r.length+2]=l>>8&255,u[r.length+3]=l&255;var p=(0,it.arrayify)((0,Ua.computeHmac)(n,i,u));o||(o=p.length,f=new Uint8Array(o),s=Math.ceil(t/o),a=t-(s-1)*o),f.set(p);for(var y=1;y<e;y++){p=(0,it.arrayify)((0,Ua.computeHmac)(n,i,p));for(var S=0;S<o;S++)f[S]^=p[S]}var m=(l-1)*o,_=l===s?a:o;c.set((0,it.arrayify)(f).slice(0,_),m)}return(0,it.hexlify)(c)}Dn.pbkdf2=pf});var Un=E(Mn=>{"use strict";d();h();Object.defineProperty(Mn,"__esModule",{value:!0});Mn.pbkdf2=void 0;var bf=Wa();Object.defineProperty(Mn,"pbkdf2",{enumerable:!0,get:function(){return bf.pbkdf2}})});var Ga=E(Wn=>{"use strict";d();h();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.version=void 0;Wn.version="hdnode/5.7.0"});var Yi=E(we=>{"use strict";d();h();Object.defineProperty(we,"__esModule",{value:!0});we.getAccountPath=we.isValidMnemonic=we.entropyToMnemonic=we.mnemonicToEntropy=we.mnemonicToSeed=we.HDNode=we.defaultPath=void 0;var Va=Zi(),Z=ee(),za=Oe(),Wt=dr(),gf=Un(),_e=re(),Ha=Io(),Je=Ut(),yf=Lr(),Ja=Fa(),vf=U(),mf=Ga(),Gt=new vf.Logger(mf.version),_f=za.BigNumber.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),wf=(0,Wt.toUtf8Bytes)("Bitcoin seed"),at=2147483648;function Za(i){return(1<<i)-1<<8-i}function Ef(i){return(1<<i)-1}function Gn(i){return(0,Z.hexZeroPad)((0,Z.hexlify)(i),32)}function Ka(i){return Va.Base58.encode((0,Z.concat)([i,(0,Z.hexDataSlice)((0,Je.sha256)((0,Je.sha256)(i)),0,4)]))}function Xi(i){if(i==null)return Ja.wordlists.en;if(typeof i=="string"){var r=Ja.wordlists[i];return r==null&&Gt.throwArgumentError("unknown locale","wordlist",i),r}return i}var ot={};we.defaultPath="m/44'/60'/0'/0/0";var Pf=function(){function i(r,e,t,n,o,s,c,u){if(r!==ot)throw new Error("HDNode constructor cannot be called directly");if(e){var a=new Ha.SigningKey(e);(0,_e.defineReadOnly)(this,"privateKey",a.privateKey),(0,_e.defineReadOnly)(this,"publicKey",a.compressedPublicKey)}else(0,_e.defineReadOnly)(this,"privateKey",null),(0,_e.defineReadOnly)(this,"publicKey",(0,Z.hexlify)(t));(0,_e.defineReadOnly)(this,"parentFingerprint",n),(0,_e.defineReadOnly)(this,"fingerprint",(0,Z.hexDataSlice)((0,Je.ripemd160)((0,Je.sha256)(this.publicKey)),0,4)),(0,_e.defineReadOnly)(this,"address",(0,yf.computeAddress)(this.publicKey)),(0,_e.defineReadOnly)(this,"chainCode",o),(0,_e.defineReadOnly)(this,"index",s),(0,_e.defineReadOnly)(this,"depth",c),u==null?((0,_e.defineReadOnly)(this,"mnemonic",null),(0,_e.defineReadOnly)(this,"path",null)):typeof u=="string"?((0,_e.defineReadOnly)(this,"mnemonic",null),(0,_e.defineReadOnly)(this,"path",u)):((0,_e.defineReadOnly)(this,"mnemonic",u),(0,_e.defineReadOnly)(this,"path",u.path))}return Object.defineProperty(i.prototype,"extendedKey",{get:function(){if(this.depth>=256)throw new Error("Depth too large!");return Ka((0,Z.concat)([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",(0,Z.hexlify)(this.depth),this.parentFingerprint,(0,Z.hexZeroPad)((0,Z.hexlify)(this.index),4),this.chainCode,this.privateKey!=null?(0,Z.concat)(["0x00",this.privateKey]):this.publicKey]))},enumerable:!1,configurable:!0}),i.prototype.neuter=function(){return new i(ot,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)},i.prototype._derive=function(r){if(r>4294967295)throw new Error("invalid index - "+String(r));var e=this.path;e&&(e+="/"+(r&~at));var t=new Uint8Array(37);if(r&at){if(!this.privateKey)throw new Error("cannot derive child of neutered node");t.set((0,Z.arrayify)(this.privateKey),1),e&&(e+="'")}else t.set((0,Z.arrayify)(this.publicKey));for(var n=24;n>=0;n-=8)t[33+(n>>3)]=r>>24-n&255;var o=(0,Z.arrayify)((0,Je.computeHmac)(Je.SupportedAlgorithm.sha512,this.chainCode,t)),s=o.slice(0,32),c=o.slice(32),u=null,a=null;if(this.privateKey)u=Gn(za.BigNumber.from(s).add(this.privateKey).mod(_f));else{var f=new Ha.SigningKey((0,Z.hexlify)(s));a=f._addPoint(this.publicKey)}var l=e,p=this.mnemonic;return p&&(l=Object.freeze({phrase:p.phrase,path:e,locale:p.locale||"en"})),new i(ot,u,a,this.fingerprint,Gn(c),r,this.depth+1,l)},i.prototype.derivePath=function(r){var e=r.split("/");if(e.length===0||e[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+r);e[0]==="m"&&e.shift();for(var t=this,n=0;n<e.length;n++){var o=e[n];if(o.match(/^[0-9]+'$/)){var s=parseInt(o.substring(0,o.length-1));if(s>=at)throw new Error("invalid path index - "+o);t=t._derive(at+s)}else if(o.match(/^[0-9]+$/)){var s=parseInt(o);if(s>=at)throw new Error("invalid path index - "+o);t=t._derive(s)}else throw new Error("invalid path component - "+o)}return t},i._fromSeed=function(r,e){var t=(0,Z.arrayify)(r);if(t.length<16||t.length>64)throw new Error("invalid seed");var n=(0,Z.arrayify)((0,Je.computeHmac)(Je.SupportedAlgorithm.sha512,wf,t));return new i(ot,Gn(n.slice(0,32)),null,"0x00000000",Gn(n.slice(32)),0,0,e)},i.fromMnemonic=function(r,e,t){return t=Xi(t),r=Xa(Qi(r,t),t),i._fromSeed($a(r,e),{phrase:r,path:"m",locale:t.locale})},i.fromSeed=function(r){return i._fromSeed(r,null)},i.fromExtendedKey=function(r){var e=Va.Base58.decode(r);(e.length!==82||Ka(e.slice(0,78))!==r)&&Gt.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var t=e[4],n=(0,Z.hexlify)(e.slice(5,9)),o=parseInt((0,Z.hexlify)(e.slice(9,13)).substring(2),16),s=(0,Z.hexlify)(e.slice(13,45)),c=e.slice(45,78);switch((0,Z.hexlify)(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new i(ot,null,(0,Z.hexlify)(c),n,s,o,t,null);case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new i(ot,(0,Z.hexlify)(c.slice(1)),null,n,s,o,t,null)}return Gt.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")},i}();we.HDNode=Pf;function $a(i,r){r||(r="");var e=(0,Wt.toUtf8Bytes)("mnemonic"+r,Wt.UnicodeNormalizationForm.NFKD);return(0,gf.pbkdf2)((0,Wt.toUtf8Bytes)(i,Wt.UnicodeNormalizationForm.NFKD),e,2048,64,"sha512")}we.mnemonicToSeed=$a;function Qi(i,r){r=Xi(r),Gt.checkNormalize();var e=r.split(i);if(e.length%3!==0)throw new Error("invalid mnemonic");for(var t=(0,Z.arrayify)(new Uint8Array(Math.ceil(11*e.length/8))),n=0,o=0;o<e.length;o++){var s=r.getWordIndex(e[o].normalize("NFKD"));if(s===-1)throw new Error("invalid mnemonic");for(var c=0;c<11;c++)s&1<<10-c&&(t[n>>3]|=1<<7-n%8),n++}var u=32*e.length/3,a=e.length/3,f=Za(a),l=(0,Z.arrayify)((0,Je.sha256)(t.slice(0,u/8)))[0]&f;if(l!==(t[t.length-1]&f))throw new Error("invalid checksum");return(0,Z.hexlify)(t.slice(0,u/8))}we.mnemonicToEntropy=Qi;function Xa(i,r){if(r=Xi(r),i=(0,Z.arrayify)(i),i.length%4!==0||i.length<16||i.length>32)throw new Error("invalid entropy");for(var e=[0],t=11,n=0;n<i.length;n++)t>8?(e[e.length-1]<<=8,e[e.length-1]|=i[n],t-=8):(e[e.length-1]<<=t,e[e.length-1]|=i[n]>>8-t,e.push(i[n]&Ef(8-t)),t+=3);var o=i.length/4,s=(0,Z.arrayify)((0,Je.sha256)(i))[0]&Za(o);return e[e.length-1]<<=o,e[e.length-1]|=s>>8-o,r.join(e.map(function(c){return r.getWord(c)}))}we.entropyToMnemonic=Xa;function kf(i,r){try{return Qi(i,r),!0}catch{}return!1}we.isValidMnemonic=kf;function Sf(i){return(typeof i!="number"||i<0||i>=at||i%1)&&Gt.throwArgumentError("invalid account index","index",i),"m/44'/60'/"+i+"'/0/0"}we.getAccountPath=Sf});var Qa=E(Hn=>{"use strict";d();h();Object.defineProperty(Hn,"__esModule",{value:!0});Hn.version=void 0;Hn.version="random/5.7.0"});var rs=E(Kn=>{"use strict";d();h();Object.defineProperty(Kn,"__esModule",{value:!0});Kn.randomBytes=void 0;var Of=ee(),es=U(),Rf=Qa(),eo=new es.Logger(Rf.version);function Af(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}var Ya=Af(),Jn=Ya.crypto||Ya.msCrypto;(!Jn||!Jn.getRandomValues)&&(eo.warn("WARNING: Missing strong random number source"),Jn={getRandomValues:function(i){return eo.throwError("no secure random source avaialble",es.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Tf(i){(i<=0||i>1024||i%1||i!=i)&&eo.throwArgumentError("invalid length","length",i);var r=new Uint8Array(i);return Jn.getRandomValues(r),(0,Of.arrayify)(r)}Kn.randomBytes=Tf});var ts=E(Vn=>{"use strict";d();h();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.shuffled=void 0;function Cf(i){i=i.slice();for(var r=i.length-1;r>0;r--){var e=Math.floor(Math.random()*(r+1)),t=i[r];i[r]=i[e],i[e]=t}return i}Vn.shuffled=Cf});var zn=E(st=>{"use strict";d();h();Object.defineProperty(st,"__esModule",{value:!0});st.shuffled=st.randomBytes=void 0;var Nf=rs();Object.defineProperty(st,"randomBytes",{enumerable:!0,get:function(){return Nf.randomBytes}});var Lf=ts();Object.defineProperty(st,"shuffled",{enumerable:!0,get:function(){return Lf.shuffled}})});var to=E((ro,ns)=>{"use strict";d();h();(function(i){function r(x){return parseInt(x)===x}function e(x){if(!r(x.length))return!1;for(var b=0;b<x.length;b++)if(!r(x[b])||x[b]<0||x[b]>255)return!1;return!0}function t(x,b){if(x.buffer&&ArrayBuffer.isView(x)&&x.name==="Uint8Array")return b&&(x.slice?x=x.slice():x=Array.prototype.slice.call(x)),x;if(Array.isArray(x)){if(!e(x))throw new Error("Array contains invalid value: "+x);return new Uint8Array(x)}if(r(x.length)&&e(x))return new Uint8Array(x);throw new Error("unsupported array-like object")}function n(x){return new Uint8Array(x)}function o(x,b,w,v,g){(v!=null||g!=null)&&(x.slice?x=x.slice(v,g):x=Array.prototype.slice.call(x,v,g)),b.set(x,w)}var s=function(){function x(w){var v=[],g=0;for(w=encodeURI(w);g<w.length;){var V=w.charCodeAt(g++);V===37?(v.push(parseInt(w.substr(g,2),16)),g+=2):v.push(V)}return t(v)}function b(w){for(var v=[],g=0;g<w.length;){var V=w[g];V<128?(v.push(String.fromCharCode(V)),g++):V>191&&V<224?(v.push(String.fromCharCode((V&31)<<6|w[g+1]&63)),g+=2):(v.push(String.fromCharCode((V&15)<<12|(w[g+1]&63)<<6|w[g+2]&63)),g+=3)}return v.join("")}return{toBytes:x,fromBytes:b}}(),c=function(){function x(v){for(var g=[],V=0;V<v.length;V+=2)g.push(parseInt(v.substr(V,2),16));return g}var b="0123456789abcdef";function w(v){for(var g=[],V=0;V<v.length;V++){var xe=v[V];g.push(b[(xe&240)>>4]+b[xe&15])}return g.join("")}return{toBytes:x,fromBytes:w}}(),u={16:10,24:12,32:14},a=[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],l=[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],y=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],S=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],m=[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],_=[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],T=[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],L=[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],W=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],J=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],j=[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],B=[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],$=[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 Q(x){for(var b=[],w=0;w<x.length;w+=4)b.push(x[w]<<24|x[w+1]<<16|x[w+2]<<8|x[w+3]);return b}var k=function(x){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:t(x,!0)}),this._prepare()};k.prototype._prepare=function(){var x=u[this.key.length];if(x==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var b=0;b<=x;b++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var w=(x+1)*4,v=this.key.length/4,g=Q(this.key),V,b=0;b<v;b++)V=b>>2,this._Ke[V][b%4]=g[b],this._Kd[x-V][b%4]=g[b];for(var xe=0,pe=v,ke;pe<w;){if(ke=g[v-1],g[0]^=f[ke>>16&255]<<24^f[ke>>8&255]<<16^f[ke&255]<<8^f[ke>>24&255]^a[xe]<<24,xe+=1,v!=8)for(var b=1;b<v;b++)g[b]^=g[b-1];else{for(var b=1;b<v/2;b++)g[b]^=g[b-1];ke=g[v/2-1],g[v/2]^=f[ke&255]^f[ke>>8&255]<<8^f[ke>>16&255]<<16^f[ke>>24&255]<<24;for(var b=v/2+1;b<v;b++)g[b]^=g[b-1]}for(var b=0,ur,fr;b<v&&pe<w;)ur=pe>>2,fr=pe%4,this._Ke[ur][fr]=g[b],this._Kd[x-ur][fr]=g[b++],pe++}for(var ur=1;ur<x;ur++)for(var fr=0;fr<4;fr++)ke=this._Kd[ur][fr],this._Kd[ur][fr]=J[ke>>24&255]^j[ke>>16&255]^B[ke>>8&255]^$[ke&255]},k.prototype.encrypt=function(x){if(x.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var b=this._Ke.length-1,w=[0,0,0,0],v=Q(x),g=0;g<4;g++)v[g]^=this._Ke[0][g];for(var V=1;V<b;V++){for(var g=0;g<4;g++)w[g]=p[v[g]>>24&255]^y[v[(g+1)%4]>>16&255]^S[v[(g+2)%4]>>8&255]^m[v[(g+3)%4]&255]^this._Ke[V][g];v=w.slice()}for(var xe=n(16),pe,g=0;g<4;g++)pe=this._Ke[b][g],xe[4*g]=(f[v[g]>>24&255]^pe>>24)&255,xe[4*g+1]=(f[v[(g+1)%4]>>16&255]^pe>>16)&255,xe[4*g+2]=(f[v[(g+2)%4]>>8&255]^pe>>8)&255,xe[4*g+3]=(f[v[(g+3)%4]&255]^pe)&255;return xe},k.prototype.decrypt=function(x){if(x.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var b=this._Kd.length-1,w=[0,0,0,0],v=Q(x),g=0;g<4;g++)v[g]^=this._Kd[0][g];for(var V=1;V<b;V++){for(var g=0;g<4;g++)w[g]=_[v[g]>>24&255]^T[v[(g+3)%4]>>16&255]^L[v[(g+2)%4]>>8&255]^W[v[(g+1)%4]&255]^this._Kd[V][g];v=w.slice()}for(var xe=n(16),pe,g=0;g<4;g++)pe=this._Kd[b][g],xe[4*g]=(l[v[g]>>24&255]^pe>>24)&255,xe[4*g+1]=(l[v[(g+3)%4]>>16&255]^pe>>16)&255,xe[4*g+2]=(l[v[(g+2)%4]>>8&255]^pe>>8)&255,xe[4*g+3]=(l[v[(g+1)%4]&255]^pe)&255;return xe};var A=function(x){if(!(this instanceof A))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(x)};A.prototype.encrypt=function(x){if(x=t(x),x.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var b=n(x.length),w=n(16),v=0;v<x.length;v+=16)o(x,w,0,v,v+16),w=this._aes.encrypt(w),o(w,b,v);return b},A.prototype.decrypt=function(x){if(x=t(x),x.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var b=n(x.length),w=n(16),v=0;v<x.length;v+=16)o(x,w,0,v,v+16),w=this._aes.decrypt(w),o(w,b,v);return b};var H=function(x,b){if(!(this instanceof H))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!b)b=n(16);else if(b.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=t(b,!0),this._aes=new k(x)};H.prototype.encrypt=function(x){if(x=t(x),x.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var b=n(x.length),w=n(16),v=0;v<x.length;v+=16){o(x,w,0,v,v+16);for(var g=0;g<16;g++)w[g]^=this._lastCipherblock[g];this._lastCipherblock=this._aes.encrypt(w),o(this._lastCipherblock,b,v)}return b},H.prototype.decrypt=function(x){if(x=t(x),x.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var b=n(x.length),w=n(16),v=0;v<x.length;v+=16){o(x,w,0,v,v+16),w=this._aes.decrypt(w);for(var g=0;g<16;g++)b[v+g]=w[g]^this._lastCipherblock[g];o(x,this._lastCipherblock,0,v,v+16)}return b};var ae=function(x,b,w){if(!(this instanceof ae))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!b)b=n(16);else if(b.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");w||(w=1),this.segmentSize=w,this._shiftRegister=t(b,!0),this._aes=new k(x)};ae.prototype.encrypt=function(x){if(x.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var b=t(x,!0),w,v=0;v<b.length;v+=this.segmentSize){w=this._aes.encrypt(this._shiftRegister);for(var g=0;g<this.segmentSize;g++)b[v+g]^=w[g];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(b,this._shiftRegister,16-this.segmentSize,v,v+this.segmentSize)}return b},ae.prototype.decrypt=function(x){if(x.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var b=t(x,!0),w,v=0;v<b.length;v+=this.segmentSize){w=this._aes.encrypt(this._shiftRegister);for(var g=0;g<this.segmentSize;g++)b[v+g]^=w[g];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(x,this._shiftRegister,16-this.segmentSize,v,v+this.segmentSize)}return b};var X=function(x,b){if(!(this instanceof X))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!b)b=n(16);else if(b.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=t(b,!0),this._lastPrecipherIndex=16,this._aes=new k(x)};X.prototype.encrypt=function(x){for(var b=t(x,!0),w=0;w<b.length;w++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),b[w]^=this._lastPrecipher[this._lastPrecipherIndex++];return b},X.prototype.decrypt=X.prototype.encrypt;var he=function(x){if(!(this instanceof he))throw Error("Counter must be instanitated with `new`");x!==0&&!x&&(x=1),typeof x=="number"?(this._counter=n(16),this.setValue(x)):this.setBytes(x)};he.prototype.setValue=function(x){if(typeof x!="number"||parseInt(x)!=x)throw new Error("invalid counter value (must be an integer)");for(var b=15;b>=0;--b)this._counter[b]=x%256,x=x>>8},he.prototype.setBytes=function(x){if(x=t(x,!0),x.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=x},he.prototype.increment=function(){for(var x=15;x>=0;x--)if(this._counter[x]===255)this._counter[x]=0;else{this._counter[x]++;break}};var Ue=function(x,b){if(!(this instanceof Ue))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",b instanceof he||(b=new he(b)),this._counter=b,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(x)};Ue.prototype.encrypt=function(x){for(var b=t(x,!0),w=0;w<b.length;w++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),b[w]^=this._remainingCounter[this._remainingCounterIndex++];return b},Ue.prototype.decrypt=Ue.prototype.encrypt;function Y(x){x=t(x,!0);var b=16-x.length%16,w=n(x.length+b);o(x,w);for(var v=x.length;v<w.length;v++)w[v]=b;return w}function Ai(x){if(x=t(x,!0),x.length<16)throw new Error("PKCS#7 invalid length");var b=x[x.length-1];if(b>16)throw new Error("PKCS#7 padding byte out of range");for(var w=x.length-b,v=0;v<b;v++)if(x[w+v]!==b)throw new Error("PKCS#7 invalid padding byte");var g=n(w);return o(x,g,0,0,w),g}var cn={AES:k,Counter:he,ModeOfOperation:{ecb:A,cbc:H,cfb:ae,ofb:X,ctr:Ue},utils:{hex:c,utf8:s},padding:{pkcs7:{pad:Y,strip:Ai}},_arrayTest:{coerceArray:t,createArray:n,copyArray:o}};typeof ro<"u"?ns.exports=cn:typeof define=="function"&&define.amd?define(cn):(i.aesjs&&(cn._aesjs=i.aesjs),i.aesjs=cn)})(ro)});var no=E(Zn=>{"use strict";d();h();Object.defineProperty(Zn,"__esModule",{value:!0});Zn.version=void 0;Zn.version="json-wallets/5.7.0"});var io=E(Le=>{"use strict";d();h();Object.defineProperty(Le,"__esModule",{value:!0});Le.uuidV4=Le.searchPath=Le.getPassword=Le.zpad=Le.looseArrayify=void 0;var $n=ee(),is=dr();function Bf(i){return typeof i=="string"&&i.substring(0,2)!=="0x"&&(i="0x"+i),(0,$n.arrayify)(i)}Le.looseArrayify=Bf;function If(i,r){for(i=String(i);i.length<r;)i="0"+i;return i}Le.zpad=If;function Ff(i){return typeof i=="string"?(0,is.toUtf8Bytes)(i,is.UnicodeNormalizationForm.NFKC):(0,$n.arrayify)(i)}Le.getPassword=Ff;function jf(i,r){for(var e=i,t=r.toLowerCase().split("/"),n=0;n<t.length;n++){var o=null;for(var s in e)if(s.toLowerCase()===t[n]){o=e[s];break}if(o===null)return null;e=o}return e}Le.searchPath=jf;function qf(i){var r=(0,$n.arrayify)(i);r[6]=r[6]&15|64,r[8]=r[8]&63|128;var e=(0,$n.hexlify)(r);return[e.substring(2,10),e.substring(10,14),e.substring(14,18),e.substring(18,22),e.substring(22,34)].join("-")}Le.uuidV4=qf});var cs=E(Ke=>{"use strict";d();h();var Df=Ke&&Ke.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),Mf=Ke&&Ke.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.decrypt=Ke.CrowdsaleAccount=void 0;var os=Mf(to()),Uf=lr(),as=ee(),Wf=St(),Gf=Un(),Hf=dr(),Jf=re(),Kf=U(),Vf=no(),zf=new Kf.Logger(Vf.version),Xn=io(),ss=function(i){Df(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.isCrowdsaleAccount=function(e){return!!(e&&e._isCrowdsaleAccount)},r}(Jf.Description);Ke.CrowdsaleAccount=ss;function Zf(i,r){var e=JSON.parse(i);r=(0,Xn.getPassword)(r);var t=(0,Uf.getAddress)((0,Xn.searchPath)(e,"ethaddr")),n=(0,Xn.looseArrayify)((0,Xn.searchPath)(e,"encseed"));(!n||n.length%16!==0)&&zf.throwArgumentError("invalid encseed","json",i);for(var o=(0,as.arrayify)((0,Gf.pbkdf2)(r,r,2e3,32,"sha256")).slice(0,16),s=n.slice(0,16),c=n.slice(16),u=new os.default.ModeOfOperation.cbc(o,s),a=os.default.padding.pkcs7.strip((0,as.arrayify)(u.decrypt(c))),f="",l=0;l<a.length;l++)f+=String.fromCharCode(a[l]);var p=(0,Hf.toUtf8Bytes)(f),y=(0,Wf.keccak256)(p);return new ss({_isCrowdsaleAccount:!0,address:t,privateKey:y})}Ke.decrypt=Zf});var ds=E(_r=>{"use strict";d();h();Object.defineProperty(_r,"__esModule",{value:!0});_r.getJsonWalletAddress=_r.isKeystoreWallet=_r.isCrowdsaleWallet=void 0;var us=lr();function fs(i){var r=null;try{r=JSON.parse(i)}catch{return!1}return r.encseed&&r.ethaddr}_r.isCrowdsaleWallet=fs;function ls(i){var r=null;try{r=JSON.parse(i)}catch{return!1}return!(!r.version||parseInt(r.version)!==r.version||parseInt(r.version)!==3)}_r.isKeystoreWallet=ls;function $f(i){if(fs(i))try{return(0,us.getAddress)(JSON.parse(i).ethaddr)}catch{return null}if(ls(i))try{return(0,us.getAddress)(JSON.parse(i).address)}catch{return null}return null}_r.getJsonWalletAddress=$f});var ws=E(de=>{"use strict";d();h();var Xf=de&&de.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),Qf=de&&de.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},Yf=de&&de.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},xs=de&&de.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(de,"__esModule",{value:!0});de.encrypt=de.decrypt=de.decryptSync=de.KeystoreAccount=void 0;var wr=xs(to()),so=xs(du()),ps=lr(),se=ee(),Dr=Yi(),bs=St(),el=Un(),Qn=zn(),rl=re(),gs=Lr(),G=io(),oo=U(),tl=no(),ao=new oo.Logger(tl.version);function hs(i){return i!=null&&i.mnemonic&&i.mnemonic.phrase}var ys=function(i){Xf(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.isKeystoreAccount=function(e){return!!(e&&e._isKeystoreAccount)},r}(rl.Description);de.KeystoreAccount=ys;function nl(i,r,e){var t=(0,G.searchPath)(i,"crypto/cipher");if(t==="aes-128-ctr"){var n=(0,G.looseArrayify)((0,G.searchPath)(i,"crypto/cipherparams/iv")),o=new wr.default.Counter(n),s=new wr.default.ModeOfOperation.ctr(r,o);return(0,se.arrayify)(s.decrypt(e))}return null}function vs(i,r){var e=(0,G.looseArrayify)((0,G.searchPath)(i,"crypto/ciphertext")),t=(0,se.hexlify)((0,bs.keccak256)((0,se.concat)([r.slice(16,32),e]))).substring(2);if(t!==(0,G.searchPath)(i,"crypto/mac").toLowerCase())throw new Error("invalid password");var n=nl(i,r.slice(0,16),e);n||ao.throwError("unsupported cipher",oo.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var o=r.slice(32,64),s=(0,gs.computeAddress)(n);if(i.address){var c=i.address.toLowerCase();if(c.substring(0,2)!=="0x"&&(c="0x"+c),(0,ps.getAddress)(c)!==s)throw new Error("address mismatch")}var u={_isKeystoreAccount:!0,address:s,privateKey:(0,se.hexlify)(n)};if((0,G.searchPath)(i,"x-ethers/version")==="0.1"){var a=(0,G.looseArrayify)((0,G.searchPath)(i,"x-ethers/mnemonicCiphertext")),f=(0,G.looseArrayify)((0,G.searchPath)(i,"x-ethers/mnemonicCounter")),l=new wr.default.Counter(f),p=new wr.default.ModeOfOperation.ctr(o,l),y=(0,G.searchPath)(i,"x-ethers/path")||Dr.defaultPath,S=(0,G.searchPath)(i,"x-ethers/locale")||"en",m=(0,se.arrayify)(p.decrypt(a));try{var _=(0,Dr.entropyToMnemonic)(m,S),T=Dr.HDNode.fromMnemonic(_,null,S).derivePath(y);if(T.privateKey!=u.privateKey)throw new Error("mnemonic mismatch");u.mnemonic=T.mnemonic}catch(L){if(L.code!==oo.Logger.errors.INVALID_ARGUMENT||L.argument!=="wordlist")throw L}}return new ys(u)}function ms(i,r,e,t,n){return(0,se.arrayify)((0,el.pbkdf2)(i,r,e,t,n))}function il(i,r,e,t,n){return Promise.resolve(ms(i,r,e,t,n))}function _s(i,r,e,t,n){var o=(0,G.getPassword)(r),s=(0,G.searchPath)(i,"crypto/kdf");if(s&&typeof s=="string"){var c=function(_,T){return ao.throwArgumentError("invalid key-derivation function parameters",_,T)};if(s.toLowerCase()==="scrypt"){var u=(0,G.looseArrayify)((0,G.searchPath)(i,"crypto/kdfparams/salt")),a=parseInt((0,G.searchPath)(i,"crypto/kdfparams/n")),f=parseInt((0,G.searchPath)(i,"crypto/kdfparams/r")),l=parseInt((0,G.searchPath)(i,"crypto/kdfparams/p"));(!a||!f||!l)&&c("kdf",s),(a&a-1)!==0&&c("N",a);var p=parseInt((0,G.searchPath)(i,"crypto/kdfparams/dklen"));return p!==32&&c("dklen",p),t(o,u,a,f,l,64,n)}else if(s.toLowerCase()==="pbkdf2"){var u=(0,G.looseArrayify)((0,G.searchPath)(i,"crypto/kdfparams/salt")),y=null,S=(0,G.searchPath)(i,"crypto/kdfparams/prf");S==="hmac-sha256"?y="sha256":S==="hmac-sha512"?y="sha512":c("prf",S);var m=parseInt((0,G.searchPath)(i,"crypto/kdfparams/c")),p=parseInt((0,G.searchPath)(i,"crypto/kdfparams/dklen"));return p!==32&&c("dklen",p),e(o,u,m,p,y)}}return ao.throwArgumentError("unsupported key-derivation function","kdf",s)}function ol(i,r){var e=JSON.parse(i),t=_s(e,r,ms,so.default.syncScrypt);return vs(e,t)}de.decryptSync=ol;function al(i,r,e){return Qf(this,void 0,void 0,function(){var t,n;return Yf(this,function(o){switch(o.label){case 0:return t=JSON.parse(i),[4,_s(t,r,il,so.default.scrypt,e)];case 1:return n=o.sent(),[2,vs(t,n)]}})})}de.decrypt=al;function sl(i,r,e,t){try{if((0,ps.getAddress)(i.address)!==(0,gs.computeAddress)(i.privateKey))throw new Error("address/privateKey mismatch");if(hs(i)){var n=i.mnemonic,o=Dr.HDNode.fromMnemonic(n.phrase,null,n.locale).derivePath(n.path||Dr.defaultPath);if(o.privateKey!=i.privateKey)throw new Error("mnemonic mismatch")}}catch(W){return Promise.reject(W)}typeof e=="function"&&!t&&(t=e,e={}),e||(e={});var s=(0,se.arrayify)(i.privateKey),c=(0,G.getPassword)(r),u=null,a=null,f=null;if(hs(i)){var l=i.mnemonic;u=(0,se.arrayify)((0,Dr.mnemonicToEntropy)(l.phrase,l.locale||"en")),a=l.path||Dr.defaultPath,f=l.locale||"en"}var p=e.client;p||(p="ethers.js");var y=null;e.salt?y=(0,se.arrayify)(e.salt):y=(0,Qn.randomBytes)(32);var S=null;if(e.iv){if(S=(0,se.arrayify)(e.iv),S.length!==16)throw new Error("invalid iv")}else S=(0,Qn.randomBytes)(16);var m=null;if(e.uuid){if(m=(0,se.arrayify)(e.uuid),m.length!==16)throw new Error("invalid uuid")}else m=(0,Qn.randomBytes)(16);var _=1<<17,T=8,L=1;return e.scrypt&&(e.scrypt.N&&(_=e.scrypt.N),e.scrypt.r&&(T=e.scrypt.r),e.scrypt.p&&(L=e.scrypt.p)),so.default.scrypt(c,y,_,T,L,64,t).then(function(W){W=(0,se.arrayify)(W);var J=W.slice(0,16),j=W.slice(16,32),B=W.slice(32,64),$=new wr.default.Counter(S),Q=new wr.default.ModeOfOperation.ctr(J,$),k=(0,se.arrayify)(Q.encrypt(s)),A=(0,bs.keccak256)((0,se.concat)([j,k])),H={address:i.address.substring(2).toLowerCase(),id:(0,G.uuidV4)(m),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,se.hexlify)(S).substring(2)},ciphertext:(0,se.hexlify)(k).substring(2),kdf:"scrypt",kdfparams:{salt:(0,se.hexlify)(y).substring(2),n:_,dklen:32,p:L,r:T},mac:A.substring(2)}};if(u){var ae=(0,Qn.randomBytes)(16),X=new wr.default.Counter(ae),he=new wr.default.ModeOfOperation.ctr(B,X),Ue=(0,se.arrayify)(he.encrypt(u)),Y=new Date,Ai=Y.getUTCFullYear()+"-"+(0,G.zpad)(Y.getUTCMonth()+1,2)+"-"+(0,G.zpad)(Y.getUTCDate(),2)+"T"+(0,G.zpad)(Y.getUTCHours(),2)+"-"+(0,G.zpad)(Y.getUTCMinutes(),2)+"-"+(0,G.zpad)(Y.getUTCSeconds(),2)+".0Z";H["x-ethers"]={client:p,gethFilename:"UTC--"+Ai+"--"+H.address,mnemonicCounter:(0,se.hexlify)(ae).substring(2),mnemonicCiphertext:(0,se.hexlify)(Ue).substring(2),path:a,locale:f,version:"0.1"}}return JSON.stringify(H)})}de.encrypt=sl});var Es=E(ce=>{"use strict";d();h();Object.defineProperty(ce,"__esModule",{value:!0});ce.decryptJsonWalletSync=ce.decryptJsonWallet=ce.getJsonWalletAddress=ce.isKeystoreWallet=ce.isCrowdsaleWallet=ce.encryptKeystore=ce.decryptKeystoreSync=ce.decryptKeystore=ce.decryptCrowdsale=void 0;var co=cs();Object.defineProperty(ce,"decryptCrowdsale",{enumerable:!0,get:function(){return co.decrypt}});var Mr=ds();Object.defineProperty(ce,"getJsonWalletAddress",{enumerable:!0,get:function(){return Mr.getJsonWalletAddress}});Object.defineProperty(ce,"isCrowdsaleWallet",{enumerable:!0,get:function(){return Mr.isCrowdsaleWallet}});Object.defineProperty(ce,"isKeystoreWallet",{enumerable:!0,get:function(){return Mr.isKeystoreWallet}});var Ht=ws();Object.defineProperty(ce,"decryptKeystore",{enumerable:!0,get:function(){return Ht.decrypt}});Object.defineProperty(ce,"decryptKeystoreSync",{enumerable:!0,get:function(){return Ht.decryptSync}});Object.defineProperty(ce,"encryptKeystore",{enumerable:!0,get:function(){return Ht.encrypt}});function cl(i,r,e){if((0,Mr.isCrowdsaleWallet)(i)){e&&e(0);var t=(0,co.decrypt)(i,r);return e&&e(1),Promise.resolve(t)}return(0,Mr.isKeystoreWallet)(i)?(0,Ht.decrypt)(i,r,e):Promise.reject(new Error("invalid JSON wallet"))}ce.decryptJsonWallet=cl;function ul(i,r){if((0,Mr.isCrowdsaleWallet)(i))return(0,co.decrypt)(i,r);if((0,Mr.isKeystoreWallet)(i))return(0,Ht.decryptSync)(i,r);throw new Error("invalid JSON wallet")}ce.decryptJsonWalletSync=ul});var Ps=E(Yn=>{"use strict";d();h();Object.defineProperty(Yn,"__esModule",{value:!0});Yn.version=void 0;Yn.version="wallet/5.7.0"});var ml=E(Se=>{"use strict";d();h();var fl=Se&&Se.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),ks=Se&&Se.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},Ss=Se&&Se.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Se,"__esModule",{value:!0});Se.verifyTypedData=Se.verifyMessage=Se.Wallet=void 0;var Os=lr(),ll=tt(),dl=fn(),ut=ee(),Kt=Ot(),Jt=Yi(),Rs=St(),Ve=re(),hl=zn(),uo=Io(),fo=Es(),Ur=Lr(),As=U(),xl=Ps(),ct=new As.Logger(xl.version);function pl(i){return i!=null&&(0,ut.isHexString)(i.privateKey,32)&&i.address!=null}function bl(i){var r=i.mnemonic;return r&&r.phrase}var gl=function(i){fl(r,i);function r(e,t){var n=i.call(this)||this;if(pl(e)){var o=new uo.SigningKey(e.privateKey);if((0,Ve.defineReadOnly)(n,"_signingKey",function(){return o}),(0,Ve.defineReadOnly)(n,"address",(0,Ur.computeAddress)(n.publicKey)),n.address!==(0,Os.getAddress)(e.address)&&ct.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),bl(e)){var s=e.mnemonic;(0,Ve.defineReadOnly)(n,"_mnemonic",function(){return{phrase:s.phrase,path:s.path||Jt.defaultPath,locale:s.locale||"en"}});var c=n.mnemonic,u=Jt.HDNode.fromMnemonic(c.phrase,null,c.locale).derivePath(c.path);(0,Ur.computeAddress)(u.privateKey)!==n.address&&ct.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,Ve.defineReadOnly)(n,"_mnemonic",function(){return null})}else{if(uo.SigningKey.isSigningKey(e))e.curve!=="secp256k1"&&ct.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,Ve.defineReadOnly)(n,"_signingKey",function(){return e});else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);var a=new uo.SigningKey(e);(0,Ve.defineReadOnly)(n,"_signingKey",function(){return a})}(0,Ve.defineReadOnly)(n,"_mnemonic",function(){return null}),(0,Ve.defineReadOnly)(n,"address",(0,Ur.computeAddress)(n.publicKey))}return t&&!ll.Provider.isProvider(t)&&ct.throwArgumentError("invalid provider","provider",t),(0,Ve.defineReadOnly)(n,"provider",t||null),n}return Object.defineProperty(r.prototype,"mnemonic",{get:function(){return this._mnemonic()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"privateKey",{get:function(){return this._signingKey().privateKey},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"publicKey",{get:function(){return this._signingKey().publicKey},enumerable:!1,configurable:!0}),r.prototype.getAddress=function(){return Promise.resolve(this.address)},r.prototype.connect=function(e){return new r(this,e)},r.prototype.signTransaction=function(e){var t=this;return(0,Ve.resolveProperties)(e).then(function(n){n.from!=null&&((0,Os.getAddress)(n.from)!==t.address&&ct.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete n.from);var o=t._signingKey().signDigest((0,Rs.keccak256)((0,Ur.serialize)(n)));return(0,Ur.serialize)(n,o)})},r.prototype.signMessage=function(e){return ks(this,void 0,void 0,function(){return Ss(this,function(t){return[2,(0,ut.joinSignature)(this._signingKey().signDigest((0,Kt.hashMessage)(e)))]})})},r.prototype._signTypedData=function(e,t,n){return ks(this,void 0,void 0,function(){var o,s=this;return Ss(this,function(c){switch(c.label){case 0:return[4,Kt._TypedDataEncoder.resolveNames(e,t,n,function(u){return s.provider==null&&ct.throwError("cannot resolve ENS names without a provider",As.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:u}),s.provider.resolveName(u)})];case 1:return o=c.sent(),[2,(0,ut.joinSignature)(this._signingKey().signDigest(Kt._TypedDataEncoder.hash(o.domain,t,o.value)))]}})})},r.prototype.encrypt=function(e,t,n){if(typeof t=="function"&&!n&&(n=t,t={}),n&&typeof n!="function")throw new Error("invalid callback");return t||(t={}),(0,fo.encryptKeystore)(this,e,t,n)},r.createRandom=function(e){var t=(0,hl.randomBytes)(16);e||(e={}),e.extraEntropy&&(t=(0,ut.arrayify)((0,ut.hexDataSlice)((0,Rs.keccak256)((0,ut.concat)([t,e.extraEntropy])),0,16)));var n=(0,Jt.entropyToMnemonic)(t,e.locale);return r.fromMnemonic(n,e.path,e.locale)},r.fromEncryptedJson=function(e,t,n){return(0,fo.decryptJsonWallet)(e,t,n).then(function(o){return new r(o)})},r.fromEncryptedJsonSync=function(e,t){return new r((0,fo.decryptJsonWalletSync)(e,t))},r.fromMnemonic=function(e,t,n){return t||(t=Jt.defaultPath),new r(Jt.HDNode.fromMnemonic(e,null,n).derivePath(t))},r}(dl.Signer);Se.Wallet=gl;function yl(i,r){return(0,Ur.recoverAddress)((0,Kt.hashMessage)(i),r)}Se.verifyMessage=yl;function vl(i,r,e,t){return(0,Ur.recoverAddress)(Kt._TypedDataEncoder.hash(i,r,e),t)}Se.verifyTypedData=vl});var Ts=E(ei=>{"use strict";d();h();Object.defineProperty(ei,"__esModule",{value:!0});ei.version=void 0;ei.version="networks/5.7.1"});var lo=E(ni=>{"use strict";d();h();Object.defineProperty(ni,"__esModule",{value:!0});ni.getNetwork=void 0;var _l=U(),wl=Ts(),Cs=new _l.Logger(wl.version);function El(i){return i&&typeof i.renetwork=="function"}function ir(i){var r=function(e,t){t==null&&(t={});var n=[];if(e.InfuraProvider&&t.infura!=="-")try{n.push(new e.InfuraProvider(i,t.infura))}catch{}if(e.EtherscanProvider&&t.etherscan!=="-")try{n.push(new e.EtherscanProvider(i,t.etherscan))}catch{}if(e.AlchemyProvider&&t.alchemy!=="-")try{n.push(new e.AlchemyProvider(i,t.alchemy))}catch{}if(e.PocketProvider&&t.pocket!=="-"){var o=["goerli","ropsten","rinkeby","sepolia"];try{var s=new e.PocketProvider(i,t.pocket);s.network&&o.indexOf(s.network.name)===-1&&n.push(s)}catch{}}if(e.CloudflareProvider&&t.cloudflare!=="-")try{n.push(new e.CloudflareProvider(i))}catch{}if(e.AnkrProvider&&t.ankr!=="-")try{var o=["ropsten"],s=new e.AnkrProvider(i,t.ankr);s.network&&o.indexOf(s.network.name)===-1&&n.push(s)}catch{}if(n.length===0)return null;if(e.FallbackProvider){var c=1;return t.quorum!=null?c=t.quorum:i==="homestead"&&(c=2),new e.FallbackProvider(n,c)}return n[0]};return r.renetwork=function(e){return ir(e)},r}function ti(i,r){var e=function(t,n){return t.JsonRpcProvider?new t.JsonRpcProvider(i,r):null};return e.renetwork=function(t){return ti(i,t)},e}var Ns={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ir("homestead")},Ls={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ir("ropsten")},Bs={chainId:63,name:"classicMordor",_defaultProvider:ti("https://www.ethercluster.com/mordor","classicMordor")},ri={unspecified:{chainId:0,name:"unspecified"},homestead:Ns,mainnet:Ns,morden:{chainId:2,name:"morden"},ropsten:Ls,testnet:Ls,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ir("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ir("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ir("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ir("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:ti("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Bs,classicTestnet:Bs,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ti("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ir("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ir("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 Pl(i){if(i==null)return null;if(typeof i=="number"){for(var r in ri){var e=ri[r];if(e.chainId===i)return{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress||null,_defaultProvider:e._defaultProvider||null}}return{chainId:i,name:"unknown"}}if(typeof i=="string"){var t=ri[i];return t==null?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}var n=ri[i.name];if(!n)return typeof i.chainId!="number"&&Cs.throwArgumentError("invalid network chainId","network",i),i;i.chainId!==0&&i.chainId!==n.chainId&&Cs.throwArgumentError("network chainId mismatch","network",i);var o=i._defaultProvider||null;return o==null&&n._defaultProvider&&(El(n._defaultProvider)?o=n._defaultProvider.renetwork(i):o=n._defaultProvider),{name:i.name,chainId:n.chainId,ensAddress:i.ensAddress||n.ensAddress||null,_defaultProvider:o}}ni.getNetwork=Pl});var Is=E(ii=>{"use strict";d();h();Object.defineProperty(ii,"__esModule",{value:!0});ii.version=void 0;ii.version="web/5.7.1"});var Fs=E(Er=>{"use strict";d();h();var kl=Er&&Er.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},Sl=Er&&Er.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Er,"__esModule",{value:!0});Er.getUrl=void 0;var Ol=ee();function Rl(i,r){return kl(this,void 0,void 0,function(){var e,t,n,o,s;return Sl(this,function(c){switch(c.label){case 0:return r==null&&(r={}),e={method:r.method||"GET",headers:r.headers||{},body:r.body||void 0},r.skipFetchSetup!==!0&&(e.mode="cors",e.cache="no-cache",e.credentials="same-origin",e.redirect="follow",e.referrer="client"),r.fetchOptions!=null&&(t=r.fetchOptions,t.mode&&(e.mode=t.mode),t.cache&&(e.cache=t.cache),t.credentials&&(e.credentials=t.credentials),t.redirect&&(e.redirect=t.redirect),t.referrer&&(e.referrer=t.referrer)),[4,fetch(i,e)];case 1:return n=c.sent(),[4,n.arrayBuffer()];case 2:return o=c.sent(),s={},n.headers.forEach?n.headers.forEach(function(u,a){s[a.toLowerCase()]=u}):n.headers.keys().forEach(function(u){s[u.toLowerCase()]=n.headers.get(u)}),[2,{headers:s,statusCode:n.status,statusMessage:n.statusText,body:(0,Ol.arrayify)(new Uint8Array(o))}]}})})}Er.getUrl=Rl});var ft=E(Be=>{"use strict";d();h();var Al=Be&&Be.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},Tl=Be&&Be.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Be,"__esModule",{value:!0});Be.poll=Be.fetchJson=Be._fetchData=void 0;var js=Fo(),qs=ee(),oi=re(),Vt=dr(),or=U(),Cl=Is(),De=new or.Logger(Cl.version),Nl=Fs();function Ds(i){return new Promise(function(r){setTimeout(r,i)})}function Pr(i,r){if(i==null)return null;if(typeof i=="string")return i;if((0,qs.isBytesLike)(i)){if(r&&(r.split("/")[0]==="text"||r.split(";")[0].trim()==="application/json"))try{return(0,Vt.toUtf8String)(i)}catch{}return(0,qs.hexlify)(i)}return i}function Ll(i){return(0,Vt.toUtf8Bytes)(i.replace(/%([0-9a-f][0-9a-f])/gi,function(r,e){return String.fromCharCode(parseInt(e,16))}))}function Ms(i,r,e){var t=typeof i=="object"&&i.throttleLimit!=null?i.throttleLimit:12;De.assertArgument(t>0&&t%1===0,"invalid connection throttle limit","connection.throttleLimit",t);var n=typeof i=="object"?i.throttleCallback:null,o=typeof i=="object"&&typeof i.throttleSlotInterval=="number"?i.throttleSlotInterval:100;De.assertArgument(o>0&&o%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);var s=typeof i=="object"?!!i.errorPassThrough:!1,c={},u=null,a={method:"GET"},f=!1,l=2*60*1e3;if(typeof i=="string")u=i;else if(typeof i=="object"){if((i==null||i.url==null)&&De.throwArgumentError("missing URL","connection.url",i),u=i.url,typeof i.timeout=="number"&&i.timeout>0&&(l=i.timeout),i.headers)for(var p in i.headers)c[p.toLowerCase()]={key:p,value:String(i.headers[p])},["if-none-match","if-modified-since"].indexOf(p.toLowerCase())>=0&&(f=!0);if(a.allowGzip=!!i.allowGzip,i.user!=null&&i.password!=null){u.substring(0,6)!=="https:"&&i.allowInsecureAuthentication!==!0&&De.throwError("basic authentication requires a secure https url",or.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:i.user,password:"[REDACTED]"});var y=i.user+":"+i.password;c.authorization={key:"Authorization",value:"Basic "+(0,js.encode)((0,Vt.toUtf8Bytes)(y))}}i.skipFetchSetup!=null&&(a.skipFetchSetup=!!i.skipFetchSetup),i.fetchOptions!=null&&(a.fetchOptions=(0,oi.shallowCopy)(i.fetchOptions))}var S=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),m=u?u.match(S):null;if(m)try{var _={statusCode:200,statusMessage:"OK",headers:{"content-type":m[1]||"text/plain"},body:m[2]?(0,js.decode)(m[3]):Ll(m[3])},T=_.body;return e&&(T=e(_.body,_)),Promise.resolve(T)}catch(j){De.throwError("processing response error",or.Logger.errors.SERVER_ERROR,{body:Pr(m[1],m[2]),error:j,requestBody:null,requestMethod:"GET",url:u})}r&&(a.method="POST",a.body=r,c["content-type"]==null&&(c["content-type"]={key:"Content-Type",value:"application/octet-stream"}),c["content-length"]==null&&(c["content-length"]={key:"Content-Length",value:String(r.length)}));var L={};Object.keys(c).forEach(function(j){var B=c[j];L[B.key]=B.value}),a.headers=L;var W=function(){var j=null,B=new Promise(function(Q,k){l&&(j=setTimeout(function(){j!=null&&(j=null,k(De.makeError("timeout",or.Logger.errors.TIMEOUT,{requestBody:Pr(a.body,L["content-type"]),requestMethod:a.method,timeout:l,url:u})))},l))}),$=function(){j!=null&&(clearTimeout(j),j=null)};return{promise:B,cancel:$}}(),J=function(){return Al(this,void 0,void 0,function(){var j,B,$,he,Q,k,A,H,ae,X,he,Ue;return Tl(this,function(Y){switch(Y.label){case 0:j=0,Y.label=1;case 1:if(!(j<t))return[3,20];B=null,Y.label=2;case 2:return Y.trys.push([2,9,,10]),[4,(0,Nl.getUrl)(u,a)];case 3:return B=Y.sent(),j<t?B.statusCode===301||B.statusCode===302?($=B.headers.location||"",a.method==="GET"&&$.match(/^https:/)?(u=B.headers.location,[3,19]):[3,8]):[3,4]:[3,8];case 4:return B.statusCode!==429?[3,8]:(he=!0,n?[4,n(j,u)]:[3,6]);case 5:he=Y.sent(),Y.label=6;case 6:return he?(Q=0,k=B.headers["retry-after"],typeof k=="string"&&k.match(/^[1-9][0-9]*$/)?Q=parseInt(k)*1e3:Q=o*parseInt(String(Math.random()*Math.pow(2,j))),[4,Ds(Q)]):[3,8];case 7:return Y.sent(),[3,19];case 8:return[3,10];case 9:return A=Y.sent(),B=A.response,B==null&&(W.cancel(),De.throwError("missing response",or.Logger.errors.SERVER_ERROR,{requestBody:Pr(a.body,L["content-type"]),requestMethod:a.method,serverError:A,url:u})),[3,10];case 10:if(H=B.body,f&&B.statusCode===304?H=null:!s&&(B.statusCode<200||B.statusCode>=300)&&(W.cancel(),De.throwError("bad response",or.Logger.errors.SERVER_ERROR,{status:B.statusCode,headers:B.headers,body:Pr(H,B.headers?B.headers["content-type"]:null),requestBody:Pr(a.body,L["content-type"]),requestMethod:a.method,url:u})),!e)return[3,18];Y.label=11;case 11:return Y.trys.push([11,13,,18]),[4,e(H,B)];case 12:return ae=Y.sent(),W.cancel(),[2,ae];case 13:return X=Y.sent(),X.throttleRetry&&j<t?(he=!0,n?[4,n(j,u)]:[3,15]):[3,17];case 14:he=Y.sent(),Y.label=15;case 15:return he?(Ue=o*parseInt(String(Math.random()*Math.pow(2,j))),[4,Ds(Ue)]):[3,17];case 16:return Y.sent(),[3,19];case 17:return W.cancel(),De.throwError("processing response error",or.Logger.errors.SERVER_ERROR,{body:Pr(H,B.headers?B.headers["content-type"]:null),error:X,requestBody:Pr(a.body,L["content-type"]),requestMethod:a.method,url:u}),[3,18];case 18:return W.cancel(),[2,H];case 19:return j++,[3,1];case 20:return[2,De.throwError("failed response",or.Logger.errors.SERVER_ERROR,{requestBody:Pr(a.body,L["content-type"]),requestMethod:a.method,url:u})]}})})}();return Promise.race([W.promise,J])}Be._fetchData=Ms;function Bl(i,r,e){var t=function(c,u){var a=null;if(c!=null)try{a=JSON.parse((0,Vt.toUtf8String)(c))}catch(f){De.throwError("invalid JSON",or.Logger.errors.SERVER_ERROR,{body:c,error:f})}return e&&(a=e(a,u)),a},n=null;if(r!=null){n=(0,Vt.toUtf8Bytes)(r);var o=typeof i=="string"?{url:i}:(0,oi.shallowCopy)(i);if(o.headers){var s=Object.keys(o.headers).filter(function(c){return c.toLowerCase()==="content-type"}).length!==0;s||(o.headers=(0,oi.shallowCopy)(o.headers),o.headers["content-type"]="application/json")}else o.headers={"content-type":"application/json"};i=o}return Ms(i,n,t)}Be.fetchJson=Bl;function Il(i,r){return r||(r={}),r=(0,oi.shallowCopy)(r),r.floor==null&&(r.floor=0),r.ceiling==null&&(r.ceiling=1e4),r.interval==null&&(r.interval=250),new Promise(function(e,t){var n=null,o=!1,s=function(){return o?!1:(o=!0,n&&clearTimeout(n),!0)};r.timeout&&(n=setTimeout(function(){s()&&t(new Error("timeout"))},r.timeout));var c=r.retryLimit,u=0;function a(){return i().then(function(f){if(f!==void 0)s()&&e(f);else if(r.oncePoll)r.oncePoll.once("poll",a);else if(r.onceBlock)r.onceBlock.once("block",a);else if(!o){if(u++,u>c){s()&&t(new Error("retry limit reached"));return}var l=r.interval*parseInt(String(Math.random()*Math.pow(2,u)));l<r.floor&&(l=r.floor),l>r.ceiling&&(l=r.ceiling),setTimeout(a,l)}return null},function(f){s()&&t(f)})}a()})}Be.poll=Il});var Hs=E((ug,Gs)=>{"use strict";d();h();var si="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ho={};for(zt=0;zt<si.length;zt++){if(ai=si.charAt(zt),ho[ai]!==void 0)throw new TypeError(ai+" is ambiguous");ho[ai]=zt}var ai,zt;function lt(i){var r=i>>25;return(i&33554431)<<5^-(r>>0&1)&996825010^-(r>>1&1)&642813549^-(r>>2&1)&513874426^-(r>>3&1)&1027748829^-(r>>4&1)&705979059}function Us(i){for(var r=1,e=0;e<i.length;++e){var t=i.charCodeAt(e);if(t<33||t>126)return"Invalid prefix ("+i+")";r=lt(r)^t>>5}for(r=lt(r),e=0;e<i.length;++e){var n=i.charCodeAt(e);r=lt(r)^n&31}return r}function Fl(i,r,e){if(e=e||90,i.length+7+r.length>e)throw new TypeError("Exceeds length limit");i=i.toLowerCase();var t=Us(i);if(typeof t=="string")throw new Error(t);for(var n=i+"1",o=0;o<r.length;++o){var s=r[o];if(s>>5!==0)throw new Error("Non 5-bit word");t=lt(t)^s,n+=si.charAt(s)}for(o=0;o<6;++o)t=lt(t);for(t^=1,o=0;o<6;++o){var c=t>>(5-o)*5&31;n+=si.charAt(c)}return n}function Ws(i,r){if(r=r||90,i.length<8)return i+" too short";if(i.length>r)return"Exceeds length limit";var e=i.toLowerCase(),t=i.toUpperCase();if(i!==e&&i!==t)return"Mixed-case string "+i;i=e;var n=i.lastIndexOf("1");if(n===-1)return"No separator character for "+i;if(n===0)return"Missing prefix for "+i;var o=i.slice(0,n),s=i.slice(n+1);if(s.length<6)return"Data too short";var c=Us(o);if(typeof c=="string")return c;for(var u=[],a=0;a<s.length;++a){var f=s.charAt(a),l=ho[f];if(l===void 0)return"Unknown character "+f;c=lt(c)^l,!(a+6>=s.length)&&u.push(l)}return c!==1?"Invalid checksum for "+i:{prefix:o,words:u}}function jl(){var i=Ws.apply(null,arguments);if(typeof i=="object")return i}function ql(i){var r=Ws.apply(null,arguments);if(typeof r=="object")return r;throw new Error(r)}function ci(i,r,e,t){for(var n=0,o=0,s=(1<<e)-1,c=[],u=0;u<i.length;++u)for(n=n<<r|i[u],o+=r;o>=e;)o-=e,c.push(n>>o&s);if(t)o>0&&c.push(n<<e-o&s);else{if(o>=r)return"Excess padding";if(n<<e-o&s)return"Non-zero padding"}return c}function Dl(i){var r=ci(i,8,5,!0);if(Array.isArray(r))return r}function Ml(i){var r=ci(i,8,5,!0);if(Array.isArray(r))return r;throw new Error(r)}function Ul(i){var r=ci(i,5,8,!1);if(Array.isArray(r))return r}function Wl(i){var r=ci(i,5,8,!1);if(Array.isArray(r))return r;throw new Error(r)}Gs.exports={decodeUnsafe:jl,decode:ql,encode:Fl,toWordsUnsafe:Dl,toWords:Ml,fromWordsUnsafe:Ul,fromWords:Wl}});var ye=E(ui=>{"use strict";d();h();Object.defineProperty(ui,"__esModule",{value:!0});ui.version=void 0;ui.version="providers/5.7.2"});var kr=E(Ze=>{"use strict";d();h();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.showThrottleMessage=Ze.isCommunityResource=Ze.isCommunityResourcable=Ze.Formatter=void 0;var xo=lr(),ar=Oe(),ze=ee(),Gl=Ti(),Hl=re(),Js=Lr(),Jl=U(),Kl=ye(),Zt=new Jl.Logger(Kl.version),Vl=function(){function i(){this.formats=this.getDefaultFormats()}return i.prototype.getDefaultFormats=function(){var r=this,e={},t=this.address.bind(this),n=this.bigNumber.bind(this),o=this.blockTag.bind(this),s=this.data.bind(this),c=this.hash.bind(this),u=this.hex.bind(this),a=this.number.bind(this),f=this.type.bind(this),l=function(p){return r.data(p,!0)};return e.transaction={hash:c,type:f,accessList:i.allowNull(this.accessList.bind(this),null),blockHash:i.allowNull(c,null),blockNumber:i.allowNull(a,null),transactionIndex:i.allowNull(a,null),confirmations:i.allowNull(a,null),from:t,gasPrice:i.allowNull(n),maxPriorityFeePerGas:i.allowNull(n),maxFeePerGas:i.allowNull(n),gasLimit:n,to:i.allowNull(t,null),value:n,nonce:a,data:s,r:i.allowNull(this.uint256),s:i.allowNull(this.uint256),v:i.allowNull(a),creates:i.allowNull(t,null),raw:i.allowNull(s)},e.transactionRequest={from:i.allowNull(t),nonce:i.allowNull(a),gasLimit:i.allowNull(n),gasPrice:i.allowNull(n),maxPriorityFeePerGas:i.allowNull(n),maxFeePerGas:i.allowNull(n),to:i.allowNull(t),value:i.allowNull(n),data:i.allowNull(l),type:i.allowNull(a),accessList:i.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:c,address:t,topics:i.arrayOf(c),data:s,logIndex:a,blockHash:c},e.receipt={to:i.allowNull(this.address,null),from:i.allowNull(this.address,null),contractAddress:i.allowNull(t,null),transactionIndex:a,root:i.allowNull(u),gasUsed:n,logsBloom:i.allowNull(s),blockHash:c,transactionHash:c,logs:i.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:i.allowNull(a,null),cumulativeGasUsed:n,effectiveGasPrice:i.allowNull(n),status:i.allowNull(a),type:f},e.block={hash:i.allowNull(c),parentHash:c,number:a,timestamp:a,nonce:i.allowNull(u),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:i.allowNull(t),extraData:s,transactions:i.allowNull(i.arrayOf(c)),baseFeePerGas:i.allowNull(n)},e.blockWithTransactions=(0,Hl.shallowCopy)(e.block),e.blockWithTransactions.transactions=i.allowNull(i.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:i.allowNull(o,void 0),toBlock:i.allowNull(o,void 0),blockHash:i.allowNull(c,void 0),address:i.allowNull(t,void 0),topics:i.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:i.allowNull(a),blockHash:i.allowNull(c),transactionIndex:a,removed:i.allowNull(this.boolean.bind(this)),address:t,data:i.allowFalsish(s,"0x"),topics:i.arrayOf(c),transactionHash:c,logIndex:a},e},i.prototype.accessList=function(r){return(0,Js.accessListify)(r||[])},i.prototype.number=function(r){return r==="0x"?0:ar.BigNumber.from(r).toNumber()},i.prototype.type=function(r){return r==="0x"||r==null?0:ar.BigNumber.from(r).toNumber()},i.prototype.bigNumber=function(r){return ar.BigNumber.from(r)},i.prototype.boolean=function(r){if(typeof r=="boolean")return r;if(typeof r=="string"){if(r=r.toLowerCase(),r==="true")return!0;if(r==="false")return!1}throw new Error("invalid boolean - "+r)},i.prototype.hex=function(r,e){return typeof r=="string"&&(!e&&r.substring(0,2)!=="0x"&&(r="0x"+r),(0,ze.isHexString)(r))?r.toLowerCase():Zt.throwArgumentError("invalid hash","value",r)},i.prototype.data=function(r,e){var t=this.hex(r,e);if(t.length%2!==0)throw new Error("invalid data; odd-length - "+r);return t},i.prototype.address=function(r){return(0,xo.getAddress)(r)},i.prototype.callAddress=function(r){if(!(0,ze.isHexString)(r,32))return null;var e=(0,xo.getAddress)((0,ze.hexDataSlice)(r,12));return e===Gl.AddressZero?null:e},i.prototype.contractAddress=function(r){return(0,xo.getContractAddress)(r)},i.prototype.blockTag=function(r){if(r==null)return"latest";if(r==="earliest")return"0x0";switch(r){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return r}if(typeof r=="number"||(0,ze.isHexString)(r))return(0,ze.hexValue)(r);throw new Error("invalid blockTag")},i.prototype.hash=function(r,e){var t=this.hex(r,e);return(0,ze.hexDataLength)(t)!==32?Zt.throwArgumentError("invalid hash","value",r):t},i.prototype.difficulty=function(r){if(r==null)return null;var e=ar.BigNumber.from(r);try{return e.toNumber()}catch{}return null},i.prototype.uint256=function(r){if(!(0,ze.isHexString)(r))throw new Error("invalid uint256");return(0,ze.hexZeroPad)(r,32)},i.prototype._block=function(r,e){r.author!=null&&r.miner==null&&(r.miner=r.author);var t=r._difficulty!=null?r._difficulty:r.difficulty,n=i.check(e,r);return n._difficulty=t==null?null:ar.BigNumber.from(t),n},i.prototype.block=function(r){return this._block(r,this.formats.block)},i.prototype.blockWithTransactions=function(r){return this._block(r,this.formats.blockWithTransactions)},i.prototype.transactionRequest=function(r){return i.check(this.formats.transactionRequest,r)},i.prototype.transactionResponse=function(r){r.gas!=null&&r.gasLimit==null&&(r.gasLimit=r.gas),r.to&&ar.BigNumber.from(r.to).isZero()&&(r.to="0x0000000000000000000000000000000000000000"),r.input!=null&&r.data==null&&(r.data=r.input),r.to==null&&r.creates==null&&(r.creates=this.contractAddress(r)),(r.type===1||r.type===2)&&r.accessList==null&&(r.accessList=[]);var e=i.check(this.formats.transaction,r);if(r.chainId!=null){var t=r.chainId;(0,ze.isHexString)(t)&&(t=ar.BigNumber.from(t).toNumber()),e.chainId=t}else{var t=r.networkId;t==null&&e.v==null&&(t=r.chainId),(0,ze.isHexString)(t)&&(t=ar.BigNumber.from(t).toNumber()),typeof t!="number"&&e.v!=null&&(t=(e.v-35)/2,t<0&&(t=0),t=parseInt(t)),typeof t!="number"&&(t=0),e.chainId=t}return e.blockHash&&e.blockHash.replace(/0/g,"")==="x"&&(e.blockHash=null),e},i.prototype.transaction=function(r){return(0,Js.parse)(r)},i.prototype.receiptLog=function(r){return i.check(this.formats.receiptLog,r)},i.prototype.receipt=function(r){var e=i.check(this.formats.receipt,r);if(e.root!=null)if(e.root.length<=4){var t=ar.BigNumber.from(e.root).toNumber();t===0||t===1?(e.status!=null&&e.status!==t&&Zt.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):Zt.throwArgumentError("invalid alt-root-status","value.root",e.root)}else e.root.length!==66&&Zt.throwArgumentError("invalid root hash","value.root",e.root);return e.status!=null&&(e.byzantium=!0),e},i.prototype.topics=function(r){var e=this;return Array.isArray(r)?r.map(function(t){return e.topics(t)}):r!=null?this.hash(r,!0):null},i.prototype.filter=function(r){return i.check(this.formats.filter,r)},i.prototype.filterLog=function(r){return i.check(this.formats.filterLog,r)},i.check=function(r,e){var t={};for(var n in r)try{var o=r[n](e[n]);o!==void 0&&(t[n]=o)}catch(s){throw s.checkKey=n,s.checkValue=e[n],s}return t},i.allowNull=function(r,e){return function(t){return t==null?e:r(t)}},i.allowFalsish=function(r,e){return function(t){return t?r(t):e}},i.arrayOf=function(r){return function(e){if(!Array.isArray(e))throw new Error("not an array");var t=[];return e.forEach(function(n){t.push(r(n))}),t}},i}();Ze.Formatter=Vl;function Vs(i){return i&&typeof i.isCommunityResource=="function"}Ze.isCommunityResourcable=Vs;function zl(i){return Vs(i)&&i.isCommunityResource()}Ze.isCommunityResource=zl;var Ks=!1;function Zl(){Ks||(Ks=!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("=========================="))}Ze.showThrottleMessage=Zl});var Yt=E(Pe=>{"use strict";d();h();var $l=Pe&&Pe.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),I=Pe&&Pe.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},F=Pe&&Pe.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Xl=Pe&&Pe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.BaseProvider=Pe.Resolver=Pe.Event=void 0;var nc=tt(),Ql=Fo(),yo=Zi(),Ee=Oe(),N=ee(),Yl=Ti(),Xt=Ot(),ed=lo(),ie=re(),zs=Ut(),vo=dr(),ht=ft(),Zs=Xl(Hs()),D=U(),rd=ye(),q=new D.Logger(rd.version),$s=kr(),td=10;function Xs(i){return i==null?"null":((0,N.hexDataLength)(i)!==32&&q.throwArgumentError("invalid topic","topic",i),i.toLowerCase())}function Qs(i){for(i=i.slice();i.length>0&&i[i.length-1]==null;)i.pop();return i.map(function(r){if(Array.isArray(r)){var e={};r.forEach(function(n){e[Xs(n)]=!0});var t=Object.keys(e);return t.sort(),t.join("|")}else return Xs(r)}).join("&")}function nd(i){return i===""?[]:i.split(/&/g).map(function(r){if(r==="")return[];var e=r.split("|").map(function(t){return t==="null"?null:t});return e.length===1?e[0]:e})}function dt(i){if(typeof i=="string"){if(i=i.toLowerCase(),(0,N.hexDataLength)(i)===32)return"tx:"+i;if(i.indexOf(":")===-1)return i}else{if(Array.isArray(i))return"filter:*:"+Qs(i);if(nc.ForkEvent.isForkEvent(i))throw q.warn("not implemented"),new Error("not implemented");if(i&&typeof i=="object")return"filter:"+(i.address||"*")+":"+Qs(i.topics||[])}throw new Error("invalid event - "+i)}function $t(){return new Date().getTime()}function Ys(i){return new Promise(function(r){setTimeout(r,i)})}var id=["block","network","pending","poll"],ic=function(){function i(r,e,t){(0,ie.defineReadOnly)(this,"tag",r),(0,ie.defineReadOnly)(this,"listener",e),(0,ie.defineReadOnly)(this,"once",t),this._lastBlockNumber=-2,this._inflight=!1}return Object.defineProperty(i.prototype,"event",{get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){return this.tag.split(":")[0]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"hash",{get:function(){var r=this.tag.split(":");return r[0]!=="tx"?null:r[1]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){var r=this.tag.split(":");if(r[0]!=="filter")return null;var e=r[1],t=nd(r[2]),n={};return t.length>0&&(n.topics=t),e&&e!=="*"&&(n.address=e),n},enumerable:!1,configurable:!0}),i.prototype.pollable=function(){return this.tag.indexOf(":")>=0||id.indexOf(this.tag)>=0},i}();Pe.Event=ic;var od={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 po(i){return(0,N.hexZeroPad)(Ee.BigNumber.from(i).toHexString(),32)}function ec(i){return yo.Base58.encode((0,N.concat)([i,(0,N.hexDataSlice)((0,zs.sha256)((0,zs.sha256)(i)),0,4)]))}var oc=new RegExp("^(ipfs)://(.*)$","i"),rc=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),oc,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function fi(i,r){try{return(0,vo.toUtf8String)(Qt(i,r))}catch{}return null}function Qt(i,r){if(i==="0x")return null;var e=Ee.BigNumber.from((0,N.hexDataSlice)(i,r,r+32)).toNumber(),t=Ee.BigNumber.from((0,N.hexDataSlice)(i,e,e+32)).toNumber();return(0,N.hexDataSlice)(i,e+32,e+32+t)}function bo(i){return i.match(/^ipfs:\/\/ipfs\//i)?i=i.substring(12):i.match(/^ipfs:\/\//i)?i=i.substring(7):q.throwArgumentError("unsupported IPFS format","link",i),"https://gateway.ipfs.io/ipfs/"+i}function tc(i){var r=(0,N.arrayify)(i);if(r.length>32)throw new Error("internal; should not happen");var e=new Uint8Array(32);return e.set(r,32-r.length),e}function ad(i){if(i.length%32===0)return i;var r=new Uint8Array(Math.ceil(i.length/32)*32);return r.set(i),r}function ac(i){for(var r=[],e=0,t=0;t<i.length;t++)r.push(null),e+=32;for(var t=0;t<i.length;t++){var n=(0,N.arrayify)(i[t]);r[t]=tc(e),r.push(tc(n.length)),r.push(ad(n)),e+=32+Math.ceil(n.length/32)*32}return(0,N.hexConcat)(r)}var mo=function(){function i(r,e,t,n){(0,ie.defineReadOnly)(this,"provider",r),(0,ie.defineReadOnly)(this,"name",t),(0,ie.defineReadOnly)(this,"address",r.formatter.address(e)),(0,ie.defineReadOnly)(this,"_resolvedAddress",n)}return i.prototype.supportsWildcard=function(){var r=this;return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(function(e){return Ee.BigNumber.from(e).eq(1)}).catch(function(e){if(e.code===D.Logger.errors.CALL_EXCEPTION)return!1;throw r._supportsEip2544=null,e})),this._supportsEip2544},i.prototype._fetch=function(r,e){return I(this,void 0,void 0,function(){var t,n,o,s;return F(this,function(c){switch(c.label){case 0:return t={to:this.address,ccipReadEnabled:!0,data:(0,N.hexConcat)([r,(0,Xt.namehash)(this.name),e||"0x"])},n=!1,[4,this.supportsWildcard()];case 1:c.sent()&&(n=!0,t.data=(0,N.hexConcat)(["0x9061b923",ac([(0,Xt.dnsEncode)(this.name),t.data])])),c.label=2;case 2:return c.trys.push([2,4,,5]),[4,this.provider.call(t)];case 3:return o=c.sent(),(0,N.arrayify)(o).length%32===4&&q.throwError("resolver threw error",D.Logger.errors.CALL_EXCEPTION,{transaction:t,data:o}),n&&(o=Qt(o,0)),[2,o];case 4:if(s=c.sent(),s.code===D.Logger.errors.CALL_EXCEPTION)return[2,null];throw s;case 5:return[2]}})})},i.prototype._fetchBytes=function(r,e){return I(this,void 0,void 0,function(){var t;return F(this,function(n){switch(n.label){case 0:return[4,this._fetch(r,e)];case 1:return t=n.sent(),t!=null?[2,Qt(t,0)]:[2,null]}})})},i.prototype._getAddress=function(r,e){var t=od[String(r)];if(t==null&&q.throwError("unsupported coin type: "+r,D.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress("+r+")"}),t.ilk==="eth")return this.provider.formatter.address(e);var n=(0,N.arrayify)(e);if(t.p2pkh!=null){var o=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){var s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return ec((0,N.concat)([[t.p2pkh],"0x"+o[2]]))}}if(t.p2sh!=null){var c=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(c){var u=parseInt(c[1],16);if(c[2].length===u*2&&u>=1&&u<=75)return ec((0,N.concat)([[t.p2sh],"0x"+c[2]]))}}if(t.prefix!=null){var a=n[1],f=n[0];if(f===0?a!==20&&a!==32&&(f=-1):f=-1,f>=0&&n.length===2+a&&a>=1&&a<=75){var l=Zs.default.toWords(n.slice(2));return l.unshift(f),Zs.default.encode(t.prefix,l)}}return null},i.prototype.getAddress=function(r){return I(this,void 0,void 0,function(){var e,t,n,o;return F(this,function(s){switch(s.label){case 0:if(r==null&&(r=60),r!==60)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._fetch("0x3b3b57de")];case 2:return e=s.sent(),e==="0x"||e===Yl.HashZero?[2,null]:[2,this.provider.formatter.callAddress(e)];case 3:if(t=s.sent(),t.code===D.Logger.errors.CALL_EXCEPTION)return[2,null];throw t;case 4:return[4,this._fetchBytes("0xf1cb7e06",po(r))];case 5:return n=s.sent(),n==null||n==="0x"?[2,null]:(o=this._getAddress(r,n),o==null&&q.throwError("invalid or unsupported coin data",D.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress("+r+")",coinType:r,data:n}),[2,o])}})})},i.prototype.getAvatar=function(){return I(this,void 0,void 0,function(){var r,e,t,n,o,s,c,u,a,f,l,p,y,S,m,_,T,L,W,J,j,B,$,Q,k;return F(this,function(A){switch(A.label){case 0:r=[{type:"name",content:this.name}],A.label=1;case 1:return A.trys.push([1,19,,20]),[4,this.getText("avatar")];case 2:if(e=A.sent(),e==null)return[2,null];t=0,A.label=3;case 3:if(!(t<rc.length))return[3,18];if(n=e.match(rc[t]),n==null)return[3,17];switch(o=n[1].toLowerCase(),s=o,s){case"https":return[3,4];case"data":return[3,5];case"ipfs":return[3,6];case"erc721":return[3,7];case"erc1155":return[3,7]}return[3,17];case 4:return r.push({type:"url",content:e}),[2,{linkage:r,url:e}];case 5:return r.push({type:"data",content:e}),[2,{linkage:r,url:e}];case 6:return r.push({type:"ipfs",content:e}),[2,{linkage:r,url:bo(e)}];case 7:return c=o==="erc721"?"0xc87b56dd":"0x0e89341c",r.push({type:o,content:e}),a=this._resolvedAddress,a?[3,9]:[4,this.getAddress()];case 8:a=A.sent(),A.label=9;case 9:return u=a,f=(n[2]||"").split("/"),f.length!==2?[2,null]:[4,this.provider.formatter.address(f[0])];case 10:return l=A.sent(),p=(0,N.hexZeroPad)(Ee.BigNumber.from(f[1]).toHexString(),32),o!=="erc721"?[3,12]:(m=(S=this.provider.formatter).callAddress,[4,this.provider.call({to:l,data:(0,N.hexConcat)(["0x6352211e",p])})]);case 11:return y=m.apply(S,[A.sent()]),u!==y?[2,null]:(r.push({type:"owner",content:y}),[3,14]);case 12:return o!=="erc1155"?[3,14]:(L=(T=Ee.BigNumber).from,[4,this.provider.call({to:l,data:(0,N.hexConcat)(["0x00fdd58e",(0,N.hexZeroPad)(u,32),p])})]);case 13:if(_=L.apply(T,[A.sent()]),_.isZero())return[2,null];r.push({type:"balance",content:_.toString()}),A.label=14;case 14:return W={to:this.provider.formatter.address(f[0]),data:(0,N.hexConcat)([c,p])},j=fi,[4,this.provider.call(W)];case 15:return J=j.apply(void 0,[A.sent(),0]),J==null?[2,null]:(r.push({type:"metadata-url-base",content:J}),o==="erc1155"&&(J=J.replace("{id}",p.substring(2)),r.push({type:"metadata-url-expanded",content:J})),J.match(/^ipfs:/i)&&(J=bo(J)),r.push({type:"metadata-url",content:J}),[4,(0,ht.fetchJson)(J)]);case 16:if(B=A.sent(),!B)return[2,null];if(r.push({type:"metadata",content:JSON.stringify(B)}),$=B.image,typeof $!="string")return[2,null];if(!$.match(/^(https:\/\/|data:)/i)){if(Q=$.match(oc),Q==null)return[2,null];r.push({type:"url-ipfs",content:$}),$=bo($)}return r.push({type:"url",content:$}),[2,{linkage:r,url:$}];case 17:return t++,[3,3];case 18:return[3,20];case 19:return k=A.sent(),[3,20];case 20:return[2,null]}})})},i.prototype.getContentHash=function(){return I(this,void 0,void 0,function(){var r,e,t,n,o,s,c,u,a;return F(this,function(f){switch(f.label){case 0:return[4,this._fetchBytes("0xbc1c58d1")];case 1:return r=f.sent(),r==null||r==="0x"?[2,null]:(e=r.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/),e&&(t=parseInt(e[3],16),e[4].length===t*2)?[2,"ipfs://"+yo.Base58.encode("0x"+e[1])]:(n=r.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/),n&&(o=parseInt(n[3],16),n[4].length===o*2)?[2,"ipns://"+yo.Base58.encode("0x"+n[1])]:(s=r.match(/^0xe40101fa011b20([0-9a-f]*)$/),s&&s[1].length===32*2?[2,"bzz://"+s[1]]:(c=r.match(/^0x90b2c605([0-9a-f]*)$/),c&&c[1].length===34*2?(u={"=":"","+":"-","/":"_"},a=(0,Ql.encode)("0x"+c[1]).replace(/[=+\/]/g,function(l){return u[l]}),[2,"sia://"+a]):[2,q.throwError("invalid or unsupported content hash data",D.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:r})]))))}})})},i.prototype.getText=function(r){return I(this,void 0,void 0,function(){var e,t;return F(this,function(n){switch(n.label){case 0:return e=(0,vo.toUtf8Bytes)(r),e=(0,N.concat)([po(64),po(e.length),e]),e.length%32!==0&&(e=(0,N.concat)([e,(0,N.hexZeroPad)("0x",32-r.length%32)])),[4,this._fetchBytes("0x59d1d43c",(0,N.hexlify)(e))];case 1:return t=n.sent(),t==null||t==="0x"?[2,null]:[2,(0,vo.toUtf8String)(t)]}})})},i}();Pe.Resolver=mo;var go=null,sd=1,cd=function(i){$l(r,i);function r(e){var t=this.constructor,n=i.call(this)||this;if(n._events=[],n._emitted={block:-2},n.disableCcipRead=!1,n.formatter=t.getFormatter(),(0,ie.defineReadOnly)(n,"anyNetwork",e==="any"),n.anyNetwork&&(e=n.detectNetwork()),e instanceof Promise)n._networkPromise=e,e.catch(function(s){}),n._ready().catch(function(s){});else{var o=(0,ie.getStatic)(t,"getNetwork")(e);o?((0,ie.defineReadOnly)(n,"_network",o),n.emit("network",o,null)):q.throwArgumentError("invalid network","network",e)}return n._maxInternalBlockNumber=-1024,n._lastBlockNumber=-2,n._maxFilterBlockRange=10,n._pollingInterval=4e3,n._fastQueryDate=0,n}return r.prototype._ready=function(){return I(this,void 0,void 0,function(){var e,t;return F(this,function(n){switch(n.label){case 0:if(this._network!=null)return[3,7];if(e=null,!this._networkPromise)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._networkPromise];case 2:return e=n.sent(),[3,4];case 3:return t=n.sent(),[3,4];case 4:return e!=null?[3,6]:[4,this.detectNetwork()];case 5:e=n.sent(),n.label=6;case 6:e||q.throwError("no network detected",D.Logger.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:(0,ie.defineReadOnly)(this,"_network",e),this.emit("network",e,null)),n.label=7;case 7:return[2,this._network]}})})},Object.defineProperty(r.prototype,"ready",{get:function(){var e=this;return(0,ht.poll)(function(){return e._ready().then(function(t){return t},function(t){if(!(t.code===D.Logger.errors.NETWORK_ERROR&&t.event==="noNetwork"))throw t})})},enumerable:!1,configurable:!0}),r.getFormatter=function(){return go==null&&(go=new $s.Formatter),go},r.getNetwork=function(e){return(0,ed.getNetwork)(e??"homestead")},r.prototype.ccipReadFetch=function(e,t,n){return I(this,void 0,void 0,function(){var o,s,c,u,a,f,l,p,y;return F(this,function(S){switch(S.label){case 0:if(this.disableCcipRead||n.length===0)return[2,null];o=e.to.toLowerCase(),s=t.toLowerCase(),c=[],u=0,S.label=1;case 1:return u<n.length?(a=n[u],f=a.replace("{sender}",o).replace("{data}",s),l=a.indexOf("{data}")>=0?null:JSON.stringify({data:s,sender:o}),[4,(0,ht.fetchJson)({url:f,errorPassThrough:!0},l,function(m,_){return m.status=_.statusCode,m})]):[3,4];case 2:if(p=S.sent(),p.data)return[2,p.data];if(y=p.message||"unknown error",p.status>=400&&p.status<500)return[2,q.throwError("response not found during CCIP fetch: "+y,D.Logger.errors.SERVER_ERROR,{url:a,errorMessage:y})];c.push(y),S.label=3;case 3:return u++,[3,1];case 4:return[2,q.throwError("error encountered during CCIP fetch: "+c.map(function(m){return JSON.stringify(m)}).join(", "),D.Logger.errors.SERVER_ERROR,{urls:n,errorMessages:c})]}})})},r.prototype._getInternalBlockNumber=function(e){return I(this,void 0,void 0,function(){var t,n,o,s,c,u=this;return F(this,function(a){switch(a.label){case 0:return[4,this._ready()];case 1:if(a.sent(),!(e>0))return[3,7];a.label=2;case 2:if(!this._internalBlockNumber)return[3,7];t=this._internalBlockNumber,a.label=3;case 3:return a.trys.push([3,5,,6]),[4,t];case 4:return n=a.sent(),$t()-n.respTime<=e?[2,n.blockNumber]:[3,7];case 5:return o=a.sent(),this._internalBlockNumber===t?[3,7]:[3,6];case 6:return[3,2];case 7:return s=$t(),c=(0,ie.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(function(f){return null},function(f){return f})}).then(function(f){var l=f.blockNumber,p=f.networkError;if(p)throw u._internalBlockNumber===c&&(u._internalBlockNumber=null),p;var y=$t();return l=Ee.BigNumber.from(l).toNumber(),l<u._maxInternalBlockNumber&&(l=u._maxInternalBlockNumber),u._maxInternalBlockNumber=l,u._setFastBlockNumber(l),{blockNumber:l,reqTime:s,respTime:y}}),this._internalBlockNumber=c,c.catch(function(f){u._internalBlockNumber===c&&(u._internalBlockNumber=null)}),[4,c];case 8:return[2,a.sent().blockNumber]}})})},r.prototype.poll=function(){return I(this,void 0,void 0,function(){var e,t,n,o,s,c=this;return F(this,function(u){switch(u.label){case 0:e=sd++,t=[],n=null,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getInternalBlockNumber(100+this.pollingInterval/2)];case 2:return n=u.sent(),[3,4];case 3:return o=u.sent(),this.emit("error",o),[2];case 4:if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber)return this.emit("didPoll",e),[2];if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)q.warn("network block skew detected; skipping block events (emitted="+this._emitted.block+" blockNumber"+n+")"),this.emit("error",q.makeError("network block skew detected",D.Logger.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(s=this._emitted.block+1;s<=n;s++)this.emit("block",s);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(function(a){if(a!=="block"){var f=c._emitted[a];f!=="pending"&&n-f>12&&delete c._emitted[a]}})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(function(a){switch(a.type){case"tx":{var f=a.hash,l=c.getTransactionReceipt(f).then(function(S){return!S||S.blockNumber==null||(c._emitted["t:"+f]=S.blockNumber,c.emit(f,S)),null}).catch(function(S){c.emit("error",S)});t.push(l);break}case"filter":{if(!a._inflight){a._inflight=!0,a._lastBlockNumber===-2&&(a._lastBlockNumber=n-1);var p=a.filter;p.fromBlock=a._lastBlockNumber+1,p.toBlock=n;var y=p.toBlock-c._maxFilterBlockRange;y>p.fromBlock&&(p.fromBlock=y),p.fromBlock<0&&(p.fromBlock=0);var l=c.getLogs(p).then(function(m){a._inflight=!1,m.length!==0&&m.forEach(function(_){_.blockNumber>a._lastBlockNumber&&(a._lastBlockNumber=_.blockNumber),c._emitted["b:"+_.blockHash]=_.blockNumber,c._emitted["t:"+_.transactionHash]=_.blockNumber,c.emit(p,_)})}).catch(function(m){c.emit("error",m),a._inflight=!1});t.push(l)}break}}}),this._lastBlockNumber=n,Promise.all(t).then(function(){c.emit("didPoll",e)}).catch(function(a){c.emit("error",a)}),[2]}})})},r.prototype.resetEventsBlock=function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()},Object.defineProperty(r.prototype,"network",{get:function(){return this._network},enumerable:!1,configurable:!0}),r.prototype.detectNetwork=function(){return I(this,void 0,void 0,function(){return F(this,function(e){return[2,q.throwError("provider does not support network detection",D.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})]})})},r.prototype.getNetwork=function(){return I(this,void 0,void 0,function(){var e,t,n;return F(this,function(o){switch(o.label){case 0:return[4,this._ready()];case 1:return e=o.sent(),[4,this.detectNetwork()];case 2:return t=o.sent(),e.chainId===t.chainId?[3,5]:this.anyNetwork?(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),[4,Ys(0)]):[3,4];case 3:return o.sent(),[2,this._network];case 4:throw n=q.makeError("underlying network changed",D.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t}),this.emit("error",n),n;case 5:return[2,e]}})})},Object.defineProperty(r.prototype,"blockNumber",{get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then(function(t){e._setFastBlockNumber(t)},function(t){}),this._fastBlockNumber!=null?this._fastBlockNumber:-1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"polling",{get:function(){return this._poller!=null},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval(function(){t.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(function(){t.poll(),t._bootstrapPoll=setTimeout(function(){t._poller||t.poll(),t._bootstrapPoll=null},t.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"pollingInterval",{get:function(){return this._pollingInterval},set:function(e){var t=this;if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(function(){t.poll()},this._pollingInterval))},enumerable:!1,configurable:!0}),r.prototype._getFastBlockNumber=function(){var e=this,t=$t();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then(function(n){return(e._fastBlockNumber==null||n>e._fastBlockNumber)&&(e._fastBlockNumber=n),e._fastBlockNumber})),this._fastBlockNumberPromise},r.prototype._setFastBlockNumber=function(e){this._fastBlockNumber!=null&&e<this._fastBlockNumber||(this._fastQueryDate=$t(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))},r.prototype.waitForTransaction=function(e,t,n){return I(this,void 0,void 0,function(){return F(this,function(o){return[2,this._waitForTransaction(e,t??1,n||0,null)]})})},r.prototype._waitForTransaction=function(e,t,n,o){return I(this,void 0,void 0,function(){var s,c=this;return F(this,function(u){switch(u.label){case 0:return[4,this.getTransactionReceipt(e)];case 1:return s=u.sent(),(s?s.confirmations:0)>=t?[2,s]:[2,new Promise(function(a,f){var l=[],p=!1,y=function(){return p?!0:(p=!0,l.forEach(function(W){W()}),!1)},S=function(W){W.confirmations<t||y()||a(W)};if(c.on(e,S),l.push(function(){c.removeListener(e,S)}),o){var m=o.startBlock,_=null,T=function(W){return I(c,void 0,void 0,function(){var J=this;return F(this,function(j){switch(j.label){case 0:return p?[2]:[4,Ys(1e3)];case 1:return j.sent(),this.getTransactionCount(o.from).then(function(B){return I(J,void 0,void 0,function(){var $,Q,k,A,H,ae;return F(this,function(X){switch(X.label){case 0:return p?[2]:B<=o.nonce?(m=W,[3,9]):[3,1];case 1:return[4,this.getTransaction(e)];case 2:if($=X.sent(),$&&$.blockNumber!=null)return[2];_==null&&(_=m-3,_<o.startBlock&&(_=o.startBlock)),X.label=3;case 3:return _<=W?p?[2]:[4,this.getBlockWithTransactions(_)]:[3,9];case 4:Q=X.sent(),k=0,X.label=5;case 5:return k<Q.transactions.length?(A=Q.transactions[k],A.hash===e?[2]:A.from===o.from&&A.nonce===o.nonce?p?[2]:[4,this.waitForTransaction(A.hash,t)]:[3,7]):[3,8];case 6:return H=X.sent(),y()?[2]:(ae="replaced",A.data===o.data&&A.to===o.to&&A.value.eq(o.value)?ae="repriced":A.data==="0x"&&A.from===A.to&&A.value.isZero()&&(ae="cancelled"),f(q.makeError("transaction was replaced",D.Logger.errors.TRANSACTION_REPLACED,{cancelled:ae==="replaced"||ae==="cancelled",reason:ae,replacement:this._wrapTransaction(A),hash:e,receipt:H})),[2]);case 7:return k++,[3,5];case 8:return _++,[3,3];case 9:return p?[2]:(this.once("block",T),[2])}})})},function(B){p||J.once("block",T)}),[2]}})})};if(p)return;c.once("block",T),l.push(function(){c.removeListener("block",T)})}if(typeof n=="number"&&n>0){var L=setTimeout(function(){y()||f(q.makeError("timeout exceeded",D.Logger.errors.TIMEOUT,{timeout:n}))},n);L.unref&&L.unref(),l.push(function(){clearTimeout(L)})}})]}})})},r.prototype.getBlockNumber=function(){return I(this,void 0,void 0,function(){return F(this,function(e){return[2,this._getInternalBlockNumber(0)]})})},r.prototype.getGasPrice=function(){return I(this,void 0,void 0,function(){var e;return F(this,function(t){switch(t.label){case 0:return[4,this.getNetwork()];case 1:return t.sent(),[4,this.perform("getGasPrice",{})];case 2:e=t.sent();try{return[2,Ee.BigNumber.from(e)]}catch(n){return[2,q.throwError("bad result from backend",D.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:n})]}return[2]}})})},r.prototype.getBalance=function(e,t){return I(this,void 0,void 0,function(){var n,o;return F(this,function(s){switch(s.label){case 0:return[4,this.getNetwork()];case 1:return s.sent(),[4,(0,ie.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)})];case 2:return n=s.sent(),[4,this.perform("getBalance",n)];case 3:o=s.sent();try{return[2,Ee.BigNumber.from(o)]}catch(c){return[2,q.throwError("bad result from backend",D.Logger.errors.SERVER_ERROR,{method:"getBalance",params:n,result:o,error:c})]}return[2]}})})},r.prototype.getTransactionCount=function(e,t){return I(this,void 0,void 0,function(){var n,o;return F(this,function(s){switch(s.label){case 0:return[4,this.getNetwork()];case 1:return s.sent(),[4,(0,ie.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)})];case 2:return n=s.sent(),[4,this.perform("getTransactionCount",n)];case 3:o=s.sent();try{return[2,Ee.BigNumber.from(o).toNumber()]}catch(c){return[2,q.throwError("bad result from backend",D.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:o,error:c})]}return[2]}})})},r.prototype.getCode=function(e,t){return I(this,void 0,void 0,function(){var n,o;return F(this,function(s){switch(s.label){case 0:return[4,this.getNetwork()];case 1:return s.sent(),[4,(0,ie.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)})];case 2:return n=s.sent(),[4,this.perform("getCode",n)];case 3:o=s.sent();try{return[2,(0,N.hexlify)(o)]}catch(c){return[2,q.throwError("bad result from backend",D.Logger.errors.SERVER_ERROR,{method:"getCode",params:n,result:o,error:c})]}return[2]}})})},r.prototype.getStorageAt=function(e,t,n){return I(this,void 0,void 0,function(){var o,s;return F(this,function(c){switch(c.label){case 0:return[4,this.getNetwork()];case 1:return c.sent(),[4,(0,ie.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then(function(u){return(0,N.hexValue)(u)})})];case 2:return o=c.sent(),[4,this.perform("getStorageAt",o)];case 3:s=c.sent();try{return[2,(0,N.hexlify)(s)]}catch(u){return[2,q.throwError("bad result from backend",D.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:o,result:s,error:u})]}return[2]}})})},r.prototype._wrapTransaction=function(e,t,n){var o=this;if(t!=null&&(0,N.hexDataLength)(t)!==32)throw new Error("invalid response - sendTransaction");var s=e;return t!=null&&e.hash!==t&&q.throwError("Transaction hash mismatch from Provider.sendTransaction.",D.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),s.wait=function(c,u){return I(o,void 0,void 0,function(){var a,f;return F(this,function(l){switch(l.label){case 0:return c==null&&(c=1),u==null&&(u=0),a=void 0,c!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n}),[4,this._waitForTransaction(e.hash,c,u,a)];case 1:return f=l.sent(),f==null&&c===0?[2,null]:(this._emitted["t:"+e.hash]=f.blockNumber,f.status===0&&q.throwError("transaction failed",D.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:f}),[2,f])}})})},s},r.prototype.sendTransaction=function(e){return I(this,void 0,void 0,function(){var t,n,o,s,c;return F(this,function(u){switch(u.label){case 0:return[4,this.getNetwork()];case 1:return u.sent(),[4,Promise.resolve(e).then(function(a){return(0,N.hexlify)(a)})];case 2:return t=u.sent(),n=this.formatter.transaction(e),n.confirmations==null&&(n.confirmations=0),[4,this._getInternalBlockNumber(100+2*this.pollingInterval)];case 3:o=u.sent(),u.label=4;case 4:return u.trys.push([4,6,,7]),[4,this.perform("sendTransaction",{signedTransaction:t})];case 5:return s=u.sent(),[2,this._wrapTransaction(n,s,o)];case 6:throw c=u.sent(),c.transaction=n,c.transactionHash=n.hash,c;case 7:return[2]}})})},r.prototype._getTransactionRequest=function(e){return I(this,void 0,void 0,function(){var t,n,o,s,c=this;return F(this,function(u){switch(u.label){case 0:return[4,e];case 1:return t=u.sent(),n={},["from","to"].forEach(function(a){t[a]!=null&&(n[a]=Promise.resolve(t[a]).then(function(f){return f?c._getAddress(f):null}))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(function(a){t[a]!=null&&(n[a]=Promise.resolve(t[a]).then(function(f){return f?Ee.BigNumber.from(f):null}))}),["type"].forEach(function(a){t[a]!=null&&(n[a]=Promise.resolve(t[a]).then(function(f){return f??null}))}),t.accessList&&(n.accessList=this.formatter.accessList(t.accessList)),["data"].forEach(function(a){t[a]!=null&&(n[a]=Promise.resolve(t[a]).then(function(f){return f?(0,N.hexlify)(f):null}))}),s=(o=this.formatter).transactionRequest,[4,(0,ie.resolveProperties)(n)];case 2:return[2,s.apply(o,[u.sent()])]}})})},r.prototype._getFilter=function(e){return I(this,void 0,void 0,function(){var t,n,o,s=this;return F(this,function(c){switch(c.label){case 0:return[4,e];case 1:return e=c.sent(),t={},e.address!=null&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach(function(u){e[u]!=null&&(t[u]=e[u])}),["fromBlock","toBlock"].forEach(function(u){e[u]!=null&&(t[u]=s._getBlockTag(e[u]))}),o=(n=this.formatter).filter,[4,(0,ie.resolveProperties)(t)];case 2:return[2,o.apply(n,[c.sent()])]}})})},r.prototype._call=function(e,t,n){return I(this,void 0,void 0,function(){var o,s,c,u,a,f,l,p,y,S,m,_,T,L,W,J;return F(this,function(j){switch(j.label){case 0:return n>=td&&q.throwError("CCIP read exceeded maximum redirections",D.Logger.errors.SERVER_ERROR,{redirects:n,transaction:e}),o=e.to,[4,this.perform("call",{transaction:e,blockTag:t})];case 1:if(s=j.sent(),!(n>=0&&t==="latest"&&o!=null&&s.substring(0,10)==="0x556f1830"&&(0,N.hexDataLength)(s)%32===4))return[3,5];j.label=2;case 2:for(j.trys.push([2,4,,5]),c=(0,N.hexDataSlice)(s,4),u=(0,N.hexDataSlice)(c,0,32),Ee.BigNumber.from(u).eq(o)||q.throwError("CCIP Read sender did not match",D.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s}),a=[],f=Ee.BigNumber.from((0,N.hexDataSlice)(c,32,64)).toNumber(),l=Ee.BigNumber.from((0,N.hexDataSlice)(c,f,f+32)).toNumber(),p=(0,N.hexDataSlice)(c,f+32),y=0;y<l;y++)S=fi(p,y*32),S==null&&q.throwError("CCIP Read contained corrupt URL string",D.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s}),a.push(S);return m=Qt(c,64),Ee.BigNumber.from((0,N.hexDataSlice)(c,100,128)).isZero()||q.throwError("CCIP Read callback selector included junk",D.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s}),_=(0,N.hexDataSlice)(c,96,100),T=Qt(c,128),[4,this.ccipReadFetch(e,m,a)];case 3:return L=j.sent(),L==null&&q.throwError("CCIP Read disabled or provided no URLs",D.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s}),W={to:o,data:(0,N.hexConcat)([_,ac([L,T])])},[2,this._call(W,t,n+1)];case 4:if(J=j.sent(),J.code===D.Logger.errors.SERVER_ERROR)throw J;return[3,5];case 5:try{return[2,(0,N.hexlify)(s)]}catch(B){return[2,q.throwError("bad result from backend",D.Logger.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:s,error:B})]}return[2]}})})},r.prototype.call=function(e,t){return I(this,void 0,void 0,function(){var n;return F(this,function(o){switch(o.label){case 0:return[4,this.getNetwork()];case 1:return o.sent(),[4,(0,ie.resolveProperties)({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)})];case 2:return n=o.sent(),[2,this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)]}})})},r.prototype.estimateGas=function(e){return I(this,void 0,void 0,function(){var t,n;return F(this,function(o){switch(o.label){case 0:return[4,this.getNetwork()];case 1:return o.sent(),[4,(0,ie.resolveProperties)({transaction:this._getTransactionRequest(e)})];case 2:return t=o.sent(),[4,this.perform("estimateGas",t)];case 3:n=o.sent();try{return[2,Ee.BigNumber.from(n)]}catch(s){return[2,q.throwError("bad result from backend",D.Logger.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:n,error:s})]}return[2]}})})},r.prototype._getAddress=function(e){return I(this,void 0,void 0,function(){var t;return F(this,function(n){switch(n.label){case 0:return[4,e];case 1:return e=n.sent(),typeof e!="string"&&q.throwArgumentError("invalid address or ENS name","name",e),[4,this.resolveName(e)];case 2:return t=n.sent(),t==null&&q.throwError("ENS name not configured",D.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName("+JSON.stringify(e)+")"}),[2,t]}})})},r.prototype._getBlock=function(e,t){return I(this,void 0,void 0,function(){var n,o,s,c,u=this;return F(this,function(a){switch(a.label){case 0:return[4,this.getNetwork()];case 1:return a.sent(),[4,e];case 2:return e=a.sent(),n=-128,o={includeTransactions:!!t},(0,N.isHexString)(e,32)?(o.blockHash=e,[3,6]):[3,3];case 3:return a.trys.push([3,5,,6]),s=o,[4,this._getBlockTag(e)];case 4:return s.blockTag=a.sent(),(0,N.isHexString)(o.blockTag)&&(n=parseInt(o.blockTag.substring(2),16)),[3,6];case 5:return c=a.sent(),q.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e),[3,6];case 6:return[2,(0,ht.poll)(function(){return I(u,void 0,void 0,function(){var f,l,p,y,S,m,_=this;return F(this,function(T){switch(T.label){case 0:return[4,this.perform("getBlock",o)];case 1:if(f=T.sent(),f==null)return o.blockHash!=null&&this._emitted["b:"+o.blockHash]==null?[2,null]:o.blockTag!=null&&n>this._emitted.block?[2,null]:[2,void 0];if(!t)return[3,8];l=null,p=0,T.label=2;case 2:return p<f.transactions.length?(y=f.transactions[p],y.blockNumber!=null?[3,3]:(y.confirmations=0,[3,6])):[3,7];case 3:return y.confirmations!=null?[3,6]:l!=null?[3,5]:[4,this._getInternalBlockNumber(100+2*this.pollingInterval)];case 4:l=T.sent(),T.label=5;case 5:S=l-y.blockNumber+1,S<=0&&(S=1),y.confirmations=S,T.label=6;case 6:return p++,[3,2];case 7:return m=this.formatter.blockWithTransactions(f),m.transactions=m.transactions.map(function(L){return _._wrapTransaction(L)}),[2,m];case 8:return[2,this.formatter.block(f)]}})})},{oncePoll:this})]}})})},r.prototype.getBlock=function(e){return this._getBlock(e,!1)},r.prototype.getBlockWithTransactions=function(e){return this._getBlock(e,!0)},r.prototype.getTransaction=function(e){return I(this,void 0,void 0,function(){var t,n=this;return F(this,function(o){switch(o.label){case 0:return[4,this.getNetwork()];case 1:return o.sent(),[4,e];case 2:return e=o.sent(),t={transactionHash:this.formatter.hash(e,!0)},[2,(0,ht.poll)(function(){return I(n,void 0,void 0,function(){var s,c,u,a;return F(this,function(f){switch(f.label){case 0:return[4,this.perform("getTransaction",t)];case 1:return s=f.sent(),s==null?this._emitted["t:"+e]==null?[2,null]:[2,void 0]:(c=this.formatter.transactionResponse(s),c.blockNumber!=null?[3,2]:(c.confirmations=0,[3,4]));case 2:return c.confirmations!=null?[3,4]:[4,this._getInternalBlockNumber(100+2*this.pollingInterval)];case 3:u=f.sent(),a=u-c.blockNumber+1,a<=0&&(a=1),c.confirmations=a,f.label=4;case 4:return[2,this._wrapTransaction(c)]}})})},{oncePoll:this})]}})})},r.prototype.getTransactionReceipt=function(e){return I(this,void 0,void 0,function(){var t,n=this;return F(this,function(o){switch(o.label){case 0:return[4,this.getNetwork()];case 1:return o.sent(),[4,e];case 2:return e=o.sent(),t={transactionHash:this.formatter.hash(e,!0)},[2,(0,ht.poll)(function(){return I(n,void 0,void 0,function(){var s,c,u,a;return F(this,function(f){switch(f.label){case 0:return[4,this.perform("getTransactionReceipt",t)];case 1:return s=f.sent(),s==null?this._emitted["t:"+e]==null?[2,null]:[2,void 0]:s.blockHash==null?[2,void 0]:(c=this.formatter.receipt(s),c.blockNumber!=null?[3,2]:(c.confirmations=0,[3,4]));case 2:return c.confirmations!=null?[3,4]:[4,this._getInternalBlockNumber(100+2*this.pollingInterval)];case 3:u=f.sent(),a=u-c.blockNumber+1,a<=0&&(a=1),c.confirmations=a,f.label=4;case 4:return[2,c]}})})},{oncePoll:this})]}})})},r.prototype.getLogs=function(e){return I(this,void 0,void 0,function(){var t,n;return F(this,function(o){switch(o.label){case 0:return[4,this.getNetwork()];case 1:return o.sent(),[4,(0,ie.resolveProperties)({filter:this._getFilter(e)})];case 2:return t=o.sent(),[4,this.perform("getLogs",t)];case 3:return n=o.sent(),n.forEach(function(s){s.removed==null&&(s.removed=!1)}),[2,$s.Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)]}})})},r.prototype.getEtherPrice=function(){return I(this,void 0,void 0,function(){return F(this,function(e){switch(e.label){case 0:return[4,this.getNetwork()];case 1:return e.sent(),[2,this.perform("getEtherPrice",{})]}})})},r.prototype._getBlockTag=function(e){return I(this,void 0,void 0,function(){var t;return F(this,function(n){switch(n.label){case 0:return[4,e];case 1:return e=n.sent(),typeof e=="number"&&e<0?(e%1&&q.throwArgumentError("invalid BlockTag","blockTag",e),[4,this._getInternalBlockNumber(100+2*this.pollingInterval)]):[3,3];case 2:return t=n.sent(),t+=e,t<0&&(t=0),[2,this.formatter.blockTag(t)];case 3:return[2,this.formatter.blockTag(e)]}})})},r.prototype.getResolver=function(e){return I(this,void 0,void 0,function(){var t,n,o,s;return F(this,function(c){switch(c.label){case 0:t=e,c.label=1;case 1:return t===""||t==="."?[2,null]:e!=="eth"&&t==="eth"?[2,null]:[4,this._getResolver(t,"getResolver")];case 2:return n=c.sent(),n==null?[3,5]:(o=new mo(this,n,e),s=t!==e,s?[4,o.supportsWildcard()]:[3,4]);case 3:s=!c.sent(),c.label=4;case 4:return s?[2,null]:[2,o];case 5:return t=t.split(".").slice(1).join("."),[3,1];case 6:return[2]}})})},r.prototype._getResolver=function(e,t){return I(this,void 0,void 0,function(){var n,o,s;return F(this,function(c){switch(c.label){case 0:return t==null&&(t="ENS"),[4,this.getNetwork()];case 1:n=c.sent(),n.ensAddress||q.throwError("network does not support ENS",D.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name}),c.label=2;case 2:return c.trys.push([2,4,,5]),[4,this.call({to:n.ensAddress,data:"0x0178b8bf"+(0,Xt.namehash)(e).substring(2)})];case 3:return o=c.sent(),[2,this.formatter.callAddress(o)];case 4:return s=c.sent(),[3,5];case 5:return[2,null]}})})},r.prototype.resolveName=function(e){return I(this,void 0,void 0,function(){var t;return F(this,function(n){switch(n.label){case 0:return[4,e];case 1:e=n.sent();try{return[2,Promise.resolve(this.formatter.address(e))]}catch(o){if((0,N.isHexString)(e))throw o}return typeof e!="string"&&q.throwArgumentError("invalid ENS name","name",e),[4,this.getResolver(e)];case 2:return t=n.sent(),t?[4,t.getAddress()]:[2,null];case 3:return[2,n.sent()]}})})},r.prototype.lookupAddress=function(e){return I(this,void 0,void 0,function(){var t,n,o,s,c;return F(this,function(u){switch(u.label){case 0:return[4,e];case 1:return e=u.sent(),e=this.formatter.address(e),t=e.substring(2).toLowerCase()+".addr.reverse",[4,this._getResolver(t,"lookupAddress")];case 2:return n=u.sent(),n==null?[2,null]:(s=fi,[4,this.call({to:n,data:"0x691f3431"+(0,Xt.namehash)(t).substring(2)})]);case 3:return o=s.apply(void 0,[u.sent(),0]),[4,this.resolveName(o)];case 4:return c=u.sent(),c!=e?[2,null]:[2,o]}})})},r.prototype.getAvatar=function(e){return I(this,void 0,void 0,function(){var t,n,o,s,c,u,a,f,l,p;return F(this,function(y){switch(y.label){case 0:return t=null,(0,N.isHexString)(e)?(n=this.formatter.address(e),o=n.substring(2).toLowerCase()+".addr.reverse",[4,this._getResolver(o,"getAvatar")]):[3,10];case 1:if(s=y.sent(),!s)return[2,null];t=new mo(this,s,o),y.label=2;case 2:return y.trys.push([2,4,,5]),[4,t.getAvatar()];case 3:return c=y.sent(),c?[2,c.url]:[3,5];case 4:if(u=y.sent(),u.code!==D.Logger.errors.CALL_EXCEPTION)throw u;return[3,5];case 5:return y.trys.push([5,8,,9]),f=fi,[4,this.call({to:s,data:"0x691f3431"+(0,Xt.namehash)(o).substring(2)})];case 6:return a=f.apply(void 0,[y.sent(),0]),[4,this.getResolver(a)];case 7:return t=y.sent(),[3,9];case 8:if(l=y.sent(),l.code!==D.Logger.errors.CALL_EXCEPTION)throw l;return[2,null];case 9:return[3,12];case 10:return[4,this.getResolver(e)];case 11:if(t=y.sent(),!t)return[2,null];y.label=12;case 12:return[4,t.getAvatar()];case 13:return p=y.sent(),p==null?[2,null]:[2,p.url]}})})},r.prototype.perform=function(e,t){return q.throwError(e+" not implemented",D.Logger.errors.NOT_IMPLEMENTED,{operation:e})},r.prototype._startEvent=function(e){this.polling=this._events.filter(function(t){return t.pollable()}).length>0},r.prototype._stopEvent=function(e){this.polling=this._events.filter(function(t){return t.pollable()}).length>0},r.prototype._addEventListener=function(e,t,n){var o=new ic(dt(e),t,n);return this._events.push(o),this._startEvent(o),this},r.prototype.on=function(e,t){return this._addEventListener(e,t,!1)},r.prototype.once=function(e,t){return this._addEventListener(e,t,!0)},r.prototype.emit=function(e){for(var t=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var s=!1,c=[],u=dt(e);return this._events=this._events.filter(function(a){return a.tag!==u?!0:(setTimeout(function(){a.listener.apply(t,n)},0),s=!0,a.once?(c.push(a),!1):!0)}),c.forEach(function(a){t._stopEvent(a)}),s},r.prototype.listenerCount=function(e){if(!e)return this._events.length;var t=dt(e);return this._events.filter(function(n){return n.tag===t}).length},r.prototype.listeners=function(e){if(e==null)return this._events.map(function(n){return n.listener});var t=dt(e);return this._events.filter(function(n){return n.tag===t}).map(function(n){return n.listener})},r.prototype.off=function(e,t){var n=this;if(t==null)return this.removeAllListeners(e);var o=[],s=!1,c=dt(e);return this._events=this._events.filter(function(u){return u.tag!==c||u.listener!=t||s?!0:(s=!0,o.push(u),!1)}),o.forEach(function(u){n._stopEvent(u)}),this},r.prototype.removeAllListeners=function(e){var t=this,n=[];if(e==null)n=this._events,this._events=[];else{var o=dt(e);this._events=this._events.filter(function(s){return s.tag!==o?!0:(n.push(s),!1)})}return n.forEach(function(s){t._stopEvent(s)}),this},r}(nc.Provider);Pe.BaseProvider=cd});var pt=E(Ie=>{"use strict";d();h();var Eo=Ie&&Ie.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),sr=Ie&&Ie.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},cr=Ie&&Ie.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.JsonRpcProvider=Ie.JsonRpcSigner=void 0;var ud=fn(),_o=Oe(),xt=ee(),sc=Ot(),oe=re(),cc=dr(),fd=Lr(),fc=ft(),fe=U(),ld=ye(),ue=new fe.Logger(ld.version),dd=Yt(),hd=["call","estimateGas"];function rn(i,r){if(i==null)return null;if(typeof i.message=="string"&&i.message.match("reverted")){var e=(0,xt.isHexString)(i.data)?i.data:null;if(!r||e)return{message:i.message,data:e}}if(typeof i=="object"){for(var t in i){var n=rn(i[t],r);if(n)return n}return null}if(typeof i=="string")try{return rn(JSON.parse(i),r)}catch{}return null}function lc(i,r,e){var t=e.transaction||e.signedTransaction;if(i==="call"){var n=rn(r,!0);if(n)return n.data;ue.throwError("missing revert data in call exception; Transaction reverted without a reason string",fe.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:t,error:r})}if(i==="estimateGas"){var n=rn(r.body,!1);n==null&&(n=rn(r,!1)),n&&ue.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",fe.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:i,transaction:t,error:r})}var o=r.message;throw r.code===fe.Logger.errors.SERVER_ERROR&&r.error&&typeof r.error.message=="string"?o=r.error.message:typeof r.body=="string"?o=r.body:typeof r.responseText=="string"&&(o=r.responseText),o=(o||"").toLowerCase(),o.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ue.throwError("insufficient funds for intrinsic transaction cost",fe.Logger.errors.INSUFFICIENT_FUNDS,{error:r,method:i,transaction:t}),o.match(/nonce (is )?too low/i)&&ue.throwError("nonce has already been used",fe.Logger.errors.NONCE_EXPIRED,{error:r,method:i,transaction:t}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ue.throwError("replacement fee too low",fe.Logger.errors.REPLACEMENT_UNDERPRICED,{error:r,method:i,transaction:t}),o.match(/only replay-protected/i)&&ue.throwError("legacy pre-eip-155 transactions not supported",fe.Logger.errors.UNSUPPORTED_OPERATION,{error:r,method:i,transaction:t}),hd.indexOf(i)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ue.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",fe.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:r,method:i,transaction:t}),r}function uc(i){return new Promise(function(r){setTimeout(r,i)})}function xd(i){if(i.error){var r=new Error(i.error.message);throw r.code=i.error.code,r.data=i.error.data,r}return i.result}function en(i){return i&&i.toLowerCase()}var wo={},Po=function(i){Eo(r,i);function r(e,t,n){var o=i.call(this)||this;if(e!==wo)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return(0,oe.defineReadOnly)(o,"provider",t),n==null&&(n=0),typeof n=="string"?((0,oe.defineReadOnly)(o,"_address",o.provider.formatter.address(n)),(0,oe.defineReadOnly)(o,"_index",null)):typeof n=="number"?((0,oe.defineReadOnly)(o,"_index",n),(0,oe.defineReadOnly)(o,"_address",null)):ue.throwArgumentError("invalid address or index","addressOrIndex",n),o}return r.prototype.connect=function(e){return ue.throwError("cannot alter JSON-RPC Signer connection",fe.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})},r.prototype.connectUnchecked=function(){return new pd(wo,this.provider,this._address||this._index)},r.prototype.getAddress=function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(function(t){return t.length<=e._index&&ue.throwError("unknown account #"+e._index,fe.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])})},r.prototype.sendUncheckedTransaction=function(e){var t=this;e=(0,oe.shallowCopy)(e);var n=this.getAddress().then(function(s){return s&&(s=s.toLowerCase()),s});if(e.gasLimit==null){var o=(0,oe.shallowCopy)(e);o.from=n,e.gasLimit=this.provider.estimateGas(o)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(function(s){return sr(t,void 0,void 0,function(){var c;return cr(this,function(u){switch(u.label){case 0:return s==null?[2,null]:[4,this.provider.resolveName(s)];case 1:return c=u.sent(),c==null&&ue.throwArgumentError("provided ENS name resolves to null","tx.to",s),[2,c]}})})})),(0,oe.resolveProperties)({tx:(0,oe.resolveProperties)(e),sender:n}).then(function(s){var c=s.tx,u=s.sender;c.from!=null?c.from.toLowerCase()!==u&&ue.throwArgumentError("from address mismatch","transaction",e):c.from=u;var a=t.provider.constructor.hexlifyTransaction(c,{from:!0});return t.provider.send("eth_sendTransaction",[a]).then(function(f){return f},function(f){return typeof f.message=="string"&&f.message.match(/user denied/i)&&ue.throwError("user rejected transaction",fe.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:c}),lc("sendTransaction",f,a)})})},r.prototype.signTransaction=function(e){return ue.throwError("signing transactions is unsupported",fe.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})},r.prototype.sendTransaction=function(e){return sr(this,void 0,void 0,function(){var t,n,o,s=this;return cr(this,function(c){switch(c.label){case 0:return[4,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval)];case 1:return t=c.sent(),[4,this.sendUncheckedTransaction(e)];case 2:n=c.sent(),c.label=3;case 3:return c.trys.push([3,5,,6]),[4,(0,fc.poll)(function(){return sr(s,void 0,void 0,function(){var u;return cr(this,function(a){switch(a.label){case 0:return[4,this.provider.getTransaction(n)];case 1:return u=a.sent(),u===null?[2,void 0]:[2,this.provider._wrapTransaction(u,n,t)]}})})},{oncePoll:this.provider})];case 4:return[2,c.sent()];case 5:throw o=c.sent(),o.transactionHash=n,o;case 6:return[2]}})})},r.prototype.signMessage=function(e){return sr(this,void 0,void 0,function(){var t,n,o;return cr(this,function(s){switch(s.label){case 0:return t=typeof e=="string"?(0,cc.toUtf8Bytes)(e):e,[4,this.getAddress()];case 1:n=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.provider.send("personal_sign",[(0,xt.hexlify)(t),n.toLowerCase()])];case 3:return[2,s.sent()];case 4:throw o=s.sent(),typeof o.message=="string"&&o.message.match(/user denied/i)&&ue.throwError("user rejected signing",fe.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),o;case 5:return[2]}})})},r.prototype._legacySignMessage=function(e){return sr(this,void 0,void 0,function(){var t,n,o;return cr(this,function(s){switch(s.label){case 0:return t=typeof e=="string"?(0,cc.toUtf8Bytes)(e):e,[4,this.getAddress()];case 1:n=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.provider.send("eth_sign",[n.toLowerCase(),(0,xt.hexlify)(t)])];case 3:return[2,s.sent()];case 4:throw o=s.sent(),typeof o.message=="string"&&o.message.match(/user denied/i)&&ue.throwError("user rejected signing",fe.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),o;case 5:return[2]}})})},r.prototype._signTypedData=function(e,t,n){return sr(this,void 0,void 0,function(){var o,s,c,u=this;return cr(this,function(a){switch(a.label){case 0:return[4,sc._TypedDataEncoder.resolveNames(e,t,n,function(f){return u.provider.resolveName(f)})];case 1:return o=a.sent(),[4,this.getAddress()];case 2:s=a.sent(),a.label=3;case 3:return a.trys.push([3,5,,6]),[4,this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(sc._TypedDataEncoder.getPayload(o.domain,t,o.value))])];case 4:return[2,a.sent()];case 5:throw c=a.sent(),typeof c.message=="string"&&c.message.match(/user denied/i)&&ue.throwError("user rejected signing",fe.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:o.domain,types:t,value:o.value}}),c;case 6:return[2]}})})},r.prototype.unlock=function(e){return sr(this,void 0,void 0,function(){var t,n;return cr(this,function(o){switch(o.label){case 0:return t=this.provider,[4,this.getAddress()];case 1:return n=o.sent(),[2,t.send("personal_unlockAccount",[n.toLowerCase(),e,null])]}})})},r}(ud.Signer);Ie.JsonRpcSigner=Po;var pd=function(i){Eo(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.sendTransaction=function(e){var t=this;return this.sendUncheckedTransaction(e).then(function(n){return{hash:n,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(o){return t.provider.waitForTransaction(n,o)}}})},r}(Po),bd={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},gd=function(i){Eo(r,i);function r(e,t){var n=this,o=t;return o==null&&(o=new Promise(function(s,c){setTimeout(function(){n.detectNetwork().then(function(u){s(u)},function(u){c(u)})},0)})),n=i.call(this,o)||this,e||(e=(0,oe.getStatic)(n.constructor,"defaultUrl")()),typeof e=="string"?(0,oe.defineReadOnly)(n,"connection",Object.freeze({url:e})):(0,oe.defineReadOnly)(n,"connection",Object.freeze((0,oe.shallowCopy)(e))),n._nextId=42,n}return Object.defineProperty(r.prototype,"_cache",{get:function(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache},enumerable:!1,configurable:!0}),r.defaultUrl=function(){return"http://localhost:8545"},r.prototype.detectNetwork=function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(function(){e._cache.detectNetwork=null},0)),this._cache.detectNetwork},r.prototype._uncachedDetectNetwork=function(){return sr(this,void 0,void 0,function(){var e,t,n,o;return cr(this,function(s){switch(s.label){case 0:return[4,uc(0)];case 1:s.sent(),e=null,s.label=2;case 2:return s.trys.push([2,4,,9]),[4,this.send("eth_chainId",[])];case 3:return e=s.sent(),[3,9];case 4:t=s.sent(),s.label=5;case 5:return s.trys.push([5,7,,8]),[4,this.send("net_version",[])];case 6:return e=s.sent(),[3,8];case 7:return n=s.sent(),[3,8];case 8:return[3,9];case 9:if(e!=null){o=(0,oe.getStatic)(this.constructor,"getNetwork");try{return[2,o(_o.BigNumber.from(e).toNumber())]}catch(c){return[2,ue.throwError("could not detect network",fe.Logger.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:c})]}}return[2,ue.throwError("could not detect network",fe.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})]}})})},r.prototype.getSigner=function(e){return new Po(wo,this,e)},r.prototype.getUncheckedSigner=function(e){return this.getSigner(e).connectUnchecked()},r.prototype.listAccounts=function(){var e=this;return this.send("eth_accounts",[]).then(function(t){return t.map(function(n){return e.formatter.address(n)})})},r.prototype.send=function(e,t){var n=this,o={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,oe.deepCopy)(o),provider:this});var s=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(s&&this._cache[e])return this._cache[e];var c=(0,fc.fetchJson)(this.connection,JSON.stringify(o),xd).then(function(u){return n.emit("debug",{action:"response",request:o,response:u,provider:n}),u},function(u){throw n.emit("debug",{action:"response",error:u,request:o,provider:n}),u});return s&&(this._cache[e]=c,setTimeout(function(){n._cache[e]=null},0)),c},r.prototype.prepareRequest=function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[en(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[en(t.address),t.blockTag]];case"getCode":return["eth_getCode",[en(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[en(t.address),(0,xt.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":{var n=(0,oe.getStatic)(this.constructor,"hexlifyTransaction");return["eth_call",[n(t.transaction,{from:!0}),t.blockTag]]}case"estimateGas":{var n=(0,oe.getStatic)(this.constructor,"hexlifyTransaction");return["eth_estimateGas",[n(t.transaction,{from:!0})]]}case"getLogs":return t.filter&&t.filter.address!=null&&(t.filter.address=en(t.filter.address)),["eth_getLogs",[t.filter]];default:break}return null},r.prototype.perform=function(e,t){return sr(this,void 0,void 0,function(){var n,o,s,c;return cr(this,function(u){switch(u.label){case 0:return e==="call"||e==="estimateGas"?(n=t.transaction,n&&n.type!=null&&_o.BigNumber.from(n.type).isZero()?n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null?[4,this.getFeeData()]:[3,2]:[3,2]):[3,2];case 1:o=u.sent(),o.maxFeePerGas==null&&o.maxPriorityFeePerGas==null&&(t=(0,oe.shallowCopy)(t),t.transaction=(0,oe.shallowCopy)(n),delete t.transaction.type),u.label=2;case 2:s=this.prepareRequest(e,t),s==null&&ue.throwError(e+" not implemented",fe.Logger.errors.NOT_IMPLEMENTED,{operation:e}),u.label=3;case 3:return u.trys.push([3,5,,6]),[4,this.send(s[0],s[1])];case 4:return[2,u.sent()];case 5:return c=u.sent(),[2,lc(e,c,t)];case 6:return[2]}})})},r.prototype._startEvent=function(e){e.tag==="pending"&&this._startPending(),i.prototype._startEvent.call(this,e)},r.prototype._startPending=function(){if(this._pendingFilter==null){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then(function(n){function o(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=t)return null;var c=Promise.resolve();return s.forEach(function(u){e._emitted["t:"+u.toLowerCase()]="pending",c=c.then(function(){return e.getTransaction(u).then(function(a){return e.emit("pending",a),null})})}),c.then(function(){return uc(1e3)})}).then(function(){if(e._pendingFilter!=t){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){o()},0),null}).catch(function(s){})}return o(),n}).catch(function(n){})}},r.prototype._stopEvent=function(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),i.prototype._stopEvent.call(this,e)},r.hexlifyTransaction=function(e,t){var n=(0,oe.shallowCopy)(bd);if(t)for(var o in t)t[o]&&(n[o]=!0);(0,oe.checkProperties)(e,n);var s={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(c){if(e[c]!=null){var u=(0,xt.hexValue)(_o.BigNumber.from(e[c]));c==="gasLimit"&&(c="gas"),s[c]=u}}),["from","to","data"].forEach(function(c){e[c]!=null&&(s[c]=(0,xt.hexlify)(e[c]))}),e.accessList&&(s.accessList=(0,fd.accessListify)(e.accessList)),s},r}(dd.BaseProvider);Ie.JsonRpcProvider=gd});var xc=E(bt=>{"use strict";d();h();Object.defineProperty(bt,"__esModule",{value:!0});bt.WebSocket=void 0;var dc=U(),yd=ye(),li=null;bt.WebSocket=li;try{if(bt.WebSocket=li=WebSocket,li==null)throw new Error("inject please")}catch{hc=new dc.Logger(yd.version),bt.WebSocket=li=function(){hc.throwError("WebSockets not supported in this environment",dc.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var hc});var hi=E($e=>{"use strict";d();h();var vd=$e&&$e.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),ko=$e&&$e.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},So=$e&&$e.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty($e,"__esModule",{value:!0});$e.WebSocketProvider=void 0;var md=Oe(),Sr=re(),_d=pt(),pc=xc(),tn=U(),wd=ye(),di=new tn.Logger(wd.version),Ed=1,Pd=function(i){vd(r,i);function r(e,t){var n=this;t==="any"&&di.throwError("WebSocketProvider does not support 'any' network yet",tn.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),typeof e=="string"?n=i.call(this,e,t)||this:n=i.call(this,"_websocket",t)||this,n._pollingInterval=-1,n._wsReady=!1,typeof e=="string"?(0,Sr.defineReadOnly)(n,"_websocket",new pc.WebSocket(n.connection.url)):(0,Sr.defineReadOnly)(n,"_websocket",e),(0,Sr.defineReadOnly)(n,"_requests",{}),(0,Sr.defineReadOnly)(n,"_subs",{}),(0,Sr.defineReadOnly)(n,"_subIds",{}),(0,Sr.defineReadOnly)(n,"_detectNetwork",i.prototype.detectNetwork.call(n)),n.websocket.onopen=function(){n._wsReady=!0,Object.keys(n._requests).forEach(function(s){n.websocket.send(n._requests[s].payload)})},n.websocket.onmessage=function(s){var c=s.data,u=JSON.parse(c);if(u.id!=null){var a=String(u.id),f=n._requests[a];if(delete n._requests[a],u.result!==void 0)f.callback(null,u.result),n.emit("debug",{action:"response",request:JSON.parse(f.payload),response:u.result,provider:n});else{var l=null;u.error?(l=new Error(u.error.message||"unknown error"),(0,Sr.defineReadOnly)(l,"code",u.error.code||null),(0,Sr.defineReadOnly)(l,"response",c)):l=new Error("unknown error"),f.callback(l,void 0),n.emit("debug",{action:"response",error:l,request:JSON.parse(f.payload),provider:n})}}else if(u.method==="eth_subscription"){var p=n._subs[u.params.subscription];p&&p.processFunc(u.params.result)}else console.warn("this should not happen")};var o=setInterval(function(){n.emit("poll")},1e3);return o.unref&&o.unref(),n}return Object.defineProperty(r.prototype,"websocket",{get:function(){return this._websocket},enumerable:!1,configurable:!0}),r.prototype.detectNetwork=function(){return this._detectNetwork},Object.defineProperty(r.prototype,"pollingInterval",{get:function(){return 0},set:function(e){di.throwError("cannot set polling interval on WebSocketProvider",tn.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})},enumerable:!1,configurable:!0}),r.prototype.resetEventsBlock=function(e){di.throwError("cannot reset events block on WebSocketProvider",tn.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})},r.prototype.poll=function(){return ko(this,void 0,void 0,function(){return So(this,function(e){return[2,null]})})},Object.defineProperty(r.prototype,"polling",{set:function(e){!e||di.throwError("cannot set polling on WebSocketProvider",tn.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})},enumerable:!1,configurable:!0}),r.prototype.send=function(e,t){var n=this,o=Ed++;return new Promise(function(s,c){function u(f,l){return f?c(f):s(l)}var a=JSON.stringify({method:e,params:t,id:o,jsonrpc:"2.0"});n.emit("debug",{action:"request",request:JSON.parse(a),provider:n}),n._requests[String(o)]={callback:u,payload:a},n._wsReady&&n.websocket.send(a)})},r.defaultUrl=function(){return"ws://localhost:8546"},r.prototype._subscribe=function(e,t,n){return ko(this,void 0,void 0,function(){var o,s,c=this;return So(this,function(u){switch(u.label){case 0:return o=this._subIds[e],o==null&&(o=Promise.all(t).then(function(a){return c.send("eth_subscribe",a)}),this._subIds[e]=o),[4,o];case 1:return s=u.sent(),this._subs[s]={tag:e,processFunc:n},[2]}})})},r.prototype._startEvent=function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],function(o){var s=md.BigNumber.from(o.number).toNumber();t._emitted.block=s,t.emit("block",s)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],function(o){t.emit("pending",o)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],function(o){o.removed==null&&(o.removed=!1),t.emit(e.filter,t.formatter.filterLog(o))});break;case"tx":{var n=function(o){var s=o.hash;t.getTransactionReceipt(s).then(function(c){!c||t.emit(s,c)})};n(e),this._subscribe("tx",["newHeads"],function(o){t._events.filter(function(s){return s.type==="tx"}).forEach(n)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e);break}},r.prototype._stopEvent=function(e){var t=this,n=e.tag;if(e.type==="tx"){if(this._events.filter(function(s){return s.type==="tx"}).length)return;n="tx"}else if(this.listenerCount(e.event))return;var o=this._subIds[n];!o||(delete this._subIds[n],o.then(function(s){!t._subs[s]||(delete t._subs[s],t.send("eth_unsubscribe",[s]))}))},r.prototype.destroy=function(){return ko(this,void 0,void 0,function(){var e=this;return So(this,function(t){switch(t.label){case 0:return this.websocket.readyState!==pc.WebSocket.CONNECTING?[3,2]:[4,new Promise(function(n){e.websocket.onopen=function(){n(!0)},e.websocket.onerror=function(){n(!1)}})];case 1:t.sent(),t.label=2;case 2:return this.websocket.close(1e3),[2]}})})},r}(_d.JsonRpcProvider);$e.WebSocketProvider=Pd});var Or=E(Fe=>{"use strict";d();h();var bc=Fe&&Fe.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),kd=Fe&&Fe.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},Sd=Fe&&Fe.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.UrlJsonRpcProvider=Fe.StaticJsonRpcProvider=void 0;var gt=re(),xi=U(),Od=ye(),nn=new xi.Logger(Od.version),Rd=pt(),gc=function(i){bc(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.detectNetwork=function(){return kd(this,void 0,void 0,function(){var e;return Sd(this,function(t){switch(t.label){case 0:return e=this.network,e!=null?[3,2]:[4,i.prototype.detectNetwork.call(this)];case 1:e=t.sent(),e||nn.throwError("no network detected",xi.Logger.errors.UNKNOWN_ERROR,{}),this._network==null&&((0,gt.defineReadOnly)(this,"_network",e),this.emit("network",e,null)),t.label=2;case 2:return[2,e]}})})},r}(Rd.JsonRpcProvider);Fe.StaticJsonRpcProvider=gc;var Ad=function(i){bc(r,i);function r(e,t){var n=this.constructor,o=this;nn.checkAbstract(n,r),e=(0,gt.getStatic)(n,"getNetwork")(e),t=(0,gt.getStatic)(n,"getApiKey")(t);var s=(0,gt.getStatic)(n,"getUrl")(e,t);return o=i.call(this,s,e)||this,typeof t=="string"?(0,gt.defineReadOnly)(o,"apiKey",t):t!=null&&Object.keys(t).forEach(function(c){(0,gt.defineReadOnly)(o,c,t[c])}),o}return r.prototype._startPending=function(){nn.warn("WARNING: API provider does not support pending filters")},r.prototype.isCommunityResource=function(){return!1},r.prototype.getSigner=function(e){return nn.throwError("API provider does not support signing",xi.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})},r.prototype.listAccounts=function(){return Promise.resolve([])},r.getApiKey=function(e){return e},r.getUrl=function(e,t){return nn.throwError("not implemented; sub-classes must override getUrl",xi.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})},r}(gc);Fe.UrlJsonRpcProvider=Ad});var wc=E(Rr=>{"use strict";d();h();var vc=Rr&&Rr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Rr,"__esModule",{value:!0});Rr.AlchemyProvider=Rr.AlchemyWebSocketProvider=void 0;var Td=re(),Cd=kr(),Nd=hi(),Ld=U(),Bd=ye(),yc=new Ld.Logger(Bd.version),Id=Or(),pi="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",mc=function(i){vc(r,i);function r(e,t){var n=this,o=new _c(e,t),s=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return n=i.call(this,s,o.network)||this,(0,Td.defineReadOnly)(n,"apiKey",o.apiKey),n}return r.prototype.isCommunityResource=function(){return this.apiKey===pi},r}(Nd.WebSocketProvider);Rr.AlchemyWebSocketProvider=mc;var _c=function(i){vc(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.getWebSocketProvider=function(e,t){return new mc(e,t)},r.getApiKey=function(e){return e==null?pi:(e&&typeof e!="string"&&yc.throwArgumentError("invalid apiKey","apiKey",e),e)},r.getUrl=function(e,t){var n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:yc.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+t,throttleCallback:function(o,s){return t===pi&&(0,Cd.showThrottleMessage)(),Promise.resolve(!0)}}},r.prototype.isCommunityResource=function(){return this.apiKey===pi},r}(Id.UrlJsonRpcProvider);Rr.AlchemyProvider=_c});var Ec=E(yt=>{"use strict";d();h();var Fd=yt&&yt.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(yt,"__esModule",{value:!0});yt.AnkrProvider=void 0;var jd=kr(),qd=Or(),Dd=U(),Md=ye(),Ud=new Dd.Logger(Md.version),bi="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Wd(i){switch(i){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 Ud.throwArgumentError("unsupported network","name",i)}var Gd=function(i){Fd(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.isCommunityResource=function(){return this.apiKey===bi},r.getApiKey=function(e){return e??bi},r.getUrl=function(e,t){t==null&&(t=bi);var n={allowGzip:!0,url:"https://"+Wd(e.name)+t,throttleCallback:function(o,s){return t.apiKey===bi&&(0,jd.showThrottleMessage)(),Promise.resolve(!0)}};return t.projectSecret!=null&&(n.user="",n.password=t.projectSecret),n},r}(qd.UrlJsonRpcProvider);yt.AnkrProvider=Gd});var kc=E(Xe=>{"use strict";d();h();var Hd=Xe&&Xe.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),Jd=Xe&&Xe.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},Kd=Xe&&Xe.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.CloudflareProvider=void 0;var Vd=Or(),zd=U(),Zd=ye(),Pc=new zd.Logger(Zd.version),$d=function(i){Hd(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.getApiKey=function(e){return e!=null&&Pc.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null},r.getUrl=function(e,t){var n=null;switch(e.name){case"homestead":n="https://cloudflare-eth.com/";break;default:Pc.throwArgumentError("unsupported network","network",arguments[0])}return n},r.prototype.perform=function(e,t){return Jd(this,void 0,void 0,function(){var n;return Kd(this,function(o){switch(o.label){case 0:return e!=="getBlockNumber"?[3,2]:[4,i.prototype.perform.call(this,"getBlock",{blockTag:"latest"})];case 1:return n=o.sent(),[2,n.number];case 2:return[2,i.prototype.perform.call(this,e,t)]}})})},r}(Vd.UrlJsonRpcProvider);Xe.CloudflareProvider=$d});var Ac=E(Ye=>{"use strict";d();h();var Xd=Ye&&Ye.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),gi=Ye&&Ye.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},yi=Ye&&Ye.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.EtherscanProvider=void 0;var vi=ee(),Oo=re(),Qd=Lr(),Yd=ft(),eh=kr(),Qe=U(),rh=ye(),Ar=new Qe.Logger(rh.version),th=Yt();function Sc(i){var r={};for(var e in i)if(i[e]!=null){var t=i[e];e==="type"&&t===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[e]?t=(0,vi.hexValue)((0,vi.hexlify)(t)):e==="accessList"?t="["+(0,Qd.accessListify)(t).map(function(n){return'{address:"'+n.address+'",storageKeys:["'+n.storageKeys.join('","')+'"]}'}).join(",")+"]":t=(0,vi.hexlify)(t),r[e]=t)}return r}function nh(i){if(i.status==0&&(i.message==="No records found"||i.message==="No transactions found"))return i.result;if(i.status!=1||typeof i.message!="string"||!i.message.match(/^OK/)){var r=new Error("invalid response");throw r.result=JSON.stringify(i),(i.result||"").toLowerCase().indexOf("rate limit")>=0&&(r.throttleRetry=!0),r}return i.result}function Oc(i){if(i&&i.status==0&&i.message=="NOTOK"&&(i.result||"").toLowerCase().indexOf("rate limit")>=0){var r=new Error("throttled response");throw r.result=JSON.stringify(i),r.throttleRetry=!0,r}if(i.jsonrpc!="2.0"){var r=new Error("invalid response");throw r.result=JSON.stringify(i),r}if(i.error){var r=new Error(i.error.message||"unknown error");throw i.error.code&&(r.code=i.error.code),i.error.data&&(r.data=i.error.data),r}return i.result}function Rc(i){if(i==="pending")throw new Error("pending not supported");return i==="latest"?i:parseInt(i.substring(2),16)}function Ro(i,r,e){if(i==="call"&&r.code===Qe.Logger.errors.SERVER_ERROR){var t=r.error;if(t&&(t.message.match(/reverted/i)||t.message.match(/VM execution error/i))){var n=t.data;if(n&&(n="0x"+n.replace(/^.*0x/i,"")),(0,vi.isHexString)(n))return n;Ar.throwError("missing revert data in call exception",Qe.Logger.errors.CALL_EXCEPTION,{error:r,data:"0x"})}}var o=r.message;throw r.code===Qe.Logger.errors.SERVER_ERROR&&(r.error&&typeof r.error.message=="string"?o=r.error.message:typeof r.body=="string"?o=r.body:typeof r.responseText=="string"&&(o=r.responseText)),o=(o||"").toLowerCase(),o.match(/insufficient funds/)&&Ar.throwError("insufficient funds for intrinsic transaction cost",Qe.Logger.errors.INSUFFICIENT_FUNDS,{error:r,method:i,transaction:e}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Ar.throwError("nonce has already been used",Qe.Logger.errors.NONCE_EXPIRED,{error:r,method:i,transaction:e}),o.match(/another transaction with same nonce/)&&Ar.throwError("replacement fee too low",Qe.Logger.errors.REPLACEMENT_UNDERPRICED,{error:r,method:i,transaction:e}),o.match(/execution failed due to an exception|execution reverted/)&&Ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Qe.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:r,method:i,transaction:e}),r}var ih=function(i){Xd(r,i);function r(e,t){var n=i.call(this,e)||this;return(0,Oo.defineReadOnly)(n,"baseUrl",n.getBaseUrl()),(0,Oo.defineReadOnly)(n,"apiKey",t||null),n}return r.prototype.getBaseUrl=function(){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";default:}return Ar.throwArgumentError("unsupported network","network",this.network.name)},r.prototype.getUrl=function(e,t){var n=Object.keys(t).reduce(function(s,c){var u=t[c];return u!=null&&(s+="&"+c+"="+u),s},""),o=this.apiKey?"&apikey="+this.apiKey:"";return this.baseUrl+"/api?module="+e+n+o},r.prototype.getPostUrl=function(){return this.baseUrl+"/api"},r.prototype.getPostData=function(e,t){return t.module=e,t.apikey=this.apiKey,t},r.prototype.fetch=function(e,t,n){return gi(this,void 0,void 0,function(){var o,s,c,u,a,f,l=this;return yi(this,function(p){switch(p.label){case 0:return o=n?this.getPostUrl():this.getUrl(e,t),s=n?this.getPostData(e,t):null,c=e==="proxy"?Oc:nh,this.emit("debug",{action:"request",request:o,provider:this}),u={url:o,throttleSlotInterval:1e3,throttleCallback:function(y,S){return l.isCommunityResource()&&(0,eh.showThrottleMessage)(),Promise.resolve(!0)}},a=null,s&&(u.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(s).map(function(y){return y+"="+s[y]}).join("&")),[4,(0,Yd.fetchJson)(u,a,c||Oc)];case 1:return f=p.sent(),this.emit("debug",{action:"response",request:o,response:(0,Oo.deepCopy)(f),provider:this}),[2,f]}})})},r.prototype.detectNetwork=function(){return gi(this,void 0,void 0,function(){return yi(this,function(e){return[2,this.network]})})},r.prototype.perform=function(e,t){return gi(this,void 0,void 0,function(){var n,s,o,s,c,u,a,f,l,p,y,S,m;return yi(this,function(_){switch(_.label){case 0:switch(n=e,n){case"getBlockNumber":return[3,1];case"getGasPrice":return[3,2];case"getBalance":return[3,3];case"getTransactionCount":return[3,4];case"getCode":return[3,5];case"getStorageAt":return[3,6];case"sendTransaction":return[3,7];case"getBlock":return[3,8];case"getTransaction":return[3,9];case"getTransactionReceipt":return[3,10];case"call":return[3,11];case"estimateGas":return[3,15];case"getLogs":return[3,19];case"getEtherPrice":return[3,26]}return[3,28];case 1:return[2,this.fetch("proxy",{action:"eth_blockNumber"})];case 2:return[2,this.fetch("proxy",{action:"eth_gasPrice"})];case 3:return[2,this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag})];case 4:return[2,this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag})];case 5:return[2,this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag})];case 6:return[2,this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag})];case 7:return[2,this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch(function(T){return Ro("sendTransaction",T,t.signedTransaction)})];case 8:if(t.blockTag)return[2,this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"})];throw new Error("getBlock by blockHash not implemented");case 9:return[2,this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash})];case 10:return[2,this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash})];case 11:if(t.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");s=Sc(t.transaction),s.module="proxy",s.action="eth_call",_.label=12;case 12:return _.trys.push([12,14,,15]),[4,this.fetch("proxy",s,!0)];case 13:return[2,_.sent()];case 14:return o=_.sent(),[2,Ro("call",o,t.transaction)];case 15:s=Sc(t.transaction),s.module="proxy",s.action="eth_estimateGas",_.label=16;case 16:return _.trys.push([16,18,,19]),[4,this.fetch("proxy",s,!0)];case 17:return[2,_.sent()];case 18:return c=_.sent(),[2,Ro("estimateGas",c,t.transaction)];case 19:return u={action:"getLogs"},t.filter.fromBlock&&(u.fromBlock=Rc(t.filter.fromBlock)),t.filter.toBlock&&(u.toBlock=Rc(t.filter.toBlock)),t.filter.address&&(u.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Ar.throwError("unsupported topic count",Qe.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),t.filter.topics.length===1&&(a=t.filter.topics[0],(typeof a!="string"||a.length!==66)&&Ar.throwError("unsupported topic format",Qe.Logger.errors.UNSUPPORTED_OPERATION,{topic0:a}),u.topic0=a)),[4,this.fetch("logs",u)];case 20:f=_.sent(),l={},p=0,_.label=21;case 21:return p<f.length?(y=f[p],y.blockHash!=null?[3,24]:l[y.blockNumber]!=null?[3,23]:[4,this.getBlock(y.blockNumber)]):[3,25];case 22:S=_.sent(),S&&(l[y.blockNumber]=S.hash),_.label=23;case 23:y.blockHash=l[y.blockNumber],_.label=24;case 24:return p++,[3,21];case 25:return[2,f];case 26:return this.network.name!=="homestead"?[2,0]:(m=parseFloat,[4,this.fetch("stats",{action:"ethprice"})]);case 27:return[2,m.apply(void 0,[_.sent().ethusd])];case 28:return[3,29];case 29:return[2,i.prototype.perform.call(this,e,t)]}})})},r.prototype.getHistory=function(e,t,n){return gi(this,void 0,void 0,function(){var o,s,c,u=this;return yi(this,function(a){switch(a.label){case 0:return c={action:"txlist"},[4,this.resolveName(e)];case 1:return o=(c.address=a.sent(),c.startblock=t??0,c.endblock=n??99999999,c.sort="asc",c),[4,this.fetch("account",o)];case 2:return s=a.sent(),[2,s.map(function(f){["contractAddress","to"].forEach(function(p){f[p]==""&&delete f[p]}),f.creates==null&&f.contractAddress!=null&&(f.creates=f.contractAddress);var l=u.formatter.transactionResponse(f);return f.timeStamp&&(l.timestamp=parseInt(f.timeStamp)),l})]}})})},r.prototype.isCommunityResource=function(){return this.apiKey==null},r}(th.BaseProvider);Ye.EtherscanProvider=ih});var Bc=E(rr=>{"use strict";d();h();var oh=rr&&rr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}(),wi=rr&&rr.__awaiter||function(i,r,e,t){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function c(f){try{a(t.next(f))}catch(l){s(l)}}function u(f){try{a(t.throw(f))}catch(l){s(l)}}function a(f){f.done?o(f.value):n(f.value).then(c,u)}a((t=t.apply(i,r||[])).next())})},an=rr&&rr.__generator||function(i,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(f){return u([a,f])}}function u(a){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,n&&(o=a[0]&2?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,n=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(i,e)}catch(f){a=[6,f],n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(rr,"__esModule",{value:!0});rr.FallbackProvider=void 0;var ah=tt(),sh=Oe(),vt=ee(),er=re(),ch=zn(),uh=ft(),fh=Yt(),Tc=kr(),Tr=U(),lh=ye(),Wr=new Tr.Logger(lh.version);function mi(){return new Date().getTime()}function Cc(i){for(var r=null,e=0;e<i.length;e++){var t=i[e];if(t==null)return null;r?r.name===t.name&&r.chainId===t.chainId&&(r.ensAddress===t.ensAddress||r.ensAddress==null&&t.ensAddress==null)||Wr.throwArgumentError("provider mismatch","networks",i):r=t}return r}function Nc(i,r){i=i.slice().sort();var e=Math.floor(i.length/2);if(i.length%2)return i[e];var t=i[e-1],n=i[e];return r!=null&&Math.abs(t-n)>r?null:(t+n)/2}function mt(i){if(i===null)return"null";if(typeof i=="number"||typeof i=="boolean")return JSON.stringify(i);if(typeof i=="string")return i;if(sh.BigNumber.isBigNumber(i))return i.toString();if(Array.isArray(i))return JSON.stringify(i.map(function(e){return mt(e)}));if(typeof i=="object"){var r=Object.keys(i);return r.sort(),"{"+r.map(function(e){var t=i[e];return typeof t=="function"?t="[function]":t=mt(t),JSON.stringify(e)+":"+t}).join(",")+"}"}throw new Error("unknown value type: "+typeof i)}var dh=1;function Lc(i){var r=null,e=null,t=new Promise(function(s){r=function(){e&&(clearTimeout(e),e=null),s()},e=setTimeout(r,i)}),n=function(s){return t=t.then(s),t};function o(){return t}return{cancel:r,getPromise:o,wait:n}}var hh=[Tr.Logger.errors.CALL_EXCEPTION,Tr.Logger.errors.INSUFFICIENT_FUNDS,Tr.Logger.errors.NONCE_EXPIRED,Tr.Logger.errors.REPLACEMENT_UNDERPRICED,Tr.Logger.errors.UNPREDICTABLE_GAS_LIMIT],xh=["address","args","errorArgs","errorSignature","method","transaction"];function _i(i,r){var e={weight:i.weight};return Object.defineProperty(e,"provider",{get:function(){return i.provider}}),i.start&&(e.start=i.start),r&&(e.duration=r-i.start),i.done&&(i.error?e.error=i.error:e.result=i.result||null),e}function ph(i,r){return function(e){var t={};e.forEach(function(c){var u=i(c.result);t[u]||(t[u]={count:0,result:c.result}),t[u].count++});for(var n=Object.keys(t),o=0;o<n.length;o++){var s=t[n[o]];if(s.count>=r)return s.result}}}function bh(i,r,e){var t=mt;switch(r){case"getBlockNumber":return function(n){var o=n.map(function(c){return c.result}),s=Nc(n.map(function(c){return c.result}),2);if(s!=null)return s=Math.ceil(s),o.indexOf(s+1)>=0&&s++,s>=i._highestBlockNumber&&(i._highestBlockNumber=s),i._highestBlockNumber};case"getGasPrice":return function(n){var o=n.map(function(s){return s.result});return o.sort(),o[Math.floor(o.length/2)]};case"getEtherPrice":return function(n){return Nc(n.map(function(o){return o.result}))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":t=function(n){return n==null?null:(n=(0,er.shallowCopy)(n),n.confirmations=-1,mt(n))};break;case"getBlock":e.includeTransactions?t=function(n){return n==null?null:(n=(0,er.shallowCopy)(n),n.transactions=n.transactions.map(function(o){return o=(0,er.shallowCopy)(o),o.confirmations=-1,o}),mt(n))}:t=function(n){return n==null?null:mt(n)};break;default:throw new Error("unknown method: "+r)}return ph(t,i.quorum)}function on(i,r){return wi(this,void 0,void 0,function(){var e;return an(this,function(t){return e=i.provider,e.blockNumber!=null&&e.blockNumber>=r||r===-1?[2,e]:[2,(0,uh.poll)(function(){return new Promise(function(n,o){setTimeout(function(){return e.blockNumber>=r?n(e):i.cancelled?n(null):n(void 0)},0)})},{oncePoll:e})]})})}function gh(i,r,e,t){return wi(this,void 0,void 0,function(){var n,o,s;return an(this,function(c){switch(c.label){case 0:switch(n=i.provider,o=e,o){case"getBlockNumber":return[3,1];case"getGasPrice":return[3,1];case"getEtherPrice":return[3,2];case"getBalance":return[3,3];case"getTransactionCount":return[3,3];case"getCode":return[3,3];case"getStorageAt":return[3,6];case"getBlock":return[3,9];case"call":return[3,12];case"estimateGas":return[3,12];case"getTransaction":return[3,15];case"getTransactionReceipt":return[3,15];case"getLogs":return[3,16]}return[3,19];case 1:return[2,n[e]()];case 2:return n.getEtherPrice?[2,n.getEtherPrice()]:[3,19];case 3:return t.blockTag&&(0,vt.isHexString)(t.blockTag)?[4,on(i,r)]:[3,5];case 4:n=c.sent(),c.label=5;case 5:return[2,n[e](t.address,t.blockTag||"latest")];case 6:return t.blockTag&&(0,vt.isHexString)(t.blockTag)?[4,on(i,r)]:[3,8];case 7:n=c.sent(),c.label=8;case 8:return[2,n.getStorageAt(t.address,t.position,t.blockTag||"latest")];case 9:return t.blockTag&&(0,vt.isHexString)(t.blockTag)?[4,on(i,r)]:[3,11];case 10:n=c.sent(),c.label=11;case 11:return[2,n[t.includeTransactions?"getBlockWithTransactions":"getBlock"](t.blockTag||t.blockHash)];case 12:return t.blockTag&&(0,vt.isHexString)(t.blockTag)?[4,on(i,r)]:[3,14];case 13:n=c.sent(),c.label=14;case 14:return e==="call"&&t.blockTag?[2,n[e](t.transaction,t.blockTag)]:[2,n[e](t.transaction)];case 15:return[2,n[e](t.transactionHash)];case 16:return s=t.filter,s.fromBlock&&(0,vt.isHexString)(s.fromBlock)||s.toBlock&&(0,vt.isHexString)(s.toBlock)?[4,on(i,r)]:[3,18];case 17:n=c.sent(),c.label=18;case 18:return[2,n.getLogs(s)];case 19:return[2,Wr.throwError("unknown method error",Tr.Logger.errors.UNKNOWN_ERROR,{method:e,params:t})]}})})}var yh=function(i){oh(r,i);function r(e,t){var n=this;e.length===0&&Wr.throwArgumentError("missing providers","providers",e);var o=e.map(function(u,a){if(ah.Provider.isProvider(u)){var f=(0,Tc.isCommunityResource)(u)?2e3:750,l=1;return Object.freeze({provider:u,weight:1,stallTimeout:f,priority:l})}var p=(0,er.shallowCopy)(u);p.priority==null&&(p.priority=1),p.stallTimeout==null&&(p.stallTimeout=(0,Tc.isCommunityResource)(u)?2e3:750),p.weight==null&&(p.weight=1);var y=p.weight;return(y%1||y>512||y<1)&&Wr.throwArgumentError("invalid weight; must be integer in [1, 512]","providers["+a+"].weight",y),Object.freeze(p)}),s=o.reduce(function(u,a){return u+a.weight},0);t==null?t=s/2:t>s&&Wr.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);var c=Cc(o.map(function(u){return u.provider.network}));return c==null&&(c=new Promise(function(u,a){setTimeout(function(){n.detectNetwork().then(u,a)},0)})),n=i.call(this,c)||this,(0,er.defineReadOnly)(n,"providerConfigs",Object.freeze(o)),(0,er.defineReadOnly)(n,"quorum",t),n._highestBlockNumber=-1,n}return r.prototype.detectNetwork=function(){return wi(this,void 0,void 0,function(){var e;return an(this,function(t){switch(t.label){case 0:return[4,Promise.all(this.providerConfigs.map(function(n){return n.provider.getNetwork()}))];case 1:return e=t.sent(),[2,Cc(e)]}})})},r.prototype.perform=function(e,t){return wi(this,void 0,void 0,function(){var n,o,s,c,u,a,f,l,p,y,S,m=this;return an(this,function(_){switch(_.label){case 0:return e!=="sendTransaction"?[3,2]:[4,Promise.all(this.providerConfigs.map(function(T){return T.provider.sendTransaction(t.signedTransaction).then(function(L){return L.hash},function(L){return L})}))];case 1:for(n=_.sent(),o=0;o<n.length;o++)if(s=n[o],typeof s=="string")return[2,s];throw n[0];case 2:return this._highestBlockNumber===-1&&e!=="getBlockNumber"?[4,this.getBlockNumber()]:[3,4];case 3:_.sent(),_.label=4;case 4:c=bh(this,e,t),u=(0,ch.shuffled)(this.providerConfigs.map(er.shallowCopy)),u.sort(function(T,L){return T.priority-L.priority}),a=this._highestBlockNumber,f=0,l=!0,p=function(){var T,L,W,J,j,B,$;return an(this,function(Q){switch(Q.label){case 0:for(T=mi(),L=u.filter(function(k){return k.runner&&T-k.start<k.stallTimeout}).reduce(function(k,A){return k+A.weight},0),W=function(){var k=u[f++],A=dh++;k.start=mi(),k.staller=Lc(k.stallTimeout),k.staller.wait(function(){k.staller=null}),k.runner=gh(k,a,e,t).then(function(H){k.done=!0,k.result=H,m.listenerCount("debug")&&m.emit("debug",{action:"request",rid:A,backend:_i(k,mi()),request:{method:e,params:(0,er.deepCopy)(t)},provider:m})},function(H){k.done=!0,k.error=H,m.listenerCount("debug")&&m.emit("debug",{action:"request",rid:A,backend:_i(k,mi()),request:{method:e,params:(0,er.deepCopy)(t)},provider:m})}),y.listenerCount("debug")&&y.emit("debug",{action:"request",rid:A,backend:_i(k,null),request:{method:e,params:(0,er.deepCopy)(t)},provider:y}),L+=k.weight};L<y.quorum&&f<u.length;)W();return J=[],u.forEach(function(k){k.done||!k.runner||(J.push(k.runner),k.staller&&J.push(k.staller.getPromise()))}),J.length?[4,Promise.race(J)]:[3,2];case 1:Q.sent(),Q.label=2;case 2:return j=u.filter(function(k){return k.done&&k.error==null}),j.length>=y.quorum?(B=c(j),B!==void 0?(u.forEach(function(k){k.staller&&k.staller.cancel(),k.cancelled=!0}),[2,{value:B}]):l?[3,4]:[4,Lc(100).getPromise()]):[3,5];case 3:Q.sent(),Q.label=4;case 4:l=!1,Q.label=5;case 5:return $=u.reduce(function(k,A){if(!A.done||A.error==null)return k;var H=A.error.code;return hh.indexOf(H)>=0&&(k[H]||(k[H]={error:A.error,weight:0}),k[H].weight+=A.weight),k},{}),Object.keys($).forEach(function(k){var A=$[k];if(!(A.weight<m.quorum)){u.forEach(function(X){X.staller&&X.staller.cancel(),X.cancelled=!0});var H=A.error,ae={};xh.forEach(function(X){H[X]!=null&&(ae[X]=H[X])}),Wr.throwError(H.reason||H.message,k,ae)}}),u.filter(function(k){return!k.done}).length===0?[2,"break"]:[2]}})},y=this,_.label=5;case 5:return[5,p()];case 6:return S=_.sent(),typeof S=="object"?[2,S.value]:S==="break"?[3,7]:[3,5];case 7:return u.forEach(function(T){T.staller&&T.staller.cancel(),T.cancelled=!0}),[2,Wr.throwError("failed to meet quorum",Tr.Logger.errors.SERVER_ERROR,{method:e,params:t,results:u.map(function(T){return _i(T)}),provider:this})]}})})},r}(fh.BaseProvider);rr.FallbackProvider=yh});var Ic=E(Ei=>{"use strict";d();h();Object.defineProperty(Ei,"__esModule",{value:!0});Ei.IpcProvider=void 0;var vh=null;Ei.IpcProvider=vh});var Dc=E(Cr=>{"use strict";d();h();var Fc=Cr&&Cr.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Cr,"__esModule",{value:!0});Cr.InfuraProvider=Cr.InfuraWebSocketProvider=void 0;var Ao=re(),mh=hi(),_h=kr(),To=U(),wh=ye(),Pi=new To.Logger(wh.version),Eh=Or(),sn="84842078b09946638c03157f83405213",jc=function(i){Fc(r,i);function r(e,t){var n=this,o=new qc(e,t),s=o.connection;s.password&&Pi.throwError("INFURA WebSocket project secrets unsupported",To.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});var c=s.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");return n=i.call(this,c,e)||this,(0,Ao.defineReadOnly)(n,"apiKey",o.projectId),(0,Ao.defineReadOnly)(n,"projectId",o.projectId),(0,Ao.defineReadOnly)(n,"projectSecret",o.projectSecret),n}return r.prototype.isCommunityResource=function(){return this.projectId===sn},r}(mh.WebSocketProvider);Cr.InfuraWebSocketProvider=jc;var qc=function(i){Fc(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.getWebSocketProvider=function(e,t){return new jc(e,t)},r.getApiKey=function(e){var t={apiKey:sn,projectId:sn,projectSecret:null};return e==null||(typeof e=="string"?t.projectId=e:e.projectSecret!=null?(Pi.assertArgument(typeof e.projectId=="string","projectSecret requires a projectId","projectId",e.projectId),Pi.assertArgument(typeof e.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t},r.getUrl=function(e,t){var n=null;switch(e?e.name:"unknown"){case"homestead":n="mainnet.infura.io";break;case"goerli":n="goerli.infura.io";break;case"sepolia":n="sepolia.infura.io";break;case"matic":n="polygon-mainnet.infura.io";break;case"maticmum":n="polygon-mumbai.infura.io";break;case"optimism":n="optimism-mainnet.infura.io";break;case"optimism-goerli":n="optimism-goerli.infura.io";break;case"arbitrum":n="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":n="arbitrum-goerli.infura.io";break;default:Pi.throwError("unsupported network",To.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}var o={allowGzip:!0,url:"https://"+n+"/v3/"+t.projectId,throttleCallback:function(s,c){return t.projectId===sn&&(0,_h.showThrottleMessage)(),Promise.resolve(!0)}};return t.projectSecret!=null&&(o.user="",o.password=t.projectSecret),o},r.prototype.isCommunityResource=function(){return this.projectId===sn},r}(Eh.UrlJsonRpcProvider);Cr.InfuraProvider=qc});var Mc=E(_t=>{"use strict";d();h();var Ph=_t&&_t.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(_t,"__esModule",{value:!0});_t.JsonRpcBatchProvider=void 0;var kh=re(),Sh=ft(),Oh=pt(),Rh=function(i){Ph(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.send=function(e,t){var n=this,o={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this._pendingBatch==null&&(this._pendingBatch=[]);var s={request:o,resolve:null,reject:null},c=new Promise(function(u,a){s.resolve=u,s.reject=a});return this._pendingBatch.push(s),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(function(){var u=n._pendingBatch;n._pendingBatch=null,n._pendingBatchAggregator=null;var a=u.map(function(f){return f.request});return n.emit("debug",{action:"requestBatch",request:(0,kh.deepCopy)(a),provider:n}),(0,Sh.fetchJson)(n.connection,JSON.stringify(a)).then(function(f){n.emit("debug",{action:"response",request:a,response:f,provider:n}),u.forEach(function(l,p){var y=f[p];if(y.error){var S=new Error(y.error.message);S.code=y.error.code,S.data=y.error.data,l.reject(S)}else l.resolve(y.result)})},function(f){n.emit("debug",{action:"response",error:f,request:a,provider:n}),u.forEach(function(l){l.reject(f)})})},10)),c},r}(Oh.JsonRpcProvider);_t.JsonRpcBatchProvider=Rh});var Uc=E(wt=>{"use strict";d();h();var Ah=wt&&wt.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(wt,"__esModule",{value:!0});wt.NodesmithProvider=void 0;var Th=Or(),Ch=U(),Nh=ye(),Co=new Ch.Logger(Nh.version),Lh="ETHERS_JS_SHARED",Bh=function(i){Ah(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.getApiKey=function(e){return e&&typeof e!="string"&&Co.throwArgumentError("invalid apiKey","apiKey",e),e||Lh},r.getUrl=function(e,t){Co.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");var n=null;switch(e.name){case"homestead":n="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":n="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":n="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":n="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":n="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Co.throwArgumentError("unsupported network","network",arguments[0])}return n+"?apiKey="+t},r}(Th.UrlJsonRpcProvider);wt.NodesmithProvider=Bh});var Jc=E(Et=>{"use strict";d();h();var Ih=Et&&Et.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Et,"__esModule",{value:!0});Et.PocketProvider=void 0;var Hc=U(),Fh=ye(),Wc=new Hc.Logger(Fh.version),jh=Or(),Gc="62e1ad51b37b8e00394bda3b",qh=function(i){Ih(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.getApiKey=function(e){var t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return e==null?t.applicationId=Gc:typeof e=="string"?t.applicationId=e:e.applicationSecretKey!=null?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:Wc.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t},r.getUrl=function(e,t){var n=null;switch(e?e.name:"unknown"){case"goerli":n="eth-goerli.gateway.pokt.network";break;case"homestead":n="eth-mainnet.gateway.pokt.network";break;case"kovan":n="poa-kovan.gateway.pokt.network";break;case"matic":n="poly-mainnet.gateway.pokt.network";break;case"maticmum":n="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":n="eth-rinkeby.gateway.pokt.network";break;case"ropsten":n="eth-ropsten.gateway.pokt.network";break;default:Wc.throwError("unsupported network",Hc.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}var o="https://"+n+"/v1/lb/"+t.applicationId,s={headers:{},url:o};return t.applicationSecretKey!=null&&(s.user="",s.password=t.applicationSecretKey),s},r.prototype.isCommunityResource=function(){return this.applicationId===Gc},r}(jh.UrlJsonRpcProvider);Et.PocketProvider=qh});var zc=E(Pt=>{"use strict";d();h();var Dh=Pt&&Pt.__extends||function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}}();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Web3Provider=void 0;var ki=re(),Mh=U(),Uh=ye(),Kc=new Mh.Logger(Uh.version),Wh=pt(),Gh=1;function Vc(i,r){var e="Web3LegacyFetcher";return function(t,n){var o=this,s={method:t,params:n,id:Gh++,jsonrpc:"2.0"};return new Promise(function(c,u){o.emit("debug",{action:"request",fetcher:e,request:(0,ki.deepCopy)(s),provider:o}),r(s,function(a,f){if(a)return o.emit("debug",{action:"response",fetcher:e,error:a,request:s,provider:o}),u(a);if(o.emit("debug",{action:"response",fetcher:e,request:s,response:f,provider:o}),f.error){var l=new Error(f.error.message);return l.code=f.error.code,l.data=f.error.data,u(l)}c(f.result)})})}}function Hh(i){return function(r,e){var t=this;e==null&&(e=[]);var n={method:r,params:e};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,ki.deepCopy)(n),provider:this}),i.request(n).then(function(o){return t.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:o,provider:t}),o},function(o){throw t.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:o,provider:t}),o})}}var Jh=function(i){Dh(r,i);function r(e,t){var n=this;e==null&&Kc.throwArgumentError("missing provider","provider",e);var o=null,s=null,c=null;return typeof e=="function"?(o="unknown:",s=e):(o=e.host||e.path||"",!o&&e.isMetaMask&&(o="metamask"),c=e,e.request?(o===""&&(o="eip-1193:"),s=Hh(e)):e.sendAsync?s=Vc(e,e.sendAsync.bind(e)):e.send?s=Vc(e,e.send.bind(e)):Kc.throwArgumentError("unsupported provider","provider",e),o||(o="unknown:")),n=i.call(this,o,t)||this,(0,ki.defineReadOnly)(n,"jsonRpcFetchFunc",s),(0,ki.defineReadOnly)(n,"provider",c),n}return r.prototype.send=function(e,t){return this.jsonRpcFetchFunc(e,t)},r}(Wh.JsonRpcProvider);Pt.Web3Provider=Jh});var $h=E(R=>{"use strict";d();h();Object.defineProperty(R,"__esModule",{value:!0});R.Formatter=R.showThrottleMessage=R.isCommunityResourcable=R.isCommunityResource=R.getNetwork=R.getDefaultProvider=R.JsonRpcSigner=R.IpcProvider=R.WebSocketProvider=R.Web3Provider=R.StaticJsonRpcProvider=R.PocketProvider=R.NodesmithProvider=R.JsonRpcBatchProvider=R.JsonRpcProvider=R.InfuraWebSocketProvider=R.InfuraProvider=R.EtherscanProvider=R.CloudflareProvider=R.AnkrProvider=R.AlchemyWebSocketProvider=R.AlchemyProvider=R.FallbackProvider=R.UrlJsonRpcProvider=R.Resolver=R.BaseProvider=R.Provider=void 0;var Kh=tt();Object.defineProperty(R,"Provider",{enumerable:!0,get:function(){return Kh.Provider}});var $c=lo();Object.defineProperty(R,"getNetwork",{enumerable:!0,get:function(){return $c.getNetwork}});var Xc=Yt();Object.defineProperty(R,"BaseProvider",{enumerable:!0,get:function(){return Xc.BaseProvider}});Object.defineProperty(R,"Resolver",{enumerable:!0,get:function(){return Xc.Resolver}});var No=wc();Object.defineProperty(R,"AlchemyProvider",{enumerable:!0,get:function(){return No.AlchemyProvider}});Object.defineProperty(R,"AlchemyWebSocketProvider",{enumerable:!0,get:function(){return No.AlchemyWebSocketProvider}});var Qc=Ec();Object.defineProperty(R,"AnkrProvider",{enumerable:!0,get:function(){return Qc.AnkrProvider}});var Yc=kc();Object.defineProperty(R,"CloudflareProvider",{enumerable:!0,get:function(){return Yc.CloudflareProvider}});var eu=Ac();Object.defineProperty(R,"EtherscanProvider",{enumerable:!0,get:function(){return eu.EtherscanProvider}});var ru=Bc();Object.defineProperty(R,"FallbackProvider",{enumerable:!0,get:function(){return ru.FallbackProvider}});var tu=Ic();Object.defineProperty(R,"IpcProvider",{enumerable:!0,get:function(){return tu.IpcProvider}});var Lo=Dc();Object.defineProperty(R,"InfuraProvider",{enumerable:!0,get:function(){return Lo.InfuraProvider}});Object.defineProperty(R,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return Lo.InfuraWebSocketProvider}});var Si=pt();Object.defineProperty(R,"JsonRpcProvider",{enumerable:!0,get:function(){return Si.JsonRpcProvider}});Object.defineProperty(R,"JsonRpcSigner",{enumerable:!0,get:function(){return Si.JsonRpcSigner}});var Vh=Mc();Object.defineProperty(R,"JsonRpcBatchProvider",{enumerable:!0,get:function(){return Vh.JsonRpcBatchProvider}});var nu=Uc();Object.defineProperty(R,"NodesmithProvider",{enumerable:!0,get:function(){return nu.NodesmithProvider}});var iu=Jc();Object.defineProperty(R,"PocketProvider",{enumerable:!0,get:function(){return iu.PocketProvider}});var ou=Or();Object.defineProperty(R,"StaticJsonRpcProvider",{enumerable:!0,get:function(){return ou.StaticJsonRpcProvider}});Object.defineProperty(R,"UrlJsonRpcProvider",{enumerable:!0,get:function(){return ou.UrlJsonRpcProvider}});var au=zc();Object.defineProperty(R,"Web3Provider",{enumerable:!0,get:function(){return au.Web3Provider}});var su=hi();Object.defineProperty(R,"WebSocketProvider",{enumerable:!0,get:function(){return su.WebSocketProvider}});var Oi=kr();Object.defineProperty(R,"Formatter",{enumerable:!0,get:function(){return Oi.Formatter}});Object.defineProperty(R,"isCommunityResourcable",{enumerable:!0,get:function(){return Oi.isCommunityResourcable}});Object.defineProperty(R,"isCommunityResource",{enumerable:!0,get:function(){return Oi.isCommunityResource}});Object.defineProperty(R,"showThrottleMessage",{enumerable:!0,get:function(){return Oi.showThrottleMessage}});var cu=U(),zh=ye(),Zc=new cu.Logger(zh.version);function Zh(i,r){if(i==null&&(i="homestead"),typeof i=="string"){var e=i.match(/^(ws|http)s?:/i);if(e)switch(e[1].toLowerCase()){case"http":case"https":return new Si.JsonRpcProvider(i);case"ws":case"wss":return new su.WebSocketProvider(i);default:Zc.throwArgumentError("unsupported URL scheme","network",i)}}var t=(0,$c.getNetwork)(i);return(!t||!t._defaultProvider)&&Zc.throwError("unsupported getDefaultProvider network",cu.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:i}),t._defaultProvider({FallbackProvider:ru.FallbackProvider,AlchemyProvider:No.AlchemyProvider,AnkrProvider:Qc.AnkrProvider,CloudflareProvider:Yc.CloudflareProvider,EtherscanProvider:eu.EtherscanProvider,InfuraProvider:Lo.InfuraProvider,JsonRpcProvider:Si.JsonRpcProvider,NodesmithProvider:nu.NodesmithProvider,PocketProvider:iu.PocketProvider,Web3Provider:au.Web3Provider,IpcProvider:tu.IpcProvider},r)}R.getDefaultProvider=Zh});var uu=E(Ri=>{"use strict";d();h();Object.defineProperty(Ri,"__esModule",{value:!0});Ri.version=void 0;Ri.version="solidity/5.7.0"});var ux=E(Nr=>{"use strict";d();h();Object.defineProperty(Nr,"__esModule",{value:!0});Nr.sha256=Nr.keccak256=Nr.pack=void 0;var Xh=Oe(),Me=ee(),Qh=St(),Yh=Ut(),ex=dr(),rx=new RegExp("^bytes([0-9]+)$"),tx=new RegExp("^(u?int)([0-9]*)$"),nx=new RegExp("^(.*)\\[([0-9]*)\\]$"),ix="0000000000000000000000000000000000000000000000000000000000000000",ox=U(),ax=uu(),kt=new ox.Logger(ax.version);function fu(i,r,e){switch(i){case"address":return e?(0,Me.zeroPad)(r,32):(0,Me.arrayify)(r);case"string":return(0,ex.toUtf8Bytes)(r);case"bytes":return(0,Me.arrayify)(r);case"bool":return r=r?"0x01":"0x00",e?(0,Me.zeroPad)(r,32):(0,Me.arrayify)(r)}var t=i.match(tx);if(t){var n=parseInt(t[2]||"256");return(t[2]&&String(n)!==t[2]||n%8!==0||n===0||n>256)&&kt.throwArgumentError("invalid number type","type",i),e&&(n=256),r=Xh.BigNumber.from(r).toTwos(n),(0,Me.zeroPad)(r,n/8)}if(t=i.match(rx),t){var n=parseInt(t[1]);return(String(n)!==t[1]||n===0||n>32)&&kt.throwArgumentError("invalid bytes type","type",i),(0,Me.arrayify)(r).byteLength!==n&&kt.throwArgumentError("invalid value for "+i,"value",r),e?(0,Me.arrayify)((r+ix).substring(0,66)):r}if(t=i.match(nx),t&&Array.isArray(r)){var o=t[1],s=parseInt(t[2]||String(r.length));s!=r.length&&kt.throwArgumentError("invalid array length for "+i,"value",r);var c=[];return r.forEach(function(u){c.push(fu(o,u,!0))}),(0,Me.concat)(c)}return kt.throwArgumentError("invalid type","type",i)}function Bo(i,r){i.length!=r.length&&kt.throwArgumentError("wrong number of values; expected ${ types.length }","values",r);var e=[];return i.forEach(function(t,n){e.push(fu(t,r[n]))}),(0,Me.hexlify)((0,Me.concat)(e))}Nr.pack=Bo;function sx(i,r){return(0,Qh.keccak256)(Bo(i,r))}Nr.keccak256=sx;function cx(i,r){return(0,Yh.sha256)(Bo(i,r))}Nr.sha256=cx});export{va as a,fn as b,K0 as c,Zi as d,Ut as e,Fa as f,Yi as g,zn as h,Es as i,ml as j,ft as k,$h as l,ux as m};
window.inOKXExtension = true;
window.inMiniApp = false;
window.ASSETS_BUILD_TYPE = "publish";
//# sourceMappingURL=chunk-M3ECH327.js.map