(function(global,factory){typeofexports==="object"&&typeofmodule!=="undefined"?module.exports=factory():typeofdefine==="function"&&define.amd?define(factory):(global=typeofglobalThis!=="undefined"?globalThis:global||self,global.ethers=factory())})(this,function(){"use strict";varcommonjsGlobal=typeofglobalThis!=="undefined"?globalThis:typeofwindow!=="undefined"?window:typeofglobal!=="undefined"?global:typeofself!=="undefined"?self:{};functiongetDefaultExportFromCjs(x){returnx&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x}functioncreateCommonjsModule(fn,basedir,module){returnmodule={path:basedir,exports:{},require:function(path,base){returncommonjsRequire(path,base===undefined||base===null?module.path:base)}},fn(module,module.exports),module.exports}functiongetDefaultExportFromNamespaceIfPresent(n){returnn&&Object.prototype.hasOwnProperty.call(n,"default")?n["default"]:n}functiongetDefaultExportFromNamespaceIfNotNamed(n){returnn&&Object.prototype.hasOwnProperty.call(n,"default")&&Object.keys(n).length===1?n["default"]:n}functiongetAugmentedNamespace(n){if(n.__esModule)returnn;vara=Object.defineProperty({},"__esModule",{value:true});Object.keys(n).forEach(function(k){vard=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){returnn[k]}})});returna}functioncommonjsRequire(){thrownewError("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}varbn=createCommonjsModule(function(module){(function(module,exports){"use strict";functionassert(val,msg){if(!val)thrownewError(msg||"Assertion failed")}functioninherits(ctor,superCtor){ctor.super_=superCtor;varTempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=newTempCtor;ctor.prototype.constructor=ctor}functionBN(number,base,endian){if(BN.isBN(number)){returnnumber}this.negative=0;this.words=null;this.length=0;this.red=null;if(number!==null){if(base==="le"||base==="be"){endian=base;base=10}this._init(number||0,base||10,endian||"be")}}if(typeofmodule==="object"){module.exports=BN}else{exports.BN=BN}BN.BN=BN;BN.wordSize=26;varBuffer;try{if(typeofwindow!=="undefined"&&typeofwindow.Buffer!=="undefined"){Buffer=window.Buffer}else{Buffer=null.Buffer}}catch(e){}BN.isBN=functionisBN(num){if(numinstanceofBN){returntrue}returnnum!==null&&typeofnum==="object"&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)};BN.max=functionmax(left,right){if(left.cmp(right)>0)returnleft;returnright};BN.min=functionmin(left,right){if(left.cmp(right)<0)returnleft;returnright};BN.prototype._init=functioninit(number,base,endian){if(typeofnumber==="number"){returnthis._initNumber(number,base,endian)}if(typeofnumber==="object"){returnthis._initArray(number,base,endian)}if(base==="hex"){base=16}assert(base===(base|0)&&base>=2&&base<=36);number=number.toString().replace(/\s+/g,"");varstart=0;if(number[0]==="-"){start++;this.negative=1}if(start<number.length){if(base===16){this._parseHex(number,start,endian)}else{this._parseBase(number,base,start);if(endian==="le"){this._initArray(this.toArray(),base,endian)}}}};BN.prototype._initNumber=function_initNumber(number,base,endian){if(number<0){this.negative=1;number=-number}if(number<67108864){this.words=[number&67108863];this.length=1}elseif(number<4503599627370496){this.words=[number&67108863,number/67108864&67108863];this.length=2}else{assert(number<9007199254740992);this.words=[number&67108863,number/67108864&67108863,1];this.length=3}if(endian!=="le")return;this._initArray(this.toArray(),base,endian)};BN.prototype._initArray=function_initArray(number,base,endian){assert(typeofnumber.length==="number");if(number.length<=0){this.words=[0];this.length=1;returnthis}this.length=Math.ceil(number.length/3);this.words=newArray(this.length);for(vari=0;i<this.length;i++){this.words[i]=0}varj,w;varoff=0;if(endian==="be"){for(i=number.length-1,j=0;i>=0;i-=3){w=number[i]|number[i-1]<<8|number[i-2]<<16;this.words[j]|=w<<off&67108863;this.words[j+1]=w>>>26-off&67108863;off+=