/*! For license information please see ../LICENSES */!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports;}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n});},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t];}.bind(null,o));return n;},r.n=function(e){var t=e&&e.__esModule?function(){return e.default;}:function(){return e;};return r.d(t,"a",t),t;},r.o=function(object,e){return Object.prototype.hasOwnProperty.call(object,e);},r.p="/_nuxt/",r(r.s=146);}([function(e,t,r){"use strict";r.d(t,"k",function(){return l;}),r.d(t,"j",function(){return d;}),r.d(t,"a",function(){return f;}),r.d(t,"b",function(){return h;}),r.d(t,"o",function(){return m;}),r.d(t,"p",function(){return y;}),r.d(t,"l",function(){return v;}),r.d(t,"i",function(){return w;}),r.d(t,"d",function(){return A;}),r.d(t,"e",function(){return E;}),r.d(t,"c",function(){return S;}),r.d(t,"g",function(){return O;}),r.d(t,"f",function(){return _;}),r.d(t,"h",function(){return M;}),r.d(t,"n",function(){return k;}),r.d(t,"m",function(){return C;});const n=new(r(2).b)("bytes/5.4.0");function o(e){return!!e.toHexString;}function c(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return c(new Uint8Array(Array.prototype.slice.apply(e,t)));}),e;}function l(e){return v(e)&&!(e.length%2)||d(e);}function d(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(null==e.length)return!1;for(let i=0;i=256||t%1)return!1;}return!0;}function f(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),c(new Uint8Array(t));}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e)&&(e=e.toHexString()),v(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0x0"+r.substring(2):"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));const o=[];for(let i=0;if(e)),r=t.reduce((e,t)=>e+t.length,0),n=new Uint8Array(r);return t.reduce((e,object)=>(n.set(object,e),e+object.length),0),c(n);}function m(e){let t=f(e);if(0===t.length)return t;let r=0;for(;rt&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),c(r);}function v(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t);}const T="0123456789abcdef";function w(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=T[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00";}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e))return e.toHexString();if(v(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(d(e)){let t="0x";for(let i=0;i>4]+T[15&r];}return t;}return n.throwArgumentError("invalid hexlify value","value",e);}function A(data){if("string"!=typeof data)data=w(data);else if(!v(data)||data.length%2)return null;return(data.length-2)/2;}function E(data,e,t){return"string"!=typeof data?data=w(data):(!v(data)||data.length%2)&&n.throwArgumentError("invalid hexData","value",data),e=2+2*e,null!=t?"0x"+data.substring(e,2+2*t):"0x"+data.substring(e);}function S(e){let t="0x";return e.forEach(e=>{t+=w(e).substring(2);}),t;}function O(e){const t=_(w(e,{hexPad:"left"}));return"0x"===t?"0x0":t;}function _(e){"string"!=typeof e&&(e=w(e)),v(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e;}function k(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(l(e)){const r=f(e);65!==r.length&&n.throwArgumentError("invalid signature string; must be 65 bytes","signature",e),t.r=w(r.slice(0,32)),t.s=w(r.slice(32,64)),t.v=r[64],t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=w(r.slice(32,64));}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=y(f(t._vs),32);t._vs=w(r);const o=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const s=w(r);null==t.s?t.s=s:t.s!==s&&n.throwArgumentError("signature v mismatch _vs","signature",e);}null==t.recoveryParam?null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2:null==t.v?t.v=27+t.recoveryParam:t.recoveryParam!==1-t.v%2&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e),null!=t.r&&v(t.r)?t.r=M(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&v(t.s)?t.s=M(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);const r=f(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const o=w(r);t._vs&&(v(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=M(t._vs,32)),null==t._vs?t._vs=o:t._vs!==o&&n.throwArgumentError("signature _vs mismatch v and s","signature",e);}return t;}function C(e){return w(h([(e=k(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]));}},function(e,t,r){"use strict";r.d(t,"d",function(){return l;}),r.d(t,"e",function(){return d;}),r.d(t,"f",function(){return f;}),r.d(t,"b",function(){return h;}),r.d(t,"g",function(){return m;}),r.d(t,"c",function(){return w;}),r.d(t,"a",function(){return A;});var n=r(2);var o=function(e,t,r,n){return new(r||(r=Promise))(function(o,c){function l(e){try{f(n.next(e));}catch(e){c(e);}}function d(e){try{f(n.throw(e));}catch(e){c(e);}}function f(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t);})).then(l,d);}f((n=n.apply(e,t||[])).next());});};const c=new n.b("properties/5.4.1");function l(object,e,t){Object.defineProperty(object,e,{enumerable:!0,value:t,writable:!1});}function d(e,t){for(let i=0;i<32;i++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor;}return null;}function f(object){return o(this,void 0,void 0,function*(){const e=Object.keys(object).map(e=>{const t=object[e];return Promise.resolve(t).then(t=>({key:e,value:t}));});return(yield Promise.all(e)).reduce((e,t)=>(e[t.key]=t.value,e),{});});}function h(object,e){object&&"object"==typeof object||c.throwArgumentError("invalid object","object",object),Object.keys(object).forEach(t=>{e[t]||c.throwArgumentError("invalid object key - "+t,"transaction:"+t,object);});}function m(object){const e={};for(const t in object)e[t]=object[t];return e;}const y={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function v(object){if(null==object||y[typeof object])return!0;if(Array.isArray(object)||"object"==typeof object){if(!Object.isFrozen(object))return!1;const e=Object.keys(object);for(let i=0;iw(e)));if("object"==typeof object){const e={};for(const t in object){const r=object[t];void 0!==r&&l(e,t,w(r));}return e;}return c.throwArgumentError("Cannot deepCopy "+typeof object,"object",object);}function w(object){return T(object);}class A{constructor(e){for(const t in e)this[t]=w(e[t]);}}},function(e,t,r){"use strict";r.d(t,"a",function(){return m;}),r.d(t,"b",function(){return v;});let n=!1,o=!1;const c={debug:1,default:2,info:2,warning:3,error:4,off:5};let l=c.default,d=null;const f=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test"!=="test".normalize(form))throw new Error("bad normalize");}catch(t){e.push(form);}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation");}catch(e){return e.message;}return null;}();var h,m;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF";}(h||(h={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED";}(m||(m={}));const y="0123456789abcdef";class v{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1});}_log(e,t){const r=e.toLowerCase();null==c[r]&&this.throwArgumentError("invalid log level name","logLevel",e),l>c[r]||console.log.apply(console,t);}debug(...e){this._log(v.levels.DEBUG,e);}info(...e){this._log(v.levels.INFO,e);}warn(...e){this._log(v.levels.WARNING,e);}makeError(e,code,t){if(o)return this.makeError("censored error",code,{});code||(code=v.errors.UNKNOWN_ERROR),t||(t={});const r=[];Object.keys(t).forEach(e=>{const n=t[e];try{if(n instanceof Uint8Array){let t="";for(let i=0;i>4],t+=y[15&n[i]];r.push(e+"=Uint8Array(0x"+t+")");}else r.push(e+"="+JSON.stringify(n));}catch(n){r.push(e+"="+JSON.stringify(t[e].toString()));}}),r.push(`code=${code}`),r.push(`version=${this.version}`);const n=e;r.length&&(e+=" ("+r.join(", ")+")");const c=new Error(e);return c.reason=n,c.code=code,Object.keys(t).forEach(function(e){c[e]=t[e];}),c;}throwError(e,code,t){throw this.makeError(e,code,t);}throwArgumentError(e,t,r){return this.throwError(e,v.errors.INVALID_ARGUMENT,{argument:t,value:r});}assert(e,t,code,r){e||this.throwError(t,code,r);}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n);}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),f&&this.throwError("platform missing String.prototype.normalize",v.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f});}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,v.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,v.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}));}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,v.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t});}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",v.errors.MISSING_NEW,{name:t.name});}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",v.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",v.errors.MISSING_NEW,{name:t.name});}static globalLogger(){return d||(d=new v("logger/5.4.1")),d;}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",v.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!e)return;this.globalLogger().throwError("error censorship permanent",v.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"});}o=!!e,n=!!t;}static setLogLevel(e){const t=c[e.toLowerCase()];null!=t?l=t:v.globalLogger().warn("invalid log level - "+e);}static from(e){return new v(e);}}v.errors=m,v.levels=h;},function(e,t,r){"use strict";r.d(t,"a",function(){return T;}),r.d(t,"e",function(){return w;}),r.d(t,"d",function(){return A;}),r.d(t,"b",function(){return E;}),r.d(t,"c",function(){return S;});var n=r(0),o=r(12),c=r(5),l=r(28);const d=new(r(2).b)("address/5.4.0");function f(address){Object(n.l)(address,20)||d.throwArgumentError("invalid address","address",address);const e=(address=address.toLowerCase()).substring(2).split(""),t=new Uint8Array(40);for(let i=0;i<40;i++)t[i]=e[i].charCodeAt(0);const r=Object(n.a)(Object(c.a)(t));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("");}const h={};for(let i=0;i<10;i++)h[String(i)]=String(i);for(let i=0;i<26;i++)h[String.fromCharCode(65+i)]=String(10+i);const m=Math.floor((y=9007199254740991,Math.log10?Math.log10(y):Math.log(y)/Math.LN10));var y;function v(address){let e=(address=(address=address.toUpperCase()).substring(4)+address.substring(0,2)+"00").split("").map(e=>h[e]).join("");for(;e.length>=m;){let t=e.substring(0,m);e=parseInt(t,10)%97+e.substring(t.length);}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t;}function T(address){let e=null;if("string"!=typeof address&&d.throwArgumentError("invalid address","address",address),address.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==address.substring(0,2)&&(address="0x"+address),e=f(address),address.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==address&&d.throwArgumentError("bad address checksum","address",address);else if(address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(address.substring(2,4)!==v(address)&&d.throwArgumentError("bad icap checksum","address",address),e=Object(o.c)(address.substring(4));e.length<40;)e="0"+e;e=f("0x"+e);}else d.throwArgumentError("invalid address","address",address);return e;}function w(address){try{return T(address),!0;}catch(e){}return!1;}function A(address){let e=Object(o.b)(T(address).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+v("XE00"+e)+e;}function E(e){let t=null;try{t=T(e.from);}catch(t){d.throwArgumentError("missing from address","transaction",e);}const r=Object(n.o)(Object(n.a)(o.a.from(e.nonce).toHexString()));return T(Object(n.e)(Object(c.a)(Object(l.encode)([t,r])),12));}function S(e,t,r){return 32!==Object(n.d)(t)&&d.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(n.d)(r)&&d.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),T(Object(n.e)(Object(c.a)(Object(n.b)(["0xff",T(e),t,r])),12));}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed");}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r(),e.prototype.constructor=e;}function c(e,base,t){if(c.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==base&&"be"!==base||(t=base,base=10),this._init(e||0,base||10,t||"be"));}var l;"object"==typeof e?e.exports=c:t.BN=c,c.BN=c,c.wordSize=26;try{l="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(149).Buffer;}catch(e){}function d(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15;}function f(e,t,r){var n=d(e,r);return r-1>=t&&(n|=d(e,r-1)<<4),n;}function h(e,t,r,n){for(var o=0,c=Math.min(e.length,r),i=t;i=49?l-49+10:l>=17?l-17+10:l;}return o;}c.isBN=function(e){return e instanceof c||null!==e&&"object"==typeof e&&e.constructor.wordSize===c.wordSize&&Array.isArray(e.words);},c.max=function(e,t){return e.cmp(t)>0?e:t;},c.min=function(e,t){return e.cmp(t)<0?e:t;},c.prototype._init=function(e,base,t){if("number"==typeof e)return this._initNumber(e,base,t);if("object"==typeof e)return this._initArray(e,base,t);"hex"===base&&(base=16),n(base===(0|base)&&base>=2&&base<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[r]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,r++);else if("le"===t)for(i=0,r=0;i>>26-c&67108863,(c+=24)>=26&&(c-=26,r++);return this.strip();},c.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=f(e,t,i)<=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(o-=18,c+=1,this.words[c]|=n>>>26):o+=8;this.strip();},c.prototype._parseBase=function(e,base,t){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=base)r++;r--,n=n/base|0;for(var o=e.length-t,c=o%r,l=Math.min(o,o-c)+t,d=0,i=t;i1&&0===this.words[this.length-1];)this.length--;return this._normSign();},c.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this;},c.prototype.inspect=function(){return(this.red?"";};var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],v=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function T(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],b=0|t.words[0],o=a*b,c=67108863&o,l=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,h=67108863&l,m=Math.min(d,t.length-1),y=Math.max(0,d-e.length+1);y<=m;y++){var i=d-y|0;f+=(o=(a=0|e.words[i])*(b=0|t.words[y])+h)/67108864|0,h=67108863&o;}r.words[d]=0|h,l=0|f;}return 0!==l?r.words[d]=0|l:r.length--,r.strip();}c.prototype.toString=function(base,e){var t;if(e=0|e||1,16===(base=base||10)||"hex"===base){t="";for(var r=0,o=0,i=0;i>>24-r&16777215)||i!==this.length-1?m[6-l.length]+l+t:l+t,(r+=2)>=26&&(r-=26,i--);}for(0!==o&&(t=o.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t;}if(base===(0|base)&&base>=2&&base<=36){var d=y[base],f=v[base];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var T=h.modn(f).toString(base);t=(h=h.idivn(f)).isZero()?T+t:m[d-T.length]+T+t;}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t;}n(!1,"Base should be between 2 and 36");},c.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e;},c.prototype.toJSON=function(){return this.toString(16);},c.prototype.toBuffer=function(e,t){return n(void 0!==l),this.toArrayLike(l,e,t);},c.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t);},c.prototype.toArrayLike=function(e,t,r){var o=this.byteLength(),c=r||Math.max(1,o);n(o<=c,"byte array longer than desired length"),n(c>0,"Requested array length <= 0"),this.strip();var b,i,l="le"===t,d=new e(c),q=this.clone();if(l){for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),d[i]=b;for(;i=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t;},c.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r;},c.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t;},c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,i=0;ie.length?this.clone().ior(e):e.clone().ior(this);},c.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this);},c.prototype.iuand=function(e){var b;b=this.length>e.length?e:this;for(var i=0;ie.length?this.clone().iand(e):e.clone().iand(this);},c.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this);},c.prototype.iuxor=function(e){var a,b;this.length>e.length?(a=this,b=e):(a=e,b=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this);},c.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this);},c.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip();},c.prototype.notn=function(e){return this.clone().inotn(e);},c.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(a=this,b=e):(a=e,b=this);for(var r=0,i=0;i>>26;for(;0!==r&&i>>26;if(this.length=a.length,0!==r)this.words[this.length]=r,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this);},c.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign();}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,b,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(a=this,b=e):(a=e,b=this);for(var n=0,i=0;i>26,this.words[i]=67108863&t;for(;0!==n&&i>26,this.words[i]=67108863&t;if(0===n&&i>>13,y=0|a[1],v=8191&y,T=y>>>13,w=0|a[2],A=8191&w,E=w>>>13,S=0|a[3],O=8191&S,_=S>>>13,M=0|a[4],k=8191&M,C=M>>>13,P=0|a[5],F=8191&P,L=P>>>13,R=0|a[6],B=8191&R,N=R>>>13,x=0|a[7],j=8191&x,I=x>>>13,J=0|a[8],D=8191&J,X=J>>>13,G=0|a[9],H=8191&G,U=G>>>13,V=0|b[0],z=8191&V,Z=V>>>13,K=0|b[1],Q=8191&K,W=K>>>13,Y=0|b[2],$=8191&Y,ee=Y>>>13,te=0|b[3],re=8191&te,ne=te>>>13,ie=0|b[4],ae=8191&ie,oe=ie>>>13,se=0|b[5],ue=8191&se,ce=se>>>13,le=0|b[6],de=8191&le,fe=le>>>13,he=0|b[7],pe=8191&he,me=he>>>13,ye=0|b[8],ge=8191&ye,be=ye>>>13,ve=0|b[9],Te=8191&ve,we=ve>>>13;r.negative=e.negative^t.negative,r.length=19;var Ae=(d+(n=Math.imul(h,z))|0)+((8191&(o=(o=Math.imul(h,Z))+Math.imul(m,z)|0))<<13)|0;d=((c=Math.imul(m,Z))+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(v,z),o=(o=Math.imul(v,Z))+Math.imul(T,z)|0,c=Math.imul(T,Z);var Ee=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(o=(o=o+Math.imul(h,W)|0)+Math.imul(m,Q)|0))<<13)|0;d=((c=c+Math.imul(m,W)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(A,z),o=(o=Math.imul(A,Z))+Math.imul(E,z)|0,c=Math.imul(E,Z),n=n+Math.imul(v,Q)|0,o=(o=o+Math.imul(v,W)|0)+Math.imul(T,Q)|0,c=c+Math.imul(T,W)|0;var Se=(d+(n=n+Math.imul(h,$)|0)|0)+((8191&(o=(o=o+Math.imul(h,ee)|0)+Math.imul(m,$)|0))<<13)|0;d=((c=c+Math.imul(m,ee)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(O,z),o=(o=Math.imul(O,Z))+Math.imul(_,z)|0,c=Math.imul(_,Z),n=n+Math.imul(A,Q)|0,o=(o=o+Math.imul(A,W)|0)+Math.imul(E,Q)|0,c=c+Math.imul(E,W)|0,n=n+Math.imul(v,$)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(T,$)|0,c=c+Math.imul(T,ee)|0;var Oe=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(o=(o=o+Math.imul(h,ne)|0)+Math.imul(m,re)|0))<<13)|0;d=((c=c+Math.imul(m,ne)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(k,z),o=(o=Math.imul(k,Z))+Math.imul(C,z)|0,c=Math.imul(C,Z),n=n+Math.imul(O,Q)|0,o=(o=o+Math.imul(O,W)|0)+Math.imul(_,Q)|0,c=c+Math.imul(_,W)|0,n=n+Math.imul(A,$)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(E,$)|0,c=c+Math.imul(E,ee)|0,n=n+Math.imul(v,re)|0,o=(o=o+Math.imul(v,ne)|0)+Math.imul(T,re)|0,c=c+Math.imul(T,ne)|0;var _e=(d+(n=n+Math.imul(h,ae)|0)|0)+((8191&(o=(o=o+Math.imul(h,oe)|0)+Math.imul(m,ae)|0))<<13)|0;d=((c=c+Math.imul(m,oe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(F,z),o=(o=Math.imul(F,Z))+Math.imul(L,z)|0,c=Math.imul(L,Z),n=n+Math.imul(k,Q)|0,o=(o=o+Math.imul(k,W)|0)+Math.imul(C,Q)|0,c=c+Math.imul(C,W)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(_,$)|0,c=c+Math.imul(_,ee)|0,n=n+Math.imul(A,re)|0,o=(o=o+Math.imul(A,ne)|0)+Math.imul(E,re)|0,c=c+Math.imul(E,ne)|0,n=n+Math.imul(v,ae)|0,o=(o=o+Math.imul(v,oe)|0)+Math.imul(T,ae)|0,c=c+Math.imul(T,oe)|0;var Me=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(o=(o=o+Math.imul(h,ce)|0)+Math.imul(m,ue)|0))<<13)|0;d=((c=c+Math.imul(m,ce)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,z),o=(o=Math.imul(B,Z))+Math.imul(N,z)|0,c=Math.imul(N,Z),n=n+Math.imul(F,Q)|0,o=(o=o+Math.imul(F,W)|0)+Math.imul(L,Q)|0,c=c+Math.imul(L,W)|0,n=n+Math.imul(k,$)|0,o=(o=o+Math.imul(k,ee)|0)+Math.imul(C,$)|0,c=c+Math.imul(C,ee)|0,n=n+Math.imul(O,re)|0,o=(o=o+Math.imul(O,ne)|0)+Math.imul(_,re)|0,c=c+Math.imul(_,ne)|0,n=n+Math.imul(A,ae)|0,o=(o=o+Math.imul(A,oe)|0)+Math.imul(E,ae)|0,c=c+Math.imul(E,oe)|0,n=n+Math.imul(v,ue)|0,o=(o=o+Math.imul(v,ce)|0)+Math.imul(T,ue)|0,c=c+Math.imul(T,ce)|0;var ke=(d+(n=n+Math.imul(h,de)|0)|0)+((8191&(o=(o=o+Math.imul(h,fe)|0)+Math.imul(m,de)|0))<<13)|0;d=((c=c+Math.imul(m,fe)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(j,z),o=(o=Math.imul(j,Z))+Math.imul(I,z)|0,c=Math.imul(I,Z),n=n+Math.imul(B,Q)|0,o=(o=o+Math.imul(B,W)|0)+Math.imul(N,Q)|0,c=c+Math.imul(N,W)|0,n=n+Math.imul(F,$)|0,o=(o=o+Math.imul(F,ee)|0)+Math.imul(L,$)|0,c=c+Math.imul(L,ee)|0,n=n+Math.imul(k,re)|0,o=(o=o+Math.imul(k,ne)|0)+Math.imul(C,re)|0,c=c+Math.imul(C,ne)|0,n=n+Math.imul(O,ae)|0,o=(o=o+Math.imul(O,oe)|0)+Math.imul(_,ae)|0,c=c+Math.imul(_,oe)|0,n=n+Math.imul(A,ue)|0,o=(o=o+Math.imul(A,ce)|0)+Math.imul(E,ue)|0,c=c+Math.imul(E,ce)|0,n=n+Math.imul(v,de)|0,o=(o=o+Math.imul(v,fe)|0)+Math.imul(T,de)|0,c=c+Math.imul(T,fe)|0;var Ce=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(o=(o=o+Math.imul(h,me)|0)+Math.imul(m,pe)|0))<<13)|0;d=((c=c+Math.imul(m,me)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,z),o=(o=Math.imul(D,Z))+Math.imul(X,z)|0,c=Math.imul(X,Z),n=n+Math.imul(j,Q)|0,o=(o=o+Math.imul(j,W)|0)+Math.imul(I,Q)|0,c=c+Math.imul(I,W)|0,n=n+Math.imul(B,$)|0,o=(o=o+Math.imul(B,ee)|0)+Math.imul(N,$)|0,c=c+Math.imul(N,ee)|0,n=n+Math.imul(F,re)|0,o=(o=o+Math.imul(F,ne)|0)+Math.imul(L,re)|0,c=c+Math.imul(L,ne)|0,n=n+Math.imul(k,ae)|0,o=(o=o+Math.imul(k,oe)|0)+Math.imul(C,ae)|0,c=c+Math.imul(C,oe)|0,n=n+Math.imul(O,ue)|0,o=(o=o+Math.imul(O,ce)|0)+Math.imul(_,ue)|0,c=c+Math.imul(_,ce)|0,n=n+Math.imul(A,de)|0,o=(o=o+Math.imul(A,fe)|0)+Math.imul(E,de)|0,c=c+Math.imul(E,fe)|0,n=n+Math.imul(v,pe)|0,o=(o=o+Math.imul(v,me)|0)+Math.imul(T,pe)|0,c=c+Math.imul(T,me)|0;var Pe=(d+(n=n+Math.imul(h,ge)|0)|0)+((8191&(o=(o=o+Math.imul(h,be)|0)+Math.imul(m,ge)|0))<<13)|0;d=((c=c+Math.imul(m,be)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(H,z),o=(o=Math.imul(H,Z))+Math.imul(U,z)|0,c=Math.imul(U,Z),n=n+Math.imul(D,Q)|0,o=(o=o+Math.imul(D,W)|0)+Math.imul(X,Q)|0,c=c+Math.imul(X,W)|0,n=n+Math.imul(j,$)|0,o=(o=o+Math.imul(j,ee)|0)+Math.imul(I,$)|0,c=c+Math.imul(I,ee)|0,n=n+Math.imul(B,re)|0,o=(o=o+Math.imul(B,ne)|0)+Math.imul(N,re)|0,c=c+Math.imul(N,ne)|0,n=n+Math.imul(F,ae)|0,o=(o=o+Math.imul(F,oe)|0)+Math.imul(L,ae)|0,c=c+Math.imul(L,oe)|0,n=n+Math.imul(k,ue)|0,o=(o=o+Math.imul(k,ce)|0)+Math.imul(C,ue)|0,c=c+Math.imul(C,ce)|0,n=n+Math.imul(O,de)|0,o=(o=o+Math.imul(O,fe)|0)+Math.imul(_,de)|0,c=c+Math.imul(_,fe)|0,n=n+Math.imul(A,pe)|0,o=(o=o+Math.imul(A,me)|0)+Math.imul(E,pe)|0,c=c+Math.imul(E,me)|0,n=n+Math.imul(v,ge)|0,o=(o=o+Math.imul(v,be)|0)+Math.imul(T,ge)|0,c=c+Math.imul(T,be)|0;var Fe=(d+(n=n+Math.imul(h,Te)|0)|0)+((8191&(o=(o=o+Math.imul(h,we)|0)+Math.imul(m,Te)|0))<<13)|0;d=((c=c+Math.imul(m,we)|0)+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,n=Math.imul(H,Q),o=(o=Math.imul(H,W))+Math.imul(U,Q)|0,c=Math.imul(U,W),n=n+Math.imul(D,$)|0,o=(o=o+Math.imul(D,ee)|0)+Math.imul(X,$)|0,c=c+Math.imul(X,ee)|0,n=n+Math.imul(j,re)|0,o=(o=o+Math.imul(j,ne)|0)+Math.imul(I,re)|0,c=c+Math.imul(I,ne)|0,n=n+Math.imul(B,ae)|0,o=(o=o+Math.imul(B,oe)|0)+Math.imul(N,ae)|0,c=c+Math.imul(N,oe)|0,n=n+Math.imul(F,ue)|0,o=(o=o+Math.imul(F,ce)|0)+Math.imul(L,ue)|0,c=c+Math.imul(L,ce)|0,n=n+Math.imul(k,de)|0,o=(o=o+Math.imul(k,fe)|0)+Math.imul(C,de)|0,c=c+Math.imul(C,fe)|0,n=n+Math.imul(O,pe)|0,o=(o=o+Math.imul(O,me)|0)+Math.imul(_,pe)|0,c=c+Math.imul(_,me)|0,n=n+Math.imul(A,ge)|0,o=(o=o+Math.imul(A,be)|0)+Math.imul(E,ge)|0,c=c+Math.imul(E,be)|0;var Le=(d+(n=n+Math.imul(v,Te)|0)|0)+((8191&(o=(o=o+Math.imul(v,we)|0)+Math.imul(T,Te)|0))<<13)|0;d=((c=c+Math.imul(T,we)|0)+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(H,$),o=(o=Math.imul(H,ee))+Math.imul(U,$)|0,c=Math.imul(U,ee),n=n+Math.imul(D,re)|0,o=(o=o+Math.imul(D,ne)|0)+Math.imul(X,re)|0,c=c+Math.imul(X,ne)|0,n=n+Math.imul(j,ae)|0,o=(o=o+Math.imul(j,oe)|0)+Math.imul(I,ae)|0,c=c+Math.imul(I,oe)|0,n=n+Math.imul(B,ue)|0,o=(o=o+Math.imul(B,ce)|0)+Math.imul(N,ue)|0,c=c+Math.imul(N,ce)|0,n=n+Math.imul(F,de)|0,o=(o=o+Math.imul(F,fe)|0)+Math.imul(L,de)|0,c=c+Math.imul(L,fe)|0,n=n+Math.imul(k,pe)|0,o=(o=o+Math.imul(k,me)|0)+Math.imul(C,pe)|0,c=c+Math.imul(C,me)|0,n=n+Math.imul(O,ge)|0,o=(o=o+Math.imul(O,be)|0)+Math.imul(_,ge)|0,c=c+Math.imul(_,be)|0;var Re=(d+(n=n+Math.imul(A,Te)|0)|0)+((8191&(o=(o=o+Math.imul(A,we)|0)+Math.imul(E,Te)|0))<<13)|0;d=((c=c+Math.imul(E,we)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(H,re),o=(o=Math.imul(H,ne))+Math.imul(U,re)|0,c=Math.imul(U,ne),n=n+Math.imul(D,ae)|0,o=(o=o+Math.imul(D,oe)|0)+Math.imul(X,ae)|0,c=c+Math.imul(X,oe)|0,n=n+Math.imul(j,ue)|0,o=(o=o+Math.imul(j,ce)|0)+Math.imul(I,ue)|0,c=c+Math.imul(I,ce)|0,n=n+Math.imul(B,de)|0,o=(o=o+Math.imul(B,fe)|0)+Math.imul(N,de)|0,c=c+Math.imul(N,fe)|0,n=n+Math.imul(F,pe)|0,o=(o=o+Math.imul(F,me)|0)+Math.imul(L,pe)|0,c=c+Math.imul(L,me)|0,n=n+Math.imul(k,ge)|0,o=(o=o+Math.imul(k,be)|0)+Math.imul(C,ge)|0,c=c+Math.imul(C,be)|0;var Be=(d+(n=n+Math.imul(O,Te)|0)|0)+((8191&(o=(o=o+Math.imul(O,we)|0)+Math.imul(_,Te)|0))<<13)|0;d=((c=c+Math.imul(_,we)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(H,ae),o=(o=Math.imul(H,oe))+Math.imul(U,ae)|0,c=Math.imul(U,oe),n=n+Math.imul(D,ue)|0,o=(o=o+Math.imul(D,ce)|0)+Math.imul(X,ue)|0,c=c+Math.imul(X,ce)|0,n=n+Math.imul(j,de)|0,o=(o=o+Math.imul(j,fe)|0)+Math.imul(I,de)|0,c=c+Math.imul(I,fe)|0,n=n+Math.imul(B,pe)|0,o=(o=o+Math.imul(B,me)|0)+Math.imul(N,pe)|0,c=c+Math.imul(N,me)|0,n=n+Math.imul(F,ge)|0,o=(o=o+Math.imul(F,be)|0)+Math.imul(L,ge)|0,c=c+Math.imul(L,be)|0;var Ne=(d+(n=n+Math.imul(k,Te)|0)|0)+((8191&(o=(o=o+Math.imul(k,we)|0)+Math.imul(C,Te)|0))<<13)|0;d=((c=c+Math.imul(C,we)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(H,ue),o=(o=Math.imul(H,ce))+Math.imul(U,ue)|0,c=Math.imul(U,ce),n=n+Math.imul(D,de)|0,o=(o=o+Math.imul(D,fe)|0)+Math.imul(X,de)|0,c=c+Math.imul(X,fe)|0,n=n+Math.imul(j,pe)|0,o=(o=o+Math.imul(j,me)|0)+Math.imul(I,pe)|0,c=c+Math.imul(I,me)|0,n=n+Math.imul(B,ge)|0,o=(o=o+Math.imul(B,be)|0)+Math.imul(N,ge)|0,c=c+Math.imul(N,be)|0;var xe=(d+(n=n+Math.imul(F,Te)|0)|0)+((8191&(o=(o=o+Math.imul(F,we)|0)+Math.imul(L,Te)|0))<<13)|0;d=((c=c+Math.imul(L,we)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(H,de),o=(o=Math.imul(H,fe))+Math.imul(U,de)|0,c=Math.imul(U,fe),n=n+Math.imul(D,pe)|0,o=(o=o+Math.imul(D,me)|0)+Math.imul(X,pe)|0,c=c+Math.imul(X,me)|0,n=n+Math.imul(j,ge)|0,o=(o=o+Math.imul(j,be)|0)+Math.imul(I,ge)|0,c=c+Math.imul(I,be)|0;var je=(d+(n=n+Math.imul(B,Te)|0)|0)+((8191&(o=(o=o+Math.imul(B,we)|0)+Math.imul(N,Te)|0))<<13)|0;d=((c=c+Math.imul(N,we)|0)+(o>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(H,pe),o=(o=Math.imul(H,me))+Math.imul(U,pe)|0,c=Math.imul(U,me),n=n+Math.imul(D,ge)|0,o=(o=o+Math.imul(D,be)|0)+Math.imul(X,ge)|0,c=c+Math.imul(X,be)|0;var Ie=(d+(n=n+Math.imul(j,Te)|0)|0)+((8191&(o=(o=o+Math.imul(j,we)|0)+Math.imul(I,Te)|0))<<13)|0;d=((c=c+Math.imul(I,we)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(H,ge),o=(o=Math.imul(H,be))+Math.imul(U,ge)|0,c=Math.imul(U,be);var Je=(d+(n=n+Math.imul(D,Te)|0)|0)+((8191&(o=(o=o+Math.imul(D,we)|0)+Math.imul(X,Te)|0))<<13)|0;d=((c=c+Math.imul(X,we)|0)+(o>>>13)|0)+(Je>>>26)|0,Je&=67108863;var De=(d+(n=Math.imul(H,Te))|0)+((8191&(o=(o=Math.imul(H,we))+Math.imul(U,Te)|0))<<13)|0;return d=((c=Math.imul(U,we))+(o>>>13)|0)+(De>>>26)|0,De&=67108863,l[0]=Ae,l[1]=Ee,l[2]=Se,l[3]=Oe,l[4]=_e,l[5]=Me,l[6]=ke,l[7]=Ce,l[8]=Pe,l[9]=Fe,l[10]=Le,l[11]=Re,l[12]=Be,l[13]=Ne,l[14]=xe,l[15]=je,l[16]=Ie,l[17]=Je,l[18]=De,0!==d&&(l[19]=d,r.length++),r;};function A(e,t,r){return new E().mulp(e,t,r);}function E(e,t){this.x=e,this.y=t;}Math.imul||(w=T),c.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?w(this,e,t):n<63?T(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,c=0;c>>26)|0)>>>26,l&=67108863;}r.words[c]=d,n=l,l=o;}return 0!==n?r.words[c]=n:r.length--,r.strip();}(this,e,t):A(this,e,t),r;},E.prototype.makeRBT=function(e){for(var t=new Array(e),r=c.prototype._countBits(e)-1,i=0;i>=1;return n;},E.prototype.permute=function(e,t,r,n,o,c){for(var i=0;i>>=1)i++;return 1<>>=13,r[2*i+1]=8191&c,c>>>=13;for(i=2*t;i>=26,t+=r/67108864|0,t+=o>>>26,this.words[i]=67108863&o;}return 0!==t&&(this.words[i]=t,this.length++),this;},c.prototype.muln=function(e){return this.clone().imuln(e);},c.prototype.sqr=function(){return this.mul(this);},c.prototype.isqr=function(){return this.imul(this.clone());},c.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>o;}return t;}(e);if(0===t.length)return new c(1);for(var r=this,i=0;i=0);var i,t=e%26,s=(e-t)/26,r=67108863>>>26-t<<26-t;if(0!==t){var o=0;for(i=0;i>>26-t;}o&&(this.words[i]=o,this.length++);}if(0!==s){for(i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(i=0;i=0),o=t?(t-t%26)/26:0;var c=e%26,s=Math.min((e-c)/26,this.length),mask=67108863^67108863>>>c<s)for(this.length-=s,i=0;i=0&&(0!==d||i>=o);i--){var f=0|this.words[i];this.words[i]=d<<26-c|f>>>c,d=f&mask;}return l&&0!==d&&(l.words[l.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip();},c.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r);},c.prototype.shln=function(e){return this.clone().ishln(e);},c.prototype.ushln=function(e){return this.clone().iushln(e);},c.prototype.shrn=function(e){return this.clone().ishrn(e);},c.prototype.ushrn=function(e){return this.clone().iushrn(e);},c.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,s=(e-t)/26,q=1<=0);var t=e%26,s=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==t&&s++,this.length=Math.min(s,this.length),0!==t){var mask=67108863^67108863>>>t<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this;},c.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(d/67108864|0),this.words[i+r]=67108863&o;}for(;i>26,this.words[i+r]=67108863&o;if(0===l)return this.strip();for(n(-1===l),l=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip();},c.prototype._wordDiv=function(e,t){var r=(this.length,e.length),a=this.clone(),b=e,n=0|b.words[b.length-1];0!==(r=26-this._countBits(n))&&(b=b.ushln(r),a.iushln(r),n=0|b.words[b.length-1]);var q,o=a.length-b.length;if("mod"!==t){(q=new c(null)).length=o+1,q.words=new Array(q.length);for(var i=0;i=0;d--){var f=67108864*(0|a.words[b.length+d])+(0|a.words[b.length+d-1]);for(f=Math.min(f/n|0,67108863),a._ishlnsubmul(b,f,d);0!==a.negative;)f--,a.negative=0,a._ishlnsubmul(b,1,d),a.isZero()||(a.negative^=1);q&&(q.words[d]=f);}return q&&q.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:q||null,mod:a};},c.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new c(0),mod:new c(0)}:0!==this.negative&&0===e.negative?(l=this.neg().divmod(e,t),"mod"!==t&&(div=l.div.neg()),"div"!==t&&(o=l.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:div,mod:o}):0===this.negative&&0!==e.negative?(l=this.divmod(e.neg(),t),"mod"!==t&&(div=l.div.neg()),{div:div,mod:l.mod}):0!=(this.negative&e.negative)?(l=this.neg().divmod(e.neg(),t),"div"!==t&&(o=l.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:l.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new c(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new c(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new c(this.modn(e.words[0]))}:this._wordDiv(e,t);var div,o,l;},c.prototype.div=function(e){return this.divmod(e,"div",!1).div;},c.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod;},c.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod;},c.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),c=r.cmp(n);return c<0||1===o&&0===c?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1);},c.prototype.modn=function(e){n(e<=67108863);for(var p=(1<<26)%e,t=0,i=this.length-1;i>=0;i--)t=(p*t+(0|this.words[i]))%e;return t;},c.prototype.idivn=function(e){n(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*t;this.words[i]=r/e|0,t=r%e;}return this.strip();},c.prototype.divn=function(e){return this.clone().idivn(e);},c.prototype.egcd=function(p){n(0===p.negative),n(!p.isZero());var e=this,t=p.clone();e=0!==e.negative?e.umod(p):e.clone();for(var r=new c(1),o=new c(0),l=new c(0),d=new c(1),g=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++g;for(var f=t.clone(),h=e.clone();!e.isZero();){for(var i=0,m=1;0==(e.words[0]&m)&&i<26;++i,m<<=1);if(i>0)for(e.iushrn(i);i-->0;)(r.isOdd()||o.isOdd())&&(r.iadd(f),o.isub(h)),r.iushrn(1),o.iushrn(1);for(var y=0,v=1;0==(t.words[0]&v)&&y<26;++y,v<<=1);if(y>0)for(t.iushrn(y);y-->0;)(l.isOdd()||d.isOdd())&&(l.iadd(f),d.isub(h)),l.iushrn(1),d.iushrn(1);e.cmp(t)>=0?(e.isub(t),r.isub(l),o.isub(d)):(t.isub(e),l.isub(r),d.isub(o));}return{a:l,b:d,gcd:t.iushln(g)};},c.prototype._invmp=function(p){n(0===p.negative),n(!p.isZero());var a=this,b=p.clone();a=0!==a.negative?a.umod(p):a.clone();for(var e,t=new c(1),r=new c(0),o=b.clone();a.cmpn(1)>0&&b.cmpn(1)>0;){for(var i=0,l=1;0==(a.words[0]&l)&&i<26;++i,l<<=1);if(i>0)for(a.iushrn(i);i-->0;)t.isOdd()&&t.iadd(o),t.iushrn(1);for(var d=0,f=1;0==(b.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(b.iushrn(d);d-->0;)r.isOdd()&&r.iadd(o),r.iushrn(1);a.cmp(b)>=0?(a.isub(b),t.isub(r)):(b.isub(a),r.isub(t));}return(e=0===a.cmpn(1)?t:r).cmpn(0)<0&&e.iadd(p),e;},c.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),b=e.clone();a.negative=0,b.negative=0;for(var t=0;a.isEven()&&b.isEven();t++)a.iushrn(1),b.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;b.isEven();)b.iushrn(1);var r=a.cmp(b);if(r<0){var n=a;a=b,b=n;}else if(0===r||0===b.cmpn(1))break;a.isub(b);}return b.iushln(t);},c.prototype.invm=function(e){return this.egcd(e).a.umod(e);},c.prototype.isEven=function(){return 0==(1&this.words[0]);},c.prototype.isOdd=function(){return 1==(1&this.words[0]);},c.prototype.andln=function(e){return this.words[0]&e;},c.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,s=(e-t)/26,q=1<>>26,o&=67108863,this.words[i]=o;}return 0!==r&&(this.words[i]=r,this.length++),this;},c.prototype.isZero=function(){return 1===this.length&&0===this.words[0];},c.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;i--){var a=0|this.words[i],b=0|e.words[i];if(a!==b){ab&&(t=1);break;}}return t;},c.prototype.gtn=function(e){return 1===this.cmpn(e);},c.prototype.gt=function(e){return 1===this.cmp(e);},c.prototype.gten=function(e){return this.cmpn(e)>=0;},c.prototype.gte=function(e){return this.cmp(e)>=0;},c.prototype.ltn=function(e){return-1===this.cmpn(e);},c.prototype.lt=function(e){return-1===this.cmp(e);},c.prototype.lten=function(e){return this.cmpn(e)<=0;},c.prototype.lte=function(e){return this.cmp(e)<=0;},c.prototype.eqn=function(e){return 0===this.cmpn(e);},c.prototype.eq=function(e){return 0===this.cmp(e);},c.red=function(e){return new P(e);},c.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e);},c.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this);},c.prototype._forceRed=function(e){return this.red=e,this;},c.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e);},c.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e);},c.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e);},c.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e);},c.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e);},c.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e);},c.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e);},c.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e);},c.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this);},c.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this);},c.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this);},c.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this);},c.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this);},c.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e);};var S={k256:null,p224:null,p192:null,p25519:null};function O(e,p){this.name=e,this.p=new c(p,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp();}function _(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");}function M(){O.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");}function k(){O.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");}function C(){O.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");}function P(e){if("string"==typeof e){var t=c._prime(e);this.m=t.p,this.prime=t;}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null;}function F(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv);}O.prototype._tmp=function(){var e=new c(null);return e.words=new Array(Math.ceil(this.n/13)),e;},O.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r;},O.prototype.split=function(input,e){input.iushrn(this.n,0,e);},O.prototype.imulK=function(e){return e.imul(this.k);},o(_,O),_.prototype.split=function(input,output){for(var mask=4194303,e=Math.min(input.length,9),i=0;i>>22,t=r;}t>>>=22,input.words[i-10]=t,0===t&&input.length>10?input.length-=10:input.length-=9;},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i>>=26,e.words[i]=n,t=r;}return 0!==t&&(e.words[e.length++]=t),e;},c._prime=function(e){if(S[e])return S[e];var t;if("k256"===e)t=new _();else if("p224"===e)t=new M();else if("p192"===e)t=new k();else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new C();}return S[e]=t,t;},P.prototype._verify1=function(a){n(0===a.negative,"red works only with positives"),n(a.red,"red works only with red numbers");},P.prototype._verify2=function(a,b){n(0==(a.negative|b.negative),"red works only with positives"),n(a.red&&a.red===b.red,"red works only with red numbers");},P.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this);},P.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this);},P.prototype.add=function(a,b){this._verify2(a,b);var e=a.add(b);return e.cmp(this.m)>=0&&e.isub(this.m),e._forceRed(this);},P.prototype.iadd=function(a,b){this._verify2(a,b);var e=a.iadd(b);return e.cmp(this.m)>=0&&e.isub(this.m),e;},P.prototype.sub=function(a,b){this._verify2(a,b);var e=a.sub(b);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this);},P.prototype.isub=function(a,b){this._verify2(a,b);var e=a.isub(b);return e.cmpn(0)<0&&e.iadd(this.m),e;},P.prototype.shl=function(a,e){return this._verify1(a),this.imod(a.ushln(e));},P.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b));},P.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b));},P.prototype.isqr=function(a){return this.imul(a,a.clone());},P.prototype.sqr=function(a){return this.mul(a,a);},P.prototype.sqrt=function(a){if(a.isZero())return a.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var t=this.m.add(new c(1)).iushrn(2);return this.pow(a,t);}for(var q=this.m.subn(1),s=0;!q.isZero()&&0===q.andln(1);)s++,q.iushrn(1);n(!q.isZero());var r=new c(1).toRed(this),o=r.redNeg(),l=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new c(2*d*d).toRed(this);0!==this.pow(d,l).cmp(o);)d.redIAdd(o);for(var f=this.pow(d,q),h=this.pow(a,q.addn(1).iushrn(1)),m=this.pow(a,q),y=s;0!==m.cmp(r);){for(var v=m,i=0;0!==v.cmp(r);i++)v=v.redSqr();n(i=0;i--){for(var d=e.words[i],f=l-1;f>=0;f--){var h=d>>f&1;r!==t[0]&&(r=this.sqr(r)),0!==h||0!==n?(n<<=1,n|=h,(4===++o||0===i&&0===f)&&(r=this.mul(r,t[n]),o=0,n=0)):o=0;}l=26;}return r;},P.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t;},P.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t;},c.mont=function(e){return new F(e);},o(F,P),F.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift));},F.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t;},F.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var e=a.imul(b),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=e.isub(t).iushrn(this.shift),r=u;return u.cmp(this.m)>=0?r=u.isub(this.m):u.cmpn(0)<0&&(r=u.iadd(this.m)),r._forceRed(this);},F.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new c(0)._forceRed(this);var e=a.mul(b),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=e.isub(t).iushrn(this.shift),r=u;return u.cmp(this.m)>=0?r=u.isub(this.m):u.cmpn(0)<0&&(r=u.iadd(this.m)),r._forceRed(this);},F.prototype.invm=function(a){return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this);};}(e,this);}).call(this,r(106)(e));},function(e,t,r){"use strict";r.d(t,"a",function(){return l;});var n=r(140),o=r.n(n),c=r(0);function l(data){return"0x"+o.a.keccak_256(Object(c.a)(data));}},function(e,t,r){"use strict";r.d(t,"b",function(){return c;}),r.d(t,"e",function(){return l;}),r.d(t,"a",function(){return d;}),r.d(t,"c",function(){return f;}),r.d(t,"d",function(){return h;});var n=r(0),o=r(22);function c(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Object(n.a)(e);}function l(e,t){for(e=String(e);e.length32&&v.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r;}function k(e,t){return{address:Object(n.a)(e),storageKeys:(t||[]).map((t,r)=>(32!==Object(c.d)(t)&&v.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase()))};}function C(e){if(Array.isArray(e))return e.map((e,t)=>Array.isArray(e)?(e.length>2&&v.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),k(e[0],e[1])):k(e.address,e.storageKeys));const t=Object.keys(e).map(t=>{const r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return k(t,Object.keys(r).sort());});return t.sort((a,b)=>a.address.localeCompare(b.address)),t;}function P(e){return C(e).map(e=>[e.address,e.storageKeys]);}function F(e,t){if(null!=e.gasPrice){const t=o.a.from(e.gasPrice),r=o.a.from(e.maxFeePerGas||0);t.eq(r)||v.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r});}const r=[M(e.chainId||0,"chainId"),M(e.nonce||0,"nonce"),M(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),M(e.maxFeePerGas||0,"maxFeePerGas"),M(e.gasLimit||0,"gasLimit"),null!=e.to?Object(n.a)(e.to):"0x",M(e.value||0,"value"),e.data||"0x",P(e.accessList||[])];if(t){const e=Object(c.n)(t);r.push(M(e.recoveryParam,"recoveryParam")),r.push(Object(c.o)(e.r)),r.push(Object(c.o)(e.s));}return Object(c.c)(["0x02",h.encode(r)]);}function L(e,t){const r=[M(e.chainId||0,"chainId"),M(e.nonce||0,"nonce"),M(e.gasPrice||0,"gasPrice"),M(e.gasLimit||0,"gasLimit"),null!=e.to?Object(n.a)(e.to):"0x",M(e.value||0,"value"),e.data||"0x",P(e.accessList||[])];if(t){const e=Object(c.n)(t);r.push(M(e.recoveryParam,"recoveryParam")),r.push(Object(c.o)(e.r)),r.push(Object(c.o)(e.s));}return Object(c.c)(["0x01",h.encode(r)]);}function R(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&v.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){Object(f.b)(e,S);const r=[];E.forEach(function(t){let n=e[t.name]||[];const o={};t.numeric&&(o.hexPad="left"),n=Object(c.a)(Object(c.i)(n,o)),t.length&&n.length!==t.length&&n.length>0&&v.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(c.o)(n),n.length>t.maxLength&&v.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(Object(c.i)(n));});let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&v.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!Object(c.k)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(c.i)(n)),r.push("0x"),r.push("0x")),!t)return h.encode(r);const o=Object(c.n)(t);let l=27+o.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),l+=2*n+8,o.v>28&&o.v!==l&&v.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):o.v!==l&&v.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(c.i)(l)),r.push(Object(c.o)(Object(c.a)(o.r))),r.push(Object(c.o)(Object(c.a)(o.s))),h.encode(r);}(e,t);switch(e.type){case 1:return L(e,t);case 2:return F(e,t);}return v.throwError(`unsupported transaction type: ${e.type}`,y.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type});}function B(e,t,r){try{const r=A(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r;}catch(e){v.throwArgumentError("invalid v for transaction type: 1","v",t[0]);}e.r=Object(c.h)(t[1],32),e.s=Object(c.h)(t[2],32);try{const t=Object(d.a)(r(e));e.from=_(t,{r:e.r,s:e.s,recoveryParam:e.v});}catch(e){console.log(e);}}function N(e){const t=Object(c.a)(e);if(t[0]>127)return function(e){const t=h.decode(e);9!==t.length&&6!==t.length&&v.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:A(t[0]).toNumber(),gasPrice:A(t[1]),gasLimit:A(t[2]),to:w(t[3]),value:A(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=o.a.from(t[6]).toNumber();}catch(e){return console.log(e),r;}if(r.r=Object(c.h)(t[7],32),r.s=Object(c.h)(t[8],32),o.a.from(r.r).isZero()&&o.a.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const o=t.slice(0,6);0!==r.chainId&&(o.push(Object(c.i)(r.chainId)),o.push("0x"),o.push("0x"),n-=2*r.chainId+8);const l=Object(d.a)(h.encode(o));try{r.from=_(l,{r:Object(c.i)(r.r),s:Object(c.i)(r.s),recoveryParam:n});}catch(e){console.log(e);}r.hash=Object(d.a)(e);}return r.type=null,r;}(t);switch(t[0]){case 1:return function(e){const t=h.decode(e.slice(1));8!==t.length&&11!==t.length&&v.throwArgumentError("invalid component count for transaction type: 1","payload",Object(c.i)(e));const r={type:1,chainId:A(t[0]).toNumber(),nonce:A(t[1]).toNumber(),gasPrice:A(t[2]),gasLimit:A(t[3]),to:w(t[4]),value:A(t[5]),data:t[6],accessList:C(t[7])};return 8===t.length||(r.hash=Object(d.a)(e),B(r,t.slice(8),L)),r;}(t);case 2:return function(e){const t=h.decode(e.slice(1));9!==t.length&&12!==t.length&&v.throwArgumentError("invalid component count for transaction type: 2","payload",Object(c.i)(e));const r=A(t[2]),n=A(t[3]),o={type:2,chainId:A(t[0]).toNumber(),nonce:A(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:A(t[4]),to:w(t[5]),value:A(t[6]),data:t[7],accessList:C(t[8])};return 9===t.length||(o.hash=Object(d.a)(e),B(o,t.slice(9),F)),o;}(t);}return v.throwError(`unsupported transaction type: ${t[0]}`,y.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]});}},function(e,t,r){"use strict";r.d(t,"d",function(){return v;}),r.d(t,"a",function(){return w;}),r.d(t,"c",function(){return _;}),r.d(t,"b",function(){return M;});var n=r(4),o=r.n(n),c=r(0),l=r(2),d=r(76),f=o.a.BN;const h=new l.b(d.a),m={},y=9007199254740991;function v(e){return null!=e&&(w.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Object(c.l)(e)||"bigint"==typeof e||Object(c.j)(e));}let T=!1;class w{constructor(e,t){h.checkNew(new.target,w),e!==m&&h.throwError("cannot call constructor directly; use BigNumber.from",l.b.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this);}fromTwos(e){return E(S(this).fromTwos(e));}toTwos(e){return E(S(this).toTwos(e));}abs(){return"-"===this._hex[0]?w.from(this._hex.substring(1)):this;}add(e){return E(S(this).add(S(e)));}sub(e){return E(S(this).sub(S(e)));}div(e){return w.from(e).isZero()&&O("division by zero","div"),E(S(this).div(S(e)));}mul(e){return E(S(this).mul(S(e)));}mod(e){const t=S(e);return t.isNeg()&&O("cannot modulo negative values","mod"),E(S(this).umod(t));}pow(e){const t=S(e);return t.isNeg()&&O("cannot raise to negative values","pow"),E(S(this).pow(t));}and(e){const t=S(e);return(this.isNegative()||t.isNeg())&&O("cannot 'and' negative values","and"),E(S(this).and(t));}or(e){const t=S(e);return(this.isNegative()||t.isNeg())&&O("cannot 'or' negative values","or"),E(S(this).or(t));}xor(e){const t=S(e);return(this.isNegative()||t.isNeg())&&O("cannot 'xor' negative values","xor"),E(S(this).xor(t));}mask(e){return(this.isNegative()||e<0)&&O("cannot mask negative values","mask"),E(S(this).maskn(e));}shl(e){return(this.isNegative()||e<0)&&O("cannot shift negative values","shl"),E(S(this).shln(e));}shr(e){return(this.isNegative()||e<0)&&O("cannot shift negative values","shr"),E(S(this).shrn(e));}eq(e){return S(this).eq(S(e));}lt(e){return S(this).lt(S(e));}lte(e){return S(this).lte(S(e));}gt(e){return S(this).gt(S(e));}gte(e){return S(this).gte(S(e));}isNegative(){return"-"===this._hex[0];}isZero(){return S(this).isZero();}toNumber(){try{return S(this).toNumber();}catch(e){O("overflow","toNumber",this.toString());}return null;}toBigInt(){try{return BigInt(this.toString());}catch(e){}return h.throwError("this platform does not support BigInt",l.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()});}toString(){return arguments.length>0&&(10===arguments[0]?T||(T=!0,h.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?h.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",l.b.errors.UNEXPECTED_ARGUMENT,{}):h.throwError("BigNumber.toString does not accept parameters",l.b.errors.UNEXPECTED_ARGUMENT,{})),S(this).toString(10);}toHexString(){return this._hex;}toJSON(e){return{type:"BigNumber",hex:this.toHexString()};}static from(e){if(e instanceof w)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new w(m,A(e)):e.match(/^-?[0-9]+$/)?new w(m,A(new f(e))):h.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&O("underflow","BigNumber.from",e),(e>=y||e<=-y)&&O("overflow","BigNumber.from",e),w.from(String(e));const t=e;if("bigint"==typeof t)return w.from(t.toString());if(Object(c.j)(t))return w.from(Object(c.i)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return w.from(e);}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Object(c.l)(e)||"-"===e[0]&&Object(c.l)(e.substring(1))))return w.from(e);}return h.throwArgumentError("invalid BigNumber value","value",e);}static isBigNumber(e){return!(!e||!e._isBigNumber);}}function A(e){if("string"!=typeof e)return A(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&h.throwArgumentError("invalid hex","value",e),"0x00"===(e=A(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e;}function E(e){return w.from(A(e));}function S(e){const t=w.from(e).toHexString();return"-"===t[0]?new f("-"+t.substring(3),16):new f(t.substring(2),16);}function O(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),h.throwError(e,l.b.errors.NUMERIC_FAULT,n);}function _(e){return new f(e,36).toString(16);}function M(e){return new f(e,16).toString(36);}},,function(e,t,r){"use strict";r.d(t,"b",function(){return P;}),r.d(t,"a",function(){return F;}),r.d(t,"g",function(){return L;}),r.d(t,"f",function(){return R;}),r.d(t,"c",function(){return B;}),r.d(t,"e",function(){return N;}),r.d(t,"d",function(){return x;});var n=r(41),o=r(0),c=r(12),l=r(22),d=r(214),f=r(1),h=r(25),m=r(145),y=r(141),v=r(11),T=r(211);const w=new(r(2).b)("hdnode/5.4.0"),A=c.a.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),E=Object(l.f)("Bitcoin seed"),S=2147483648;function O(e){return(1<=256)throw new Error("Depth too large!");return M(Object(o.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(o.i)(this.depth),this.parentFingerprint,Object(o.h)(Object(o.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(o.b)(["0x00",this.privateKey]):this.publicKey]));}neuter(){return new F(C,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path);}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let path=this.path;path&&(path+="/"+(2147483647&e));const data=new Uint8Array(37);if(e&S){if(!this.privateKey)throw new Error("cannot derive child of neutered node");data.set(Object(o.a)(this.privateKey),1),path&&(path+="'");}else data.set(Object(o.a)(this.publicKey));for(let i=24;i>=0;i-=8)data[33+(i>>3)]=e>>24-i&255;const t=Object(o.a)(Object(m.a)(y.a.sha512,this.chainCode,data)),r=t.slice(0,32),n=t.slice(32);let l=null,d=null;if(this.privateKey)l=_(c.a.from(r).add(this.privateKey).mod(A));else{d=new h.a(Object(o.i)(r))._addPoint(this.publicKey);}let f=path;const v=this.mnemonic;return v&&(f=Object.freeze({phrase:v.phrase,path:path,locale:v.locale||"en"})),new F(C,l,d,this.fingerprint,_(n),e,this.depth+1,f);}derivePath(path){const e=path.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+path);"m"===e[0]&&e.shift();let t=this;for(let i=0;i=S)throw new Error("invalid path index - "+component);t=t._derive(S+e);}else{if(!component.match(/^[0-9]+$/))throw new Error("invalid path component - "+component);{const e=parseInt(component);if(e>=S)throw new Error("invalid path index - "+component);t=t._derive(e);}}}return t;}static _fromSeed(e,t){const r=Object(o.a)(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=Object(o.a)(Object(m.a)(y.a.sha512,E,r));return new F(C,_(n.slice(0,32)),null,"0x00000000",_(n.slice(32)),0,0,t);}static fromMnemonic(e,t,r){return e=B(R(e,r=k(r)),r),F._fromSeed(L(e,t),{phrase:e,path:"m",locale:r.locale});}static fromSeed(e){return F._fromSeed(e,null);}static fromExtendedKey(e){const t=n.a.decode(e);82===t.length&&M(t.slice(0,78))===e||w.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],c=Object(o.i)(t.slice(5,9)),l=parseInt(Object(o.i)(t.slice(9,13)).substring(2),16),d=Object(o.i)(t.slice(13,45)),f=t.slice(45,78);switch(Object(o.i)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new F(C,null,Object(o.i)(f),c,d,l,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==f[0])break;return new F(C,Object(o.i)(f.slice(1)),null,c,d,l,r,null);}return w.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");}}function L(e,t){t||(t="");const r=Object(l.f)("mnemonic"+t,l.a.NFKD);return Object(d.a)(Object(l.f)(e,l.a.NFKD),r,2048,64,"sha512");}function R(e,t){t=k(t),w.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=Object(o.a)(new Uint8Array(Math.ceil(11*r.length/8)));let c=0;for(let i=0;i>3]|=1<<7-c%8),c++;}const l=32*r.length/3,d=O(r.length/3);if((Object(o.a)(Object(m.c)(n.slice(0,l/8)))[0]&d)!==(n[n.length-1]&d))throw new Error("invalid checksum");return Object(o.i)(n.slice(0,l/8));}function B(e,t){if(t=k(t),(e=Object(o.a)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let i=0;i8?(r[r.length-1]<<=8,r[r.length-1]|=e[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[i]>>8-n,r.push(e[i]&(1<<8-n)-1),n+=3);const c=e.length/4,l=Object(o.a)(Object(m.c)(e))[0]&O(c);return r[r.length-1]<<=c,r[r.length-1]|=l>>8-c,t.join(r.map(e=>t.getWord(e)));}function N(e,t){try{return R(e,t),!0;}catch(e){}return!1;}function x(e){return("number"!=typeof e||e<0||e>=S||e%1)&&w.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`;}},function(e,t,r){"use strict";r.d(t,"a",function(){return w;}),r.d(t,"b",function(){return A;}),r.d(t,"c",function(){return E;});var n=r(83),o=r(0),c=r(1),l=r(22),d=r(2);var f=function(e,t,r,n){return new(r||(r=Promise))(function(o,c){function l(e){try{f(n.next(e));}catch(e){c(e);}}function d(e){try{f(n.throw(e));}catch(e){c(e);}}function f(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t);})).then(l,d);}f((n=n.apply(e,t||[])).next());});};function h(e,t){return f(this,void 0,void 0,function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0,mode:"cors",cache:"no-cache",credentials:"same-origin",redirect:"follow",referrer:"client"},n=yield fetch(e,r),body=yield n.arrayBuffer(),c={};return n.headers.forEach?n.headers.forEach((e,t)=>{c[t.toLowerCase()]=e;}):n.headers.keys().forEach(e=>{c[e.toLowerCase()]=n.headers.get(e);}),{headers:c,statusCode:n.status,statusMessage:n.statusText,body:Object(o.a)(new Uint8Array(body))};});}var m=function(e,t,r,n){return new(r||(r=Promise))(function(o,c){function l(e){try{f(n.next(e));}catch(e){c(e);}}function d(e){try{f(n.throw(e));}catch(e){c(e);}}function f(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t);})).then(l,d);}f((n=n.apply(e,t||[])).next());});};const y=new d.b("web/5.4.0");function v(e){return new Promise(t=>{setTimeout(t,e);});}function T(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Object(o.k)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Object(l.h)(e);}catch(e){}return Object(o.i)(e);}return e;}function w(e,body,t){const r="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;y.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const o="object"==typeof e?e.throttleCallback:null,c="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;y.assertArgument(c>0&&c%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",c);const f={};let w=null;const A={method:"GET"};let E=!1,S=12e4;if("string"==typeof e)w=e;else if("object"==typeof e){if(null!=e&&null!=e.url||y.throwArgumentError("missing URL","connection.url",e),w=e.url,"number"==typeof e.timeout&&e.timeout>0&&(S=e.timeout),e.headers)for(const t in e.headers)f[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(E=!0);if(A.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==w.substring(0,6)&&!0!==e.allowInsecureAuthentication&&y.throwError("basic authentication requires a secure https url",d.b.errors.INVALID_ARGUMENT,{argument:"url",url:w,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;f.authorization={key:"Authorization",value:"Basic "+Object(n.b)(Object(l.f)(t))};}}body&&(A.method="POST",A.body=body,null==f["content-type"]&&(f["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==f["content-length"]&&(f["content-length"]={key:"Content-Length",value:String(body.length)}));const O={};Object.keys(f).forEach(e=>{const header=f[e];O[header.key]=header.value;}),A.headers=O;const _=function(){let e=null;return{promise:new Promise(function(t,r){S&&(e=setTimeout(()=>{null!=e&&(e=null,r(y.makeError("timeout",d.b.errors.TIMEOUT,{requestBody:T(A.body,O["content-type"]),requestMethod:A.method,timeout:S,url:w})));},S));}),cancel:function(){null!=e&&(clearTimeout(e),e=null);}};}(),M=function(){return m(this,void 0,void 0,function*(){for(let e=0;e=300)&&(_.cancel(),y.throwError("bad response",d.b.errors.SERVER_ERROR,{status:n.statusCode,headers:n.headers,body:T(body,n.headers?n.headers["content-type"]:null),requestBody:T(A.body,O["content-type"]),requestMethod:A.method,url:w})),t)try{const e=yield t(body,n);return _.cancel(),e;}catch(t){if(t.throttleRetry&&e"content-type"===e.toLowerCase()).length||(r.headers=Object(c.g)(r.headers),r.headers["content-type"]="application/json");}else r.headers={"content-type":"application/json"};e=r;}return w(e,body,(e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Object(l.h)(e));}catch(t){y.throwError("invalid JSON",d.b.errors.SERVER_ERROR,{body:e,error:t});}return r&&(n=r(n,t)),n;});}function E(e,t){return t||(t={}),null==(t=Object(c.g)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise(function(r,n){let o=null,c=!1;const l=()=>!c&&(c=!0,o&&clearTimeout(o),!0);t.timeout&&(o=setTimeout(()=>{l()&&n(new Error("timeout"));},t.timeout));const d=t.retryLimit;let f=0;!function o(){return e().then(function(e){if(void 0!==e)l()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",o);else if(t.onceBlock)t.onceBlock.once("block",o);else if(!c){if(f++,f>d)return void(l()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,f)));et.ceiling&&(e=t.ceiling),setTimeout(o,e);}return null;},function(e){l()&&n(e);});}();});}},function(e,t,r){"use strict";function n(e,t,r,n,o,c,l){try{var d=e[c](l),f=d.value;}catch(e){return void r(e);}d.done?t(f):Promise.resolve(f).then(n,o);}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,c){var l=e.apply(t,r);function d(e){n(l,o,c,d,f,"next",e);}function f(e){n(l,o,c,d,f,"throw",e);}d(void 0);});};}r.d(t,"a",function(){return o;});},,function(e,t){e.exports=function(e){return"function"==typeof e;};},function(e,t,r){var n=r(23),o=r(90),c=r(29),l=r(93),d=r(94),f=r(120),h=o("wks"),m=n.Symbol,y=f?m:m&&m.withoutSetter||l;e.exports=function(e){return c(h,e)&&(d||"string"==typeof h[e])||(d&&c(m,e)?h[e]=m[e]:h[e]=y("Symbol."+e)),h[e];};},function(e,t,r){"use strict";r.r(t);var n=r(40);r.d(t,"ethers",function(){return n;});var o=r(27);r.d(t,"Signer",function(){return o.a;});var c=r(52);r.d(t,"Wallet",function(){return c.a;}),r.d(t,"VoidSigner",function(){return o.b;});var l=r(62);r.d(t,"getDefaultProvider",function(){return l.getDefaultProvider;}),r.d(t,"providers",function(){return n.providers;});var d=r(46);r.d(t,"BaseContract",function(){return d.a;}),r.d(t,"Contract",function(){return d.b;}),r.d(t,"ContractFactory",function(){return d.c;});var f=r(12);r.d(t,"BigNumber",function(){return f.a;});var h=r(159);r.d(t,"FixedNumber",function(){return h.a;}),r.d(t,"constants",function(){return n.constants;});var m=r(2);r.d(t,"errors",function(){return m.a;}),r.d(t,"logger",function(){return n.logger;}),r.d(t,"utils",function(){return n.utils;});var y=r(211);r.d(t,"wordlists",function(){return y.a;});var v=r(75);r.d(t,"version",function(){return v.a;});var T=r(7);r.d(t,"Wordlist",function(){return T.a;});try{const e=window;null==e._ethers&&(e._ethers=n);}catch(e){}},function(e,t,r){var n=t;n.utils=r(34),n.common=r(56),n.sha=r(151),n.ripemd=r(155),n.hmac=r(156),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160;},function(e,t,r){"use strict";r.d(t,"a",function(){return c;}),r.d(t,"c",function(){return l;}),r.d(t,"b",function(){return f;}),r.d(t,"f",function(){return m;}),r.d(t,"d",function(){return v;}),r.d(t,"e",function(){return T;}),r.d(t,"h",function(){return w;}),r.d(t,"g",function(){return A;});var n=r(0);const o=new(r(2).b)("strings/5.4.0");var c,l;function d(e,t,r,output,n){if(e===l.BAD_PREFIX||e===l.UNEXPECTED_CONTINUE){let i=0;for(let e=t+1;e>6==2;e++)i++;return i;}return e===l.OVERRUN?r.length-t-1:0;}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD";}(c||(c={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation";}(l||(l={}));const f=Object.freeze({error:function(e,t,r,output,n){return o.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r);},ignore:d,replace:function(e,t,r,output,n){return e===l.OVERLONG?(output.push(n),0):(output.push(65533),d(e,t,r));}});function h(e,t){null==t&&(t=f.error),e=Object(n.a)(e);const r=[];let i=0;for(;i>7==0){r.push(n);continue;}let o=null,c=null;if(192==(224&n))o=1,c=127;else if(224==(240&n))o=2,c=2047;else{if(240!=(248&n)){i+=t(128==(192&n)?l.UNEXPECTED_CONTINUE:l.BAD_PREFIX,i-1,e,r);continue;}o=3,c=65535;}if(i-1+o>=e.length){i+=t(l.OVERRUN,i-1,e,r);continue;}let d=n&(1<<8-o-1)-1;for(let n=0;n1114111?i+=t(l.OUT_OF_RANGE,i-1-o,e,r,d):d>=55296&&d<=57343?i+=t(l.UTF16_SURROGATE,i-1-o,e,r,d):d<=c?i+=t(l.OVERLONG,i-1-o,e,r,d):r.push(d));}return r;}function m(e,form=c.current){form!=c.current&&(o.checkNormalize(),e=e.normalize(form));let t=[];for(let i=0;i>6|192),t.push(63&r|128);else if(55296==(64512&r)){i++;const n=e.charCodeAt(i);if(i>=e.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const o=65536+((1023&r)<<10)+(1023&n);t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(63&o|128);}else t.push(r>>12|224),t.push(r>>6&63|128),t.push(63&r|128);}return Object(n.a)(t);}function y(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4);}function v(e,t){return'"'+h(e,t).map(e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\";}if(e>=32&&e<127)return String.fromCharCode(e);}return e<=65535?y(e):y(55296+((e-=65536)>>10&1023))+y(56320+(1023&e));}).join("")+'"';}function T(e){return e.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))).join("");}function w(e,t){return T(h(e,t));}function A(e,form=c.current){return h(m(e,form));}},function(e,t,r){(function(t){var r=function(e){return e&&e.Math==Math&&e;};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||function(){return this;}()||Function("return this")();}).call(this,r(43));},function(e,t){e.exports=function(e){try{return!!e();}catch(e){return!0;}};},function(e,t,r){"use strict";r.d(t,"a",function(){return h;}),r.d(t,"c",function(){return m;}),r.d(t,"b",function(){return y;});var n=r(139),o=r(0),c=r(1);const l=new(r(2).b)("signing-key/5.4.0");let d=null;function f(){return d||(d=new n.a("secp256k1")),d;}class h{constructor(e){Object(c.d)(this,"curve","secp256k1"),Object(c.d)(this,"privateKey",Object(o.i)(e));const t=f().keyFromPrivate(Object(o.a)(this.privateKey));Object(c.d)(this,"publicKey","0x"+t.getPublic(!1,"hex")),Object(c.d)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Object(c.d)(this,"_isSigningKey",!0);}_addPoint(e){const t=f().keyFromPublic(Object(o.a)(this.publicKey)),r=f().keyFromPublic(Object(o.a)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex");}signDigest(e){const t=f().keyFromPrivate(Object(o.a)(this.privateKey)),r=Object(o.a)(e);32!==r.length&&l.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Object(o.n)({recoveryParam:n.recoveryParam,r:Object(o.h)("0x"+n.r.toString(16),32),s:Object(o.h)("0x"+n.s.toString(16),32)});}computeSharedSecret(e){const t=f().keyFromPrivate(Object(o.a)(this.privateKey)),r=f().keyFromPublic(Object(o.a)(y(e)));return Object(o.h)("0x"+t.derive(r.getPublic()).toString(16),32);}static isSigningKey(e){return!(!e||!e._isSigningKey);}}function m(e,t){const r=Object(o.n)(t),n={r:Object(o.a)(r.r),s:Object(o.a)(r.s)};return"0x"+f().recoverPubKey(Object(o.a)(e),n,r.recoveryParam).encode("hex",!1);}function y(e,t){const r=Object(o.a)(e);if(32===r.length){const e=new h(r);return t?"0x"+f().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey;}return 33===r.length?t?Object(o.i)(r):"0x"+f().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+f().keyFromPublic(r).getPublic(!0,"hex"):Object(o.i)(r):l.throwArgumentError("invalid public or private key","key","[REDACTED]");}},function(e,t,r){var n=r(23),o=r(49).f,c=r(59),l=r(50),d=r(92),f=r(169),h=r(128);e.exports=function(e,source){var t,r,m,y,v,T=e.target,w=e.global,A=e.stat;if(t=w?n:A?n[T]||d(T,{}):(n[T]||{}).prototype)for(r in source){if(y=source[r],m=e.noTargetGet?(v=o(t,r))&&v.value:t[r],!h(w?r:T+(A?".":"#")+r,e.forced)&&void 0!==m){if(typeof y==typeof m)continue;f(y,m);}(e.sham||m&&m.sham)&&c(y,"sham",!0),l(t,r,y,e);}};},function(e,t,r){"use strict";r.d(t,"a",function(){return h;}),r.d(t,"b",function(){return m;});var n=r(1),o=r(2);var c=function(e,t,r,n){return new(r||(r=Promise))(function(o,c){function l(e){try{f(n.next(e));}catch(e){c(e);}}function d(e){try{f(n.throw(e));}catch(e){c(e);}}function f(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t);})).then(l,d);}f((n=n.apply(e,t||[])).next());});};const l=new o.b("abstract-signer/5.4.1"),d=["accessList","chainId","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],f=[o.b.errors.INSUFFICIENT_FUNDS,o.b.errors.NONCE_EXPIRED,o.b.errors.REPLACEMENT_UNDERPRICED];class h{constructor(){l.checkAbstract(new.target,h),Object(n.d)(this,"_isSigner",!0);}getBalance(e){return c(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e);});}getTransactionCount(e){return c(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e);});}estimateGas(e){return c(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const t=yield Object(n.f)(this.checkTransaction(e));return yield this.provider.estimateGas(t);});}call(e,t){return c(this,void 0,void 0,function*(){this._checkProvider("call");const r=yield Object(n.f)(this.checkTransaction(e));return yield this.provider.call(r,t);});}sendTransaction(e){return c(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r);});}getChainId(){return c(this,void 0,void 0,function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId;});}getGasPrice(){return c(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice();});}getFeeData(){return c(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData();});}resolveName(e){return c(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e);});}checkTransaction(e){for(const t in e)-1===d.indexOf(t)&&l.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=Object(n.g)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then(t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&l.throwArgumentError("from address mismatch","transaction",e),t[0])),t;}populateTransaction(e){return c(this,void 0,void 0,function*(){const t=yield Object(n.f)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then(e=>c(this,void 0,void 0,function*(){if(null==e)return null;const address=yield this.resolveName(e);return null==address&&l.throwArgumentError("provided ENS name resolves to null","tx.to",e),address;})),t.to.catch(e=>{}));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||l.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):l.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas){if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type){if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas){if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e;}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);}else null!=e.gasPrice?(r&&l.throwError("network does not support EIP-1559",o.b.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):l.throwError("failed to get consistent fee data",o.b.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});}else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas));}}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch(e=>{if(f.indexOf(e.code)>=0)throw e;return l.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",o.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t});})),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(t=>(0!==t[1]&&t[0]!==t[1]&&l.throwArgumentError("chainId address mismatch","transaction",e),t[0])),yield Object(n.f)(t);});}_checkProvider(e){this.provider||l.throwError("missing provider",o.b.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"});}static isSigner(e){return!(!e||!e._isSigner);}}class m extends h{constructor(address,e){l.checkNew(new.target,m),super(),Object(n.d)(this,"address",address),Object(n.d)(this,"provider",e||null);}getAddress(){return Promise.resolve(this.address);}_fail(e,t){return Promise.resolve().then(()=>{l.throwError(e,o.b.errors.UNSUPPORTED_OPERATION,{operation:t});});}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage");}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction");}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData");}connect(e){return new m(this.address,e);}}},function(e,t,r){"use strict";r.r(t),r.d(t,"encode",function(){return h;}),r.d(t,"decode",function(){return v;});var n=r(0),o=r(2);const c=new o.b("rlp/5.4.0");function l(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t;}function d(data,e,t){let r=0;for(let i=0;ie+1+r&&c.throwError("child data too short",o.b.errors.BUFFER_OVERRUN,{});}return{consumed:1+r,result:n};}function y(data,e){if(0===data.length&&c.throwError("data too short",o.b.errors.BUFFER_OVERRUN,{}),data[e]>=248){const t=data[e]-247;e+1+t>data.length&&c.throwError("data short segment too short",o.b.errors.BUFFER_OVERRUN,{});const r=d(data,e+1,t);return e+1+t+r>data.length&&c.throwError("data long segment too short",o.b.errors.BUFFER_OVERRUN,{}),m(data,e,e+1+t,t+r);}if(data[e]>=192){const t=data[e]-192;return e+1+t>data.length&&c.throwError("data array too short",o.b.errors.BUFFER_OVERRUN,{}),m(data,e,e+1,t);}if(data[e]>=184){const t=data[e]-183;e+1+t>data.length&&c.throwError("data array too short",o.b.errors.BUFFER_OVERRUN,{});const r=d(data,e+1,t);e+1+t+r>data.length&&c.throwError("data array too short",o.b.errors.BUFFER_OVERRUN,{});return{consumed:1+t+r,result:Object(n.i)(data.slice(e+1+t,e+1+t+r))};}if(data[e]>=128){const t=data[e]-128;e+1+t>data.length&&c.throwError("data too short",o.b.errors.BUFFER_OVERRUN,{});return{consumed:1+t,result:Object(n.i)(data.slice(e+1,e+1+t))};}return{consumed:1,result:Object(n.i)(data[e])};}function v(data){const e=Object(n.a)(data),t=y(e,0);return t.consumed!==e.length&&c.throwArgumentError("invalid rlp data","data",data),t.result;}},function(e,t,r){var n=r(44),o={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return o.call(n(e),t);};},function(e,t,r){var n=r(24);e.exports=!n(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7;}})[1];});},function(e,t,r){"use strict";r.d(t,"a",function(){return f;}),r.d(t,"b",function(){return h;});var n=r(12),o=(r(0),r(1)),c=r(2);var l=function(e,t,r,n){return new(r||(r=Promise))(function(o,c){function l(e){try{f(n.next(e));}catch(e){c(e);}}function d(e){try{f(n.throw(e));}catch(e){c(e);}}function f(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t);})).then(l,d);}f((n=n.apply(e,t||[])).next());});};const d=new c.b("abstract-provider/5.4.1");class f extends o.a{static isForkEvent(e){return!(!e||!e._isForkEvent);}}class h{constructor(){d.checkAbstract(new.target,h),Object(o.d)(this,"_isProvider",!0);}getFeeData(){return l(this,void 0,void 0,function*(){const{block:e,gasPrice:t}=yield Object(o.f)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(e=>null)});let r=null,c=null;return e&&e.baseFeePerGas&&(c=n.a.from("2500000000"),r=e.baseFeePerGas.mul(2).add(c)),{maxFeePerGas:r,maxPriorityFeePerGas:c,gasPrice:t};});}addListener(e,t){return this.on(e,t);}removeListener(e,t){return this.off(e,t);}static isProvider(e){return!(!e||!e._isProvider);}}},function(e,t,r){"use strict";!function(t){function r(e){return parseInt(e)===e;}function n(e){if(!r(e.length))return!1;for(var i=0;i255)return!1;return!0;}function o(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e);}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object");}function c(e){return new Uint8Array(e);}function l(e,t,r,n,o){null==n&&null==o||(e=e.slice?e.slice(n,o):Array.prototype.slice.call(e,n,o)),t.set(e,r);}var d,f={toBytes:function(text){var e=[],i=0;for(text=encodeURI(text);i191&&r<224?(t.push(String.fromCharCode((31&r)<<6|63&e[i+1])),i+=2):(t.push(String.fromCharCode((15&r)<<12|(63&e[i+1])<<6|63&e[i+2])),i+=3);}return t.join("");}},h=(d="0123456789abcdef",{toBytes:function(text){for(var e=[],i=0;i>4]+d[15&r]);}return t.join("");}}),m={16:10,24:12,32:14},y=[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],v=[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],T=[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],w=[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],A=[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],E=[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],S=[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],O=[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],_=[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],M=[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],k=[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],C=[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],P=[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],F=[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],L=[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 R(e){for(var t=[],i=0;i>2,this._Ke[t][i%4]=o[i],this._Kd[e-t][i%4]=o[i];for(var c,l=0,d=n;d>16&255]<<24^v[c>>8&255]<<16^v[255&c]<<8^v[c>>24&255]^y[l]<<24,l+=1,8!=n)for(i=1;i>8&255]<<8^v[c>>16&255]<<16^v[c>>24&255]<<24;for(i=n/2+1;i>2,h=d%4,this._Ke[f][h]=o[i],this._Kd[e-f][h]=o[i++],d++;}for(var f=1;f>24&255]^P[c>>16&255]^F[c>>8&255]^L[255&c];},B.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,a=[0,0,0,0],r=R(e),i=0;i<4;i++)r[i]^=this._Ke[0][i];for(var n=1;n>24&255]^A[r[(i+1)%4]>>16&255]^E[r[(i+2)%4]>>8&255]^S[255&r[(i+3)%4]]^this._Ke[n][i];r=a.slice();}var o,l=c(16);for(i=0;i<4;i++)o=this._Ke[t][i],l[4*i]=255&(v[r[i]>>24&255]^o>>24),l[4*i+1]=255&(v[r[(i+1)%4]>>16&255]^o>>16),l[4*i+2]=255&(v[r[(i+2)%4]>>8&255]^o>>8),l[4*i+3]=255&(v[255&r[(i+3)%4]]^o);return l;},B.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,a=[0,0,0,0],r=R(e),i=0;i<4;i++)r[i]^=this._Kd[0][i];for(var n=1;n>24&255]^_[r[(i+3)%4]>>16&255]^M[r[(i+2)%4]>>8&255]^k[255&r[(i+1)%4]]^this._Kd[n][i];r=a.slice();}var o,l=c(16);for(i=0;i<4;i++)o=this._Kd[t][i],l[4*i]=255&(T[r[i]>>24&255]^o>>24),l[4*i+1]=255&(T[r[(i+3)%4]>>16&255]^o>>16),l[4*i+2]=255&(T[r[(i+2)%4]>>8&255]^o>>8),l[4*i+3]=255&(T[255&r[(i+1)%4]]^o);return l;};var N=function(e){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new B(e);};N.prototype.encrypt=function(e){if((e=o(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=c(e.length),r=c(16),i=0;i=0;--t)this._counter[t]=e%256,e>>=8;},J.prototype.setBytes=function(e){if(16!=(e=o(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e;},J.prototype.increment=function(){for(var i=15;i>=0;i--){if(255!==this._counter[i]){this._counter[i]++;break;}this._counter[i]=0;}};var D=function(e,t){if(!(this instanceof D))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof J||(t=new J(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new B(e);};D.prototype.encrypt=function(e){for(var t=o(e,!0),i=0;i16)throw new Error("PKCS#7 padding byte out of range");for(var t=data.length-e,i=0;i=e.length)&&56320==(64512&e.charCodeAt(i+1));}function l(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0;}function d(e){return 1===e.length?"0"+e:e;}function f(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e;}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e){if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[p++]=63&n|128):c(e,i)?(n=65536+((1023&n)<<10)+(1023&e.charCodeAt(++i)),r[p++]=n>>18|240,r[p++]=n>>12&63|128,r[p++]=n>>6&63|128,r[p++]=63&n|128):(r[p++]=n>>12|224,r[p++]=n>>6&63|128,r[p++]=63&n|128);}}else for(i=0;i>>0;}return l;},t.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o);}return r;},t.rotr32=function(e,b){return e>>>b|e<<32-b;},t.rotl32=function(e,b){return e<>>32-b;},t.sum32=function(a,b){return a+b>>>0;},t.sum32_3=function(a,b,e){return a+b+e>>>0;},t.sum32_4=function(a,b,e,t){return a+b+e+t>>>0;},t.sum32_5=function(a,b,e,t,r){return a+b+e+t+r>>>0;},t.sum64=function(e,t,r,n){var o=e[t],c=n+e[t+1]>>>0,l=(c>>0,e[t+1]=c;},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0;},t.sum64_lo=function(e,t,r,n){return t+n>>>0;},t.sum64_4_hi=function(e,t,r,n,o,c,l,dl){var d=0,f=t;return d+=(f=f+n>>>0)>>0)>>0)>>0;},t.sum64_4_lo=function(e,t,r,n,o,c,l,dl){return t+n+c+dl>>>0;},t.sum64_5_hi=function(e,t,r,n,o,c,l,dl,d,f){var h=0,m=t;return h+=(m=m+n>>>0)>>0)>>0)>>0)>>0;},t.sum64_5_lo=function(e,t,r,n,o,c,l,dl,d,f){return t+n+c+dl+f>>>0;},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0;},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0;},t.shr64_hi=function(e,t,r){return e>>>r;},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0;};},function(e,t,r){var n=r(30),o=r(121),c=r(36),l=r(68),d=Object.defineProperty;t.f=n?d:function(e,t,r){if(c(e),t=l(t),c(r),o)try{return d(e,t,r);}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e;};},function(e,t,r){var n=r(33);e.exports=function(e){if(n(e))return e;throw TypeError(String(e)+" is not an object");};},function(e,t,r){"use strict";r.d(t,"d",function(){return o;}),r.d(t,"h",function(){return c;}),r.d(t,"e",function(){return l;}),r.d(t,"f",function(){return d;}),r.d(t,"g",function(){return f;}),r.d(t,"b",function(){return h;}),r.d(t,"c",function(){return m;}),r.d(t,"a",function(){return y;});var n=r(12);const o=n.a.from(-1),c=n.a.from(0),l=n.a.from(1),d=n.a.from(2),f=n.a.from("1000000000000000000"),h=n.a.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),m=n.a.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),y=n.a.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");},function(e,t,r){var n=r(115),o=r(58);e.exports=function(e){return n(o(e));};},function(e,t,r){"use strict";r.r(t),r.d(t,"AddressZero",function(){return n.a;}),r.d(t,"NegativeOne",function(){return o.d;}),r.d(t,"Zero",function(){return o.h;}),r.d(t,"One",function(){return o.e;}),r.d(t,"Two",function(){return o.f;}),r.d(t,"WeiPerEther",function(){return o.g;}),r.d(t,"MaxUint256",function(){return o.b;}),r.d(t,"MinInt256",function(){return o.c;}),r.d(t,"MaxInt256",function(){return o.a;}),r.d(t,"HashZero",function(){return c.a;}),r.d(t,"EtherSymbol",function(){return l;});var n=r(112),o=r(37),c=r(111);const l="Ξ";},function(e,t,r){"use strict";r.r(t),r.d(t,"Signer",function(){return d.a;}),r.d(t,"Wallet",function(){return f.a;}),r.d(t,"VoidSigner",function(){return d.b;}),r.d(t,"getDefaultProvider",function(){return m.getDefaultProvider;}),r.d(t,"providers",function(){return m;}),r.d(t,"BaseContract",function(){return o.a;}),r.d(t,"Contract",function(){return o.b;}),r.d(t,"ContractFactory",function(){return o.c;}),r.d(t,"BigNumber",function(){return c.a;}),r.d(t,"FixedNumber",function(){return l.a;}),r.d(t,"constants",function(){return h;}),r.d(t,"errors",function(){return A.a;}),r.d(t,"logger",function(){return ht;}),r.d(t,"utils",function(){return n;}),r.d(t,"wordlists",function(){return y.a;}),r.d(t,"version",function(){return ft.a;}),r.d(t,"Wordlist",function(){return v.a;});var n={};r.r(n),r.d(n,"AbiCoder",function(){return ve;}),r.d(n,"defaultAbiCoder",function(){return Te;}),r.d(n,"Fragment",function(){return ne;}),r.d(n,"ConstructorFragment",function(){return ue;}),r.d(n,"ErrorFragment",function(){return de;}),r.d(n,"EventFragment",function(){return ie;}),r.d(n,"FunctionFragment",function(){return ce;}),r.d(n,"ParamType",function(){return te;}),r.d(n,"FormatTypes",function(){return $;}),r.d(n,"checkResultErrors",function(){return O;}),r.d(n,"Logger",function(){return A.b;}),r.d(n,"RLP",function(){return Ke;}),r.d(n,"_fetchData",function(){return ct.a;}),r.d(n,"fetchJson",function(){return ct.b;}),r.d(n,"poll",function(){return ct.c;}),r.d(n,"checkProperties",function(){return w.b;}),r.d(n,"deepCopy",function(){return w.c;}),r.d(n,"defineReadOnly",function(){return w.d;}),r.d(n,"getStatic",function(){return w.e;}),r.d(n,"resolveProperties",function(){return w.f;}),r.d(n,"shallowCopy",function(){return w.g;}),r.d(n,"arrayify",function(){return T.a;}),r.d(n,"concat",function(){return T.b;}),r.d(n,"stripZeros",function(){return T.o;}),r.d(n,"zeroPad",function(){return T.p;}),r.d(n,"isBytes",function(){return T.j;}),r.d(n,"isBytesLike",function(){return T.k;}),r.d(n,"defaultPath",function(){return xe.b;}),r.d(n,"HDNode",function(){return xe.a;}),r.d(n,"SigningKey",function(){return qe.a;}),r.d(n,"Interface",function(){return Pe;}),r.d(n,"LogDescription",function(){return Se;}),r.d(n,"TransactionDescription",function(){return Oe;}),r.d(n,"base58",function(){return Le.a;}),r.d(n,"base64",function(){return Fe;}),r.d(n,"hexlify",function(){return T.i;}),r.d(n,"isHexString",function(){return T.l;}),r.d(n,"hexConcat",function(){return T.c;}),r.d(n,"hexStripZeros",function(){return T.f;}),r.d(n,"hexValue",function(){return T.g;}),r.d(n,"hexZeroPad",function(){return T.h;}),r.d(n,"hexDataLength",function(){return T.d;}),r.d(n,"hexDataSlice",function(){return T.e;}),r.d(n,"nameprep",function(){return Qe.a;}),r.d(n,"_toEscapedUtf8String",function(){return H.d;}),r.d(n,"toUtf8Bytes",function(){return H.f;}),r.d(n,"toUtf8CodePoints",function(){return H.g;}),r.d(n,"toUtf8String",function(){return H.h;}),r.d(n,"Utf8ErrorFuncs",function(){return H.b;}),r.d(n,"formatBytes32String",function(){return Ye;}),r.d(n,"parseBytes32String",function(){return $e;}),r.d(n,"hashMessage",function(){return Re.a;}),r.d(n,"namehash",function(){return Be.b;}),r.d(n,"isValidName",function(){return Be.a;}),r.d(n,"id",function(){return we.a;}),r.d(n,"_TypedDataEncoder",function(){return Ne.a;}),r.d(n,"getAddress",function(){return C.a;}),r.d(n,"getIcapAddress",function(){return C.d;}),r.d(n,"getContractAddress",function(){return C.b;}),r.d(n,"getCreate2Address",function(){return C.c;}),r.d(n,"isAddress",function(){return C.e;}),r.d(n,"formatEther",function(){return st;}),r.d(n,"parseEther",function(){return ut;}),r.d(n,"formatUnits",function(){return at;}),r.d(n,"parseUnits",function(){return ot;}),r.d(n,"commify",function(){return it;}),r.d(n,"computeHmac",function(){return Ie.a;}),r.d(n,"keccak256",function(){return Ae.a;}),r.d(n,"ripemd160",function(){return Ie.b;}),r.d(n,"sha256",function(){return Ie.c;}),r.d(n,"sha512",function(){return Ie.d;}),r.d(n,"randomBytes",function(){return ze.a;}),r.d(n,"shuffled",function(){return Ze.a;}),r.d(n,"solidityPack",function(){return He;}),r.d(n,"solidityKeccak256",function(){return Ue;}),r.d(n,"soliditySha256",function(){return Ve;}),r.d(n,"splitSignature",function(){return T.n;}),r.d(n,"joinSignature",function(){return T.m;}),r.d(n,"accessListify",function(){return et.b;}),r.d(n,"parseTransaction",function(){return et.d;}),r.d(n,"serializeTransaction",function(){return et.f;}),r.d(n,"TransactionTypes",function(){return et.a;}),r.d(n,"getJsonWalletAddress",function(){return je.a;}),r.d(n,"computeAddress",function(){return et.c;}),r.d(n,"recoverAddress",function(){return et.e;}),r.d(n,"computePublicKey",function(){return qe.b;}),r.d(n,"recoverPublicKey",function(){return qe.c;}),r.d(n,"verifyMessage",function(){return f.b;}),r.d(n,"verifyTypedData",function(){return f.c;}),r.d(n,"getAccountPath",function(){return xe.d;}),r.d(n,"mnemonicToEntropy",function(){return xe.f;}),r.d(n,"entropyToMnemonic",function(){return xe.c;}),r.d(n,"isValidMnemonic",function(){return xe.e;}),r.d(n,"mnemonicToSeed",function(){return xe.g;}),r.d(n,"SupportedAlgorithm",function(){return lt.a;}),r.d(n,"UnicodeNormalizationForm",function(){return H.a;}),r.d(n,"Utf8ErrorReason",function(){return H.c;}),r.d(n,"Indexed",function(){return Me;});var o=r(46),c=r(12),l=r(159),d=r(27),f=r(52),h=r(39),m=r(62),y=r(211),v=r(7),T=r(0),w=r(1),A=r(2);const E="abi/5.4.1",S=new A.b(E);function O(e){const t=[],r=function(path,object){if(Array.isArray(object))for(let e in object){const n=path.slice();n.push(e);try{r(n,object[e]);}catch(e){t.push({path:n,error:e});}}};return r([],e),t;}class _{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n;}_throwError(e,t){S.throwArgumentError(e,this.localName,t);}}class M{constructor(e){Object(w.d)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e);}get data(){return Object(T.c)(this._data);}get length(){return this._dataLength;}_writeData(data){return this._data.push(data),this._dataLength+=data.length,data.length;}appendWriter(e){return this._writeData(Object(T.b)(e._data));}writeBytes(e){let t=Object(T.a)(e);const r=t.length%this.wordSize;return r&&(t=Object(T.b)([t,this._padding.slice(r)])),this._writeData(t);}_getValue(e){let t=Object(T.a)(c.a.from(e));return t.length>this.wordSize&&S.throwError("value out-of-bounds",A.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(T.b)([this._padding.slice(t.length%this.wordSize),t])),t;}writeValue(e){return this._writeData(this._getValue(e));}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t);};}}class k{constructor(data,e,t,r){Object(w.d)(this,"_data",Object(T.a)(data)),Object(w.d)(this,"wordSize",e||32),Object(w.d)(this,"_coerceFunc",t),Object(w.d)(this,"allowLoose",r),this._offset=0;}get data(){return Object(T.i)(this._data);}get consumed(){return this._offset;}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t;}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):k.coerce(e,t);}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:S.throwError("data out-of-bounds",A.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n);}subReader(e){return new k(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose);}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e);}readValue(){return c.a.from(this.readBytes(this.wordSize));}}var C=r(3);class P extends _{constructor(e){super("address","address",e,!1);}defaultValue(){return"0x0000000000000000000000000000000000000000";}encode(e,t){try{t=Object(C.a)(t);}catch(e){this._throwError(e.message,t);}return e.writeValue(t);}decode(e){return Object(C.a)(Object(T.h)(e.readValue().toHexString(),20));}}class F extends _{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e;}defaultValue(){return this.coder.defaultValue();}encode(e,t){return this.coder.encode(e,t);}decode(e){return this.coder.decode(e);}}const L=new A.b(E);function R(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map(t=>{const n=t.localName;return n||L.throwError("cannot encode object for signature with missing names",A.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&L.throwError("cannot encode object for signature with duplicate names",A.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n];});}else L.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&L.throwArgumentError("types/value length mismatch","tuple",r);let o=new M(e.wordSize),c=new M(e.wordSize),l=[];t.forEach((e,t)=>{let r=n[t];if(e.dynamic){let t=c.length;e.encode(c,r);let n=o.writeUpdatableValue();l.push(e=>{n(e+t);});}else e.encode(o,r);}),l.forEach(e=>{e(o.length);});let d=e.appendWriter(o);return d+=e.appendWriter(c),d;}function B(e,t){let r=[],n=e.subReader(0);t.forEach(t=>{let o=null;if(t.dynamic){let r=e.readValue(),c=n.subReader(r.toNumber());try{o=t.decode(c);}catch(e){if(e.code===A.b.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type;}}else try{o=t.decode(e);}catch(e){if(e.code===A.b.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type;}null!=o&&r.push(o);});const o=t.reduce((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e;},{});t.forEach((e,t)=>{let n=e.localName;if(!n||1!==o[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const c=r[t];c instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw c;}}):r[n]=c;});for(let i=0;i{throw e;}});}return Object.freeze(r);}class N extends _{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t;}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let i=0;ie._data.length&&L.throwError("insufficient data length",A.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let i=0;i{e.dynamic&&(r=!0),n.push(e.type);});super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e;}defaultValue(){const e=[];this.coders.forEach(t=>{e.push(t.defaultValue());});const t=this.coders.reduce((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e;},{});return this.coders.forEach((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]));}),Object.freeze(e);}encode(e,t){return R(e,this.coders,t);}decode(e){return e.coerce(this.name,B(e,this.coders));}}const z=new A.b(E),Z={};let K={calldata:!0,memory:!0,storage:!0},Q={calldata:!0,memory:!0};function W(e,t){if("bytes"===e||"string"===e){if(K[t])return!0;}else if("address"===e){if("payable"===t)return!0;}else if((e.indexOf("[")>=0||"tuple"===e)&&Q[t])return!0;return(K[t]||"payable"===t)&&z.throwArgumentError("invalid modifier","name",t),!1;}function Y(object,e){for(let t in e)Object(w.d)(object,t,e[t]);}const $=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ee=new RegExp(/^(.*)\[([0-9]*)\]$/);class te{constructor(e,t){e!==Z&&z.throwError("use fromString",A.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Y(this,t);let r=this.type.match(ee);Y(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:te.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this);}format(e){if(e||(e=$.sighash),$[e]||z.throwArgumentError("invalid format type","format",e),e===$.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(t);}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==$.sighash&&(t+=this.type),t+="("+this.components.map(t=>t.format(e)).join(e===$.full?", ":",")+")"):t+=this.type,e!==$.sighash&&(!0===this.indexed&&(t+=" indexed"),e===$.full&&this.name&&(t+=" "+this.name)),t;}static from(e,t){return"string"==typeof e?te.fromString(e,t):te.fromObject(e);}static fromObject(e){return te.isParamType(e)?e:new te(Z,{name:e.name||null,type:fe(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(te.fromObject):null});}static fromString(e,t){return r=function(param,e){let t=param;function r(i){z.throwArgumentError(`unexpected character at position ${i}`,"param",param);}function n(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r;}param=param.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},c=o;for(let i=0;ite.fromString(param,t));}class ne{constructor(e,t){e!==Z&&z.throwError("use a static from method",A.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Y(this,t),this._isFragment=!0,Object.freeze(this);}static from(e){return ne.isFragment(e)?e:"string"==typeof e?ne.fromString(e):ne.fromObject(e);}static fromObject(e){if(ne.isFragment(e))return e;switch(e.type){case"function":return ce.fromObject(e);case"event":return ie.fromObject(e);case"constructor":return ue.fromObject(e);case"error":return de.fromObject(e);case"fallback":case"receive":return null;}return z.throwArgumentError("invalid fragment object","value",e);}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?ie.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?ce.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?ue.fromString(e.trim()):"error"===e.split(" ")[0]?de.fromString(e.substring(5).trim()):z.throwArgumentError("unsupported fragment","value",e);}static isFragment(e){return!(!e||!e._isFragment);}}class ie extends ne{format(e){if(e||(e=$.sighash),$[e]||z.throwArgumentError("invalid format type","format",e),e===$.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(e)))});let t="";return e!==$.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map(input=>input.format(e)).join(e===$.full?", ":",")+") ",e!==$.sighash&&this.anonymous&&(t+="anonymous "),t.trim();}static from(e){return"string"==typeof e?ie.fromString(e):ie.fromObject(e);}static fromObject(e){if(ie.isEventFragment(e))return e;"event"!==e.type&&z.throwArgumentError("invalid event object","value",e);const t={name:pe(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(te.fromObject):[],type:"event"};return new ie(Z,t);}static fromString(e){let t=e.match(me);t||z.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach(e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:z.warn("unknown modifier: "+e);}}),ie.fromObject({name:t[1].trim(),anonymous:r,inputs:re(t[2],!0),type:"event"});}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type;}}function ae(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&z.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||z.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=c.a.from(r[1]),r[0]):e;}function oe(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach(e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e);}});}function se(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&z.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&z.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||z.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&z.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&z.throwArgumentError("unable to determine stateMutability","value",e),t;}class ue extends ne{format(e){if(e||(e=$.sighash),$[e]||z.throwArgumentError("invalid format type","format",e),e===$.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(input=>JSON.parse(input.format(e)))});e===$.sighash&&z.throwError("cannot format a constructor for sighash",A.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map(input=>input.format(e)).join(e===$.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim();}static from(e){return"string"==typeof e?ue.fromString(e):ue.fromObject(e);}static fromObject(e){if(ue.isConstructorFragment(e))return e;"constructor"!==e.type&&z.throwArgumentError("invalid constructor object","value",e);let t=se(e);t.constant&&z.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(te.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?c.a.from(e.gas):null};return new ue(Z,r);}static fromString(e){let t={type:"constructor"},r=(e=ae(e,t)).match(me);return r&&"constructor"===r[1].trim()||z.throwArgumentError("invalid constructor string","value",e),t.inputs=re(r[2].trim(),!1),oe(r[3].trim(),t),ue.fromObject(t);}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type;}}class ce extends ue{format(e){if(e||(e=$.sighash),$[e]||z.throwArgumentError("invalid format type","format",e),e===$.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(input=>JSON.parse(input.format(e))),outputs:this.outputs.map(output=>JSON.parse(output.format(e)))});let t="";return e!==$.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map(input=>input.format(e)).join(e===$.full?", ":",")+") ",e!==$.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map(output=>output.format(e)).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim();}static from(e){return"string"==typeof e?ce.fromString(e):ce.fromObject(e);}static fromObject(e){if(ce.isFunctionFragment(e))return e;"function"!==e.type&&z.throwArgumentError("invalid function object","value",e);let t=se(e);const r={type:e.type,name:pe(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(te.fromObject):[],outputs:e.outputs?e.outputs.map(te.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?c.a.from(e.gas):null};return new ce(Z,r);}static fromString(e){let t={type:"function"},r=(e=ae(e,t)).split(" returns ");r.length>2&&z.throwArgumentError("invalid function string","value",e);let n=r[0].match(me);if(n||z.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&pe(t.name),t.inputs=re(n[2],!1),oe(n[3].trim(),t),r.length>1){let n=r[1].match(me);""==n[1].trim()&&""==n[3].trim()||z.throwArgumentError("unexpected tokens","value",e),t.outputs=re(n[2],!1);}else t.outputs=[];return ce.fromObject(t);}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type;}}function le(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||z.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e;}class de extends ne{format(e){if(e||(e=$.sighash),$[e]||z.throwArgumentError("invalid format type","format",e),e===$.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(e)))});let t="";return e!==$.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map(input=>input.format(e)).join(e===$.full?", ":",")+") ",t.trim();}static from(e){return"string"==typeof e?de.fromString(e):de.fromObject(e);}static fromObject(e){if(de.isErrorFragment(e))return e;"error"!==e.type&&z.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:pe(e.name),inputs:e.inputs?e.inputs.map(te.fromObject):[]};return le(new de(Z,t));}static fromString(e){let t={type:"error"},r=e.match(me);return r||z.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&pe(t.name),t.inputs=re(r[2],!1),le(de.fromObject(t));}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type;}}function fe(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e;}const he=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function pe(e){return e&&e.match(he)||z.throwArgumentError(`invalid identifier "${e}"`,"value",e),e;}const me=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const ye=new A.b(E),ge=new RegExp(/^bytes([0-9]*)$/),be=new RegExp(/^(u?int)([0-9]*)$/);class ve{constructor(e){ye.checkNew(new.target,ve),Object(w.d)(this,"coerceFunc",e||null);}_getCoder(param){switch(param.baseType){case"address":return new P(param.name);case"bool":return new x(param.name);case"string":return new U(param.name);case"bytes":return new I(param.name);case"array":return new N(this._getCoder(param.arrayChildren),param.arrayLength,param.name);case"tuple":return new V((param.components||[]).map(component=>this._getCoder(component)),param.name);case"":return new D(param.name);}let e=param.type.match(be);if(e){let t=parseInt(e[2]||"256");return(0===t||t>256||t%8!=0)&&ye.throwArgumentError("invalid "+e[1]+" bit length","param",param),new G(t/8,"int"===e[1],param.name);}if(e=param.type.match(ge),e){let t=parseInt(e[1]);return(0===t||t>32)&&ye.throwArgumentError("invalid bytes length","param",param),new J(t,param.name);}return ye.throwArgumentError("invalid type","type",param.type);}_getWordSize(){return 32;}_getReader(data,e){return new k(data,this._getWordSize(),this.coerceFunc,e);}_getWriter(){return new M(this._getWordSize());}getDefaultValue(e){const t=e.map(e=>this._getCoder(te.from(e)));return new V(t,"_").defaultValue();}encode(e,t){e.length!==t.length&&ye.throwError("types/values length mismatch",A.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map(e=>this._getCoder(te.from(e))),n=new V(r,"_"),o=this._getWriter();return n.encode(o,t),o.data;}decode(e,data,t){const r=e.map(e=>this._getCoder(te.from(e)));return new V(r,"_").decode(this._getReader(Object(T.a)(data),t));}}const Te=new ve();var we=r(103),Ae=r(5);const Ee=new A.b(E);class Se extends w.a{}class Oe extends w.a{}class _e extends w.a{}class Me extends w.a{static isIndexed(e){return!(!e||!e._isIndexed);}}const ke={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Ce(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r;}class Pe{constructor(e){Ee.checkNew(new.target,Pe);let t=[];t="string"==typeof e?JSON.parse(e):e,Object(w.d)(this,"fragments",t.map(e=>ne.from(e)).filter(e=>null!=e)),Object(w.d)(this,"_abiCoder",Object(w.e)(new.target,"getAbiCoder")()),Object(w.d)(this,"functions",{}),Object(w.d)(this,"errors",{}),Object(w.d)(this,"events",{}),Object(w.d)(this,"structs",{}),this.fragments.forEach(e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void Ee.warn("duplicate definition - constructor"):void Object(w.d)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return;}let r=e.format();t[r]?Ee.warn("duplicate definition - "+r):t[r]=e;}),this.deploy||Object(w.d)(this,"deploy",ue.from({payable:!1,type:"constructor"})),Object(w.d)(this,"_isInterface",!0);}format(e){e||(e=$.full),e===$.sighash&&Ee.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map(t=>t.format(e));return e===$.json?JSON.stringify(t.map(e=>JSON.parse(e))):t;}static getAbiCoder(){return Te;}static getAddress(address){return Object(C.a)(address);}static getSighash(e){return Object(T.e)(Object(we.a)(e.format()),0,4);}static getEventTopic(e){return Object(we.a)(e.format());}getFunction(e){if(Object(T.l)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Ee.throwArgumentError("no matching function","sighash",e);}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter(e=>e.split("(")[0]===t);return 0===r.length?Ee.throwArgumentError("no matching function","name",t):r.length>1&&Ee.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]];}const t=this.functions[ce.fromString(e).format()];return t||Ee.throwArgumentError("no matching function","signature",e),t;}getEvent(e){if(Object(T.l)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Ee.throwArgumentError("no matching event","topichash",t);}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter(e=>e.split("(")[0]===t);return 0===r.length?Ee.throwArgumentError("no matching event","name",t):r.length>1&&Ee.throwArgumentError("multiple matching events","name",t),this.events[r[0]];}const t=this.events[ie.fromString(e).format()];return t||Ee.throwArgumentError("no matching event","signature",e),t;}getError(e){if(Object(T.l)(e)){const t=Object(w.e)(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r];}Ee.throwArgumentError("no matching error","sighash",e);}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter(e=>e.split("(")[0]===t);return 0===r.length?Ee.throwArgumentError("no matching error","name",t):r.length>1&&Ee.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]];}const t=this.errors[ce.fromString(e).format()];return t||Ee.throwArgumentError("no matching error","signature",e),t;}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e);}catch(t){try{e=this.getError(e);}catch(e){throw t;}}return Object(w.e)(this.constructor,"getSighash")(e);}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),Object(w.e)(this.constructor,"getEventTopic")(e);}_decodeParams(e,data){return this._abiCoder.decode(e,data);}_encodeParams(e,t){return this._abiCoder.encode(e,t);}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[]);}decodeErrorResult(e,data){"string"==typeof e&&(e=this.getError(e));const t=Object(T.a)(data);return Object(T.i)(t.slice(0,4))!==this.getSighash(e)&&Ee.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Object(T.i)(t)),this._decodeParams(e.inputs,t.slice(4));}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(T.i)(Object(T.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]));}decodeFunctionData(e,data){"string"==typeof e&&(e=this.getFunction(e));const t=Object(T.a)(data);return Object(T.i)(t.slice(0,4))!==this.getSighash(e)&&Ee.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Object(T.i)(t)),this._decodeParams(e.inputs,t.slice(4));}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(T.i)(Object(T.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]));}decodeFunctionResult(e,data){"string"==typeof e&&(e=this.getFunction(e));let t=Object(T.a)(data),r=null,n=null,o=null,c=null;switch(t.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,t);}catch(e){}break;case 4:{const e=Object(T.i)(t.slice(0,4)),l=ke[e];if(l)n=this._abiCoder.decode(l.inputs,t.slice(4)),o=l.name,c=l.signature,l.reason&&(r=n[0]);else try{const r=this.getError(e);n=this._abiCoder.decode(r.inputs,t.slice(4)),o=r.name,c=r.format();}catch(e){console.log(e);}break;}}return Ee.throwError("call revert exception",A.b.errors.CALL_EXCEPTION,{method:e.format(),errorArgs:n,errorName:o,errorSignature:c,reason:r});}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(T.i)(this._abiCoder.encode(e.outputs,t||[]));}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Ee.throwError("too many arguments for "+e.format(),A.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(param,e)=>"string"===param.type?Object(we.a)(e):"bytes"===param.type?Object(Ae.a)(Object(T.i)(e)):("address"===param.type&&this._abiCoder.encode(["address"],[e]),Object(T.h)(Object(T.i)(e),32));for(t.forEach((t,o)=>{let param=e.inputs[o];param.indexed?null==t?r.push(null):"array"===param.baseType||"tuple"===param.baseType?Ee.throwArgumentError("filtering with tuples or arrays not supported","contract."+param.name,t):Array.isArray(t)?r.push(t.map(e=>n(param,e))):r.push(n(param,t)):null!=t&&Ee.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+param.name,t);});r.length&&null===r[r.length-1];)r.pop();return r;}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Ee.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((param,e)=>{const c=t[e];if(param.indexed){if("string"===param.type)r.push(Object(we.a)(c));else if("bytes"===param.type)r.push(Object(Ae.a)(c));else{if("tuple"===param.baseType||"array"===param.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([param.type],[c]));}}else n.push(param),o.push(c);}),{data:this._abiCoder.encode(n,o),topics:r};}decodeEventLog(e,data,t){if("string"==typeof e&&(e=this.getEvent(e)),null!=t&&!e.anonymous){let r=this.getEventTopic(e);Object(T.l)(t[0],32)&&t[0].toLowerCase()===r||Ee.throwError("fragment/topic mismatch",A.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:r,value:t[0]}),t=t.slice(1);}let r=[],n=[],o=[];e.inputs.forEach((param,e)=>{param.indexed?"string"===param.type||"bytes"===param.type||"tuple"===param.baseType||"array"===param.baseType?(r.push(te.fromObject({type:"bytes32",name:param.name})),o.push(!0)):(r.push(param),o.push(!1)):(n.push(param),o.push(!1));});let c=null!=t?this._abiCoder.decode(r,Object(T.b)(t)):null,l=this._abiCoder.decode(n,data,!0),d=[],f=0,h=0;e.inputs.forEach((param,e)=>{if(param.indexed){if(null==c)d[e]=new Me({_isIndexed:!0,hash:null});else if(o[e])d[e]=new Me({_isIndexed:!0,hash:c[h++]});else try{d[e]=c[h++];}catch(t){d[e]=t;}}else try{d[e]=l[f++];}catch(t){d[e]=t;}if(param.name&&null==d[param.name]){const t=d[e];t instanceof Error?Object.defineProperty(d,param.name,{enumerable:!0,get:()=>{throw Ce(`property ${JSON.stringify(param.name)}`,t);}}):d[param.name]=t;}});for(let i=0;i{throw Ce(`index ${i}`,e);}});}return Object.freeze(d);}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Oe({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:c.a.from(e.value||"0")}):null;}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Se({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)});}parseError(data){const e=Object(T.i)(data);let t=this.getError(e.substring(0,10).toLowerCase());return t?new _e({args:this._abiCoder.decode(t.inputs,"0x"+e.substring(10)),errorFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t)}):null;}static isInterface(e){return!(!e||!e._isInterface);}}var Fe=r(84),Le=r(41),Re=r(217),Be=r(219),Ne=r(218),xe=r(14),je=r(42),Ie=r(145);const Je=new RegExp("^bytes([0-9]+)$"),De=new RegExp("^(u?int)([0-9]*)$"),Xe=new RegExp("^(.*)\\[([0-9]*)\\]$");function Ge(e,t,r){switch(e){case"address":return r?Object(T.p)(t,32):Object(T.a)(t);case"string":return Object(H.f)(t);case"bytes":return Object(T.a)(t);case"bool":return t=t?"0x01":"0x00",r?Object(T.p)(t,32):Object(T.a)(t);}let n=e.match(De);if(n){let o=parseInt(n[2]||"256");if(n[2]&&String(o)!==n[2]||o%8!=0||0===o||o>256)throw new Error("invalid number type - "+e);return r&&(o=256),t=c.a.from(t).toTwos(o),Object(T.p)(t,o/8);}if(n=e.match(Je),n){const o=parseInt(n[1]);if(String(o)!==n[1]||0===o||o>32)throw new Error("invalid bytes type - "+e);if(Object(T.a)(t).byteLength!==o)throw new Error("invalid value for "+e);return r?Object(T.a)((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t;}if(n=e.match(Xe),n&&Array.isArray(t)){const r=n[1];if(parseInt(n[2]||String(t.length))!=t.length)throw new Error("invalid value for "+e);const o=[];return t.forEach(function(e){o.push(Ge(r,e,!0));}),Object(T.b)(o);}throw new Error("invalid type - "+e);}function He(e,t){if(e.length!=t.length)throw new Error("type/value count mismatch");const r=[];return e.forEach(function(e,n){r.push(Ge(e,t[n]));}),Object(T.i)(Object(T.b)(r));}function Ue(e,t){return Object(Ae.a)(He(e,t));}function Ve(e,t){return Object(Ie.c)(He(e,t));}var ze=r(81),Ze=r(220),Ke=r(28),qe=r(25),Qe=r(144),We=r(111);function Ye(text){const e=Object(H.f)(text);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(T.i)(Object(T.b)([e,We.a]).slice(0,32));}function $e(e){const data=Object(T.a)(e);if(32!==data.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==data[31])throw new Error("invalid bytes32 string - no null terminator");let t=31;for(;0===data[t-1];)t--;return Object(H.h)(data.slice(0,t));}var et=r(11);const tt=new A.b("units/5.4.0"),nt=["wei","kwei","mwei","gwei","szabo","finney","ether"];function it(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&tt.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let o="";for(2===t.length&&(o="."+(t[1]||"0"));o.length>2&&"0"===o[o.length-1];)o=o.substring(0,o.length-1);const c=[];for(;r.length;){if(r.length<=3){c.unshift(r);break;}{const e=r.length-3;c.unshift(r.substring(e)),r=r.substring(0,e);}}return n+c.join(",")+o;}function at(e,t){if("string"==typeof t){const e=nt.indexOf(t);-1!==e&&(t=3*e);}return Object(l.b)(e,null!=t?t:18);}function ot(e,t){if("string"!=typeof e&&tt.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=nt.indexOf(t);-1!==e&&(t=3*e);}return Object(l.c)(e,null!=t?t:18);}function st(e){return at(e,18);}function ut(e){return ot(e,18);}var ct=r(15),lt=r(141),ft=r(75);const ht=new A.b(ft.a);},function(e,t,r){"use strict";r.d(t,"a",function(){return l;});var n=r(0),o=r(1);class c{constructor(e){Object(o.d)(this,"alphabet",e),Object(o.d)(this,"base",e.length),Object(o.d)(this,"_alphabetMap",{}),Object(o.d)(this,"_leader",e.charAt(0));for(let i=0;i0;)t.push(e%this.base),e=e/this.base|0;}let r="";for(let e=0;0===source[e]&&e=0;--q)r+=this.alphabet[t[q]];return r;}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let i=0;i>=8;for(;n>0;)t.push(255&n),n>>=8;}for(let r=0;e[r]===this._leader&&rthis.wordSize&&f.throwError("value out-of-bounds",l.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(n.b)([this._padding.slice(t.length%this.wordSize),t])),t;}writeValue(e){return this._writeData(this._getValue(e));}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t);};}}class y{constructor(data,e,t,r){Object(c.d)(this,"_data",Object(n.a)(data)),Object(c.d)(this,"wordSize",e||32),Object(c.d)(this,"_coerceFunc",t),Object(c.d)(this,"allowLoose",r),this._offset=0;}get data(){return Object(n.i)(this._data);}get consumed(){return this._offset;}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t;}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):y.coerce(e,t);}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:f.throwError("data out-of-bounds",l.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n);}subReader(e){return new y(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose);}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e);}readValue(){return o.a.from(this.readBytes(this.wordSize));}}var v=r(3),T=r(103),w=r(5);class A extends h{constructor(e){super("address","address",e,!1);}defaultValue(){return"0x0000000000000000000000000000000000000000";}encode(e,t){try{t=Object(v.a)(t);}catch(e){this._throwError(e.message,t);}return e.writeValue(t);}decode(e){return Object(v.a)(Object(n.h)(e.readValue().toHexString(),20));}}class E extends h{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e;}defaultValue(){return this.coder.defaultValue();}encode(e,t){return this.coder.encode(e,t);}decode(e){return this.coder.decode(e);}}const S=new l.b(d);function O(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map(t=>{const n=t.localName;return n||S.throwError("cannot encode object for signature with missing names",l.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&S.throwError("cannot encode object for signature with duplicate names",l.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n];});}else S.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&S.throwArgumentError("types/value length mismatch","tuple",r);let o=new m(e.wordSize),c=new m(e.wordSize),d=[];t.forEach((e,t)=>{let r=n[t];if(e.dynamic){let t=c.length;e.encode(c,r);let n=o.writeUpdatableValue();d.push(e=>{n(e+t);});}else e.encode(o,r);}),d.forEach(e=>{e(o.length);});let f=e.appendWriter(o);return f+=e.appendWriter(c),f;}function _(e,t){let r=[],n=e.subReader(0);t.forEach(t=>{let o=null;if(t.dynamic){let r=e.readValue(),c=n.subReader(r.toNumber());try{o=t.decode(c);}catch(e){if(e.code===l.b.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type;}}else try{o=t.decode(e);}catch(e){if(e.code===l.b.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type;}null!=o&&r.push(o);});const o=t.reduce((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e;},{});t.forEach((e,t)=>{let n=e.localName;if(!n||1!==o[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const c=r[t];c instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw c;}}):r[n]=c;});for(let i=0;i{throw e;}});}return Object.freeze(r);}class M extends h{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t;}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let i=0;ie._data.length&&S.throwError("insufficient data length",l.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let i=0;i{e.dynamic&&(r=!0),n.push(e.type);});super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e;}defaultValue(){const e=[];this.coders.forEach(t=>{e.push(t.defaultValue());});const t=this.coders.reduce((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e;},{});return this.coders.forEach((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]));}),Object.freeze(e);}encode(e,t){return O(e,this.coders,t);}decode(e){return e.coerce(this.name,_(e,this.coders));}}const I=new l.b(d),J={};let D={calldata:!0,memory:!0,storage:!0},X={calldata:!0,memory:!0};function G(e,t){if("bytes"===e||"string"===e){if(D[t])return!0;}else if("address"===e){if("payable"===t)return!0;}else if((e.indexOf("[")>=0||"tuple"===e)&&X[t])return!0;return(D[t]||"payable"===t)&&I.throwArgumentError("invalid modifier","name",t),!1;}function H(object,e){for(let t in e)Object(c.d)(object,t,e[t]);}const U=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),V=new RegExp(/^(.*)\[([0-9]*)\]$/);class z{constructor(e,t){e!==J&&I.throwError("use fromString",l.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),H(this,t);let r=this.type.match(V);H(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:z.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this);}format(e){if(e||(e=U.sighash),U[e]||I.throwArgumentError("invalid format type","format",e),e===U.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(t);}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==U.sighash&&(t+=this.type),t+="("+this.components.map(t=>t.format(e)).join(e===U.full?", ":",")+")"):t+=this.type,e!==U.sighash&&(!0===this.indexed&&(t+=" indexed"),e===U.full&&this.name&&(t+=" "+this.name)),t;}static from(e,t){return"string"==typeof e?z.fromString(e,t):z.fromObject(e);}static fromObject(e){return z.isParamType(e)?e:new z(J,{name:e.name||null,type:ie(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(z.fromObject):null});}static fromString(e,t){return r=function(param,e){let t=param;function r(i){I.throwArgumentError(`unexpected character at position ${i}`,"param",param);}function n(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r;}param=param.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},c=o;for(let i=0;iz.fromString(param,t));}class K{constructor(e,t){e!==J&&I.throwError("use a static from method",l.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),H(this,t),this._isFragment=!0,Object.freeze(this);}static from(e){return K.isFragment(e)?e:"string"==typeof e?K.fromString(e):K.fromObject(e);}static fromObject(e){if(K.isFragment(e))return e;switch(e.type){case"function":return te.fromObject(e);case"event":return Q.fromObject(e);case"constructor":return ee.fromObject(e);case"error":return ne.fromObject(e);case"fallback":case"receive":return null;}return I.throwArgumentError("invalid fragment object","value",e);}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Q.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?te.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?ee.fromString(e.trim()):"error"===e.split(" ")[0]?ne.fromString(e.substring(5).trim()):I.throwArgumentError("unsupported fragment","value",e);}static isFragment(e){return!(!e||!e._isFragment);}}class Q extends K{format(e){if(e||(e=U.sighash),U[e]||I.throwArgumentError("invalid format type","format",e),e===U.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(e)))});let t="";return e!==U.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map(input=>input.format(e)).join(e===U.full?", ":",")+") ",e!==U.sighash&&this.anonymous&&(t+="anonymous "),t.trim();}static from(e){return"string"==typeof e?Q.fromString(e):Q.fromObject(e);}static fromObject(e){if(Q.isEventFragment(e))return e;"event"!==e.type&&I.throwArgumentError("invalid event object","value",e);const t={name:oe(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(z.fromObject):[],type:"event"};return new Q(J,t);}static fromString(e){let t=e.match(se);t||I.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach(e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:I.warn("unknown modifier: "+e);}}),Q.fromObject({name:t[1].trim(),anonymous:r,inputs:Z(t[2],!0),type:"event"});}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type;}}function W(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&I.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||I.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=o.a.from(r[1]),r[0]):e;}function Y(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach(e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e);}});}function $(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&I.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&I.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||I.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&I.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&I.throwArgumentError("unable to determine stateMutability","value",e),t;}class ee extends K{format(e){if(e||(e=U.sighash),U[e]||I.throwArgumentError("invalid format type","format",e),e===U.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(input=>JSON.parse(input.format(e)))});e===U.sighash&&I.throwError("cannot format a constructor for sighash",l.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map(input=>input.format(e)).join(e===U.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim();}static from(e){return"string"==typeof e?ee.fromString(e):ee.fromObject(e);}static fromObject(e){if(ee.isConstructorFragment(e))return e;"constructor"!==e.type&&I.throwArgumentError("invalid constructor object","value",e);let t=$(e);t.constant&&I.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(z.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?o.a.from(e.gas):null};return new ee(J,r);}static fromString(e){let t={type:"constructor"},r=(e=W(e,t)).match(se);return r&&"constructor"===r[1].trim()||I.throwArgumentError("invalid constructor string","value",e),t.inputs=Z(r[2].trim(),!1),Y(r[3].trim(),t),ee.fromObject(t);}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type;}}class te extends ee{format(e){if(e||(e=U.sighash),U[e]||I.throwArgumentError("invalid format type","format",e),e===U.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(input=>JSON.parse(input.format(e))),outputs:this.outputs.map(output=>JSON.parse(output.format(e)))});let t="";return e!==U.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map(input=>input.format(e)).join(e===U.full?", ":",")+") ",e!==U.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map(output=>output.format(e)).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim();}static from(e){return"string"==typeof e?te.fromString(e):te.fromObject(e);}static fromObject(e){if(te.isFunctionFragment(e))return e;"function"!==e.type&&I.throwArgumentError("invalid function object","value",e);let t=$(e);const r={type:e.type,name:oe(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(z.fromObject):[],outputs:e.outputs?e.outputs.map(z.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?o.a.from(e.gas):null};return new te(J,r);}static fromString(e){let t={type:"function"},r=(e=W(e,t)).split(" returns ");r.length>2&&I.throwArgumentError("invalid function string","value",e);let n=r[0].match(se);if(n||I.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&oe(t.name),t.inputs=Z(n[2],!1),Y(n[3].trim(),t),r.length>1){let n=r[1].match(se);""==n[1].trim()&&""==n[3].trim()||I.throwArgumentError("unexpected tokens","value",e),t.outputs=Z(n[2],!1);}else t.outputs=[];return te.fromObject(t);}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type;}}function re(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||I.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e;}class ne extends K{format(e){if(e||(e=U.sighash),U[e]||I.throwArgumentError("invalid format type","format",e),e===U.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(e)))});let t="";return e!==U.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map(input=>input.format(e)).join(e===U.full?", ":",")+") ",t.trim();}static from(e){return"string"==typeof e?ne.fromString(e):ne.fromObject(e);}static fromObject(e){if(ne.isErrorFragment(e))return e;"error"!==e.type&&I.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:oe(e.name),inputs:e.inputs?e.inputs.map(z.fromObject):[]};return re(new ne(J,t));}static fromString(e){let t={type:"error"},r=e.match(se);return r||I.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&oe(t.name),t.inputs=Z(r[2],!1),re(ne.fromObject(t));}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type;}}function ie(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e;}const ae=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function oe(e){return e&&e.match(ae)||I.throwArgumentError(`invalid identifier "${e}"`,"value",e),e;}const se=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const ue=new l.b(d),ce=new RegExp(/^bytes([0-9]*)$/),le=new RegExp(/^(u?int)([0-9]*)$/);class de{constructor(e){ue.checkNew(new.target,de),Object(c.d)(this,"coerceFunc",e||null);}_getCoder(param){switch(param.baseType){case"address":return new A(param.name);case"bool":return new k(param.name);case"string":return new x(param.name);case"bytes":return new P(param.name);case"array":return new M(this._getCoder(param.arrayChildren),param.arrayLength,param.name);case"tuple":return new j((param.components||[]).map(component=>this._getCoder(component)),param.name);case"":return new L(param.name);}let e=param.type.match(le);if(e){let t=parseInt(e[2]||"256");return(0===t||t>256||t%8!=0)&&ue.throwArgumentError("invalid "+e[1]+" bit length","param",param),new B(t/8,"int"===e[1],param.name);}if(e=param.type.match(ce),e){let t=parseInt(e[1]);return(0===t||t>32)&&ue.throwArgumentError("invalid bytes length","param",param),new F(t,param.name);}return ue.throwArgumentError("invalid type","type",param.type);}_getWordSize(){return 32;}_getReader(data,e){return new y(data,this._getWordSize(),this.coerceFunc,e);}_getWriter(){return new m(this._getWordSize());}getDefaultValue(e){const t=e.map(e=>this._getCoder(z.from(e)));return new j(t,"_").defaultValue();}encode(e,t){e.length!==t.length&&ue.throwError("types/values length mismatch",l.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map(e=>this._getCoder(z.from(e))),n=new j(r,"_"),o=this._getWriter();return n.encode(o,t),o.data;}decode(e,data,t){const r=e.map(e=>this._getCoder(z.from(e)));return new j(r,"_").decode(this._getReader(Object(n.a)(data),t));}}const fe=new de(),he=new l.b(d);class pe extends c.a{}class me extends c.a{}class ye extends c.a{}class ge extends c.a{static isIndexed(e){return!(!e||!e._isIndexed);}}const be={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function ve(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r;}class Te{constructor(e){he.checkNew(new.target,Te);let t=[];t="string"==typeof e?JSON.parse(e):e,Object(c.d)(this,"fragments",t.map(e=>K.from(e)).filter(e=>null!=e)),Object(c.d)(this,"_abiCoder",Object(c.e)(new.target,"getAbiCoder")()),Object(c.d)(this,"functions",{}),Object(c.d)(this,"errors",{}),Object(c.d)(this,"events",{}),Object(c.d)(this,"structs",{}),this.fragments.forEach(e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void he.warn("duplicate definition - constructor"):void Object(c.d)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return;}let r=e.format();t[r]?he.warn("duplicate definition - "+r):t[r]=e;}),this.deploy||Object(c.d)(this,"deploy",ee.from({payable:!1,type:"constructor"})),Object(c.d)(this,"_isInterface",!0);}format(e){e||(e=U.full),e===U.sighash&&he.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map(t=>t.format(e));return e===U.json?JSON.stringify(t.map(e=>JSON.parse(e))):t;}static getAbiCoder(){return fe;}static getAddress(address){return Object(v.a)(address);}static getSighash(e){return Object(n.e)(Object(T.a)(e.format()),0,4);}static getEventTopic(e){return Object(T.a)(e.format());}getFunction(e){if(Object(n.l)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];he.throwArgumentError("no matching function","sighash",e);}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter(e=>e.split("(")[0]===t);return 0===r.length?he.throwArgumentError("no matching function","name",t):r.length>1&&he.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]];}const t=this.functions[te.fromString(e).format()];return t||he.throwArgumentError("no matching function","signature",e),t;}getEvent(e){if(Object(n.l)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];he.throwArgumentError("no matching event","topichash",t);}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter(e=>e.split("(")[0]===t);return 0===r.length?he.throwArgumentError("no matching event","name",t):r.length>1&&he.throwArgumentError("multiple matching events","name",t),this.events[r[0]];}const t=this.events[Q.fromString(e).format()];return t||he.throwArgumentError("no matching event","signature",e),t;}getError(e){if(Object(n.l)(e)){const t=Object(c.e)(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r];}he.throwArgumentError("no matching error","sighash",e);}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter(e=>e.split("(")[0]===t);return 0===r.length?he.throwArgumentError("no matching error","name",t):r.length>1&&he.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]];}const t=this.errors[te.fromString(e).format()];return t||he.throwArgumentError("no matching error","signature",e),t;}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e);}catch(t){try{e=this.getError(e);}catch(e){throw t;}}return Object(c.e)(this.constructor,"getSighash")(e);}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),Object(c.e)(this.constructor,"getEventTopic")(e);}_decodeParams(e,data){return this._abiCoder.decode(e,data);}_encodeParams(e,t){return this._abiCoder.encode(e,t);}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[]);}decodeErrorResult(e,data){"string"==typeof e&&(e=this.getError(e));const t=Object(n.a)(data);return Object(n.i)(t.slice(0,4))!==this.getSighash(e)&&he.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Object(n.i)(t)),this._decodeParams(e.inputs,t.slice(4));}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(n.i)(Object(n.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]));}decodeFunctionData(e,data){"string"==typeof e&&(e=this.getFunction(e));const t=Object(n.a)(data);return Object(n.i)(t.slice(0,4))!==this.getSighash(e)&&he.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Object(n.i)(t)),this._decodeParams(e.inputs,t.slice(4));}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(n.i)(Object(n.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]));}decodeFunctionResult(e,data){"string"==typeof e&&(e=this.getFunction(e));let t=Object(n.a)(data),r=null,o=null,c=null,d=null;switch(t.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,t);}catch(e){}break;case 4:{const e=Object(n.i)(t.slice(0,4)),l=be[e];if(l)o=this._abiCoder.decode(l.inputs,t.slice(4)),c=l.name,d=l.signature,l.reason&&(r=o[0]);else try{const r=this.getError(e);o=this._abiCoder.decode(r.inputs,t.slice(4)),c=r.name,d=r.format();}catch(e){console.log(e);}break;}}return he.throwError("call revert exception",l.b.errors.CALL_EXCEPTION,{method:e.format(),errorArgs:o,errorName:c,errorSignature:d,reason:r});}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(n.i)(this._abiCoder.encode(e.outputs,t||[]));}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&he.throwError("too many arguments for "+e.format(),l.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const o=(param,e)=>"string"===param.type?Object(T.a)(e):"bytes"===param.type?Object(w.a)(Object(n.i)(e)):("address"===param.type&&this._abiCoder.encode(["address"],[e]),Object(n.h)(Object(n.i)(e),32));for(t.forEach((t,n)=>{let param=e.inputs[n];param.indexed?null==t?r.push(null):"array"===param.baseType||"tuple"===param.baseType?he.throwArgumentError("filtering with tuples or arrays not supported","contract."+param.name,t):Array.isArray(t)?r.push(t.map(e=>o(param,e))):r.push(o(param,t)):null!=t&&he.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+param.name,t);});r.length&&null===r[r.length-1];)r.pop();return r;}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&he.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((param,e)=>{const c=t[e];if(param.indexed){if("string"===param.type)r.push(Object(T.a)(c));else if("bytes"===param.type)r.push(Object(w.a)(c));else{if("tuple"===param.baseType||"array"===param.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([param.type],[c]));}}else n.push(param),o.push(c);}),{data:this._abiCoder.encode(n,o),topics:r};}decodeEventLog(e,data,t){if("string"==typeof e&&(e=this.getEvent(e)),null!=t&&!e.anonymous){let r=this.getEventTopic(e);Object(n.l)(t[0],32)&&t[0].toLowerCase()===r||he.throwError("fragment/topic mismatch",l.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:r,value:t[0]}),t=t.slice(1);}let r=[],o=[],c=[];e.inputs.forEach((param,e)=>{param.indexed?"string"===param.type||"bytes"===param.type||"tuple"===param.baseType||"array"===param.baseType?(r.push(z.fromObject({type:"bytes32",name:param.name})),c.push(!0)):(r.push(param),c.push(!1)):(o.push(param),c.push(!1));});let d=null!=t?this._abiCoder.decode(r,Object(n.b)(t)):null,f=this._abiCoder.decode(o,data,!0),h=[],m=0,y=0;e.inputs.forEach((param,e)=>{if(param.indexed){if(null==d)h[e]=new ge({_isIndexed:!0,hash:null});else if(c[e])h[e]=new ge({_isIndexed:!0,hash:d[y++]});else try{h[e]=d[y++];}catch(t){h[e]=t;}}else try{h[e]=f[m++];}catch(t){h[e]=t;}if(param.name&&null==h[param.name]){const t=h[e];t instanceof Error?Object.defineProperty(h,param.name,{enumerable:!0,get:()=>{throw ve(`property ${JSON.stringify(param.name)}`,t);}}):h[param.name]=t;}});for(let i=0;i{throw ve(`index ${i}`,e);}});}return Object.freeze(h);}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new me({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:o.a.from(e.value||"0")}):null;}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new pe({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)});}parseError(data){const e=Object(n.i)(data);let t=this.getError(e.substring(0,10).toLowerCase());return t?new ye({args:this._abiCoder.decode(t.inputs,"0x"+e.substring(10)),errorFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t)}):null;}static isInterface(e){return!(!e||!e._isInterface);}}var we=r(31),Ae=r(27),Ee=r(11);var Se=function(e,t,r,n){return new(r||(r=Promise))(function(o,c){function l(e){try{f(n.next(e));}catch(e){c(e);}}function d(e){try{f(n.throw(e));}catch(e){c(e);}}function f(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t);})).then(l,d);}f((n=n.apply(e,t||[])).next());});};const Oe=new l.b("contracts/5.4.1"),_e={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};function Me(e,t){return Se(this,void 0,void 0,function*(){const r=yield t;try{return Object(v.a)(r);}catch(e){}e||Oe.throwError("a provider or signer is needed to resolve ENS names",l.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const address=yield e.resolveName(r);return null==address&&Oe.throwArgumentError("resolver or addr is not configured for ENS name","name",r),address;});}function ke(e,t,r){return Se(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((r,n)=>ke(e,Array.isArray(t)?t[n]:t[r.name],r))):"address"===r.type?yield Me(e,t):"tuple"===r.type?yield ke(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map(t=>ke(e,t,r.arrayChildren))):Promise.reject(new Error("invalid value for array")):t;});}function Ce(e,t,r){return Se(this,void 0,void 0,function*(){let d={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(d=Object(c.g)(r.pop())),Oe.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?d.from?d.from=Object(c.f)({override:Me(e.signer,d.from),signer:e.signer.getAddress()}).then(e=>Se(this,void 0,void 0,function*(){return Object(v.a)(e.signer)!==e.override&&Oe.throwError("Contract with a Signer cannot override from",l.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override;})):d.from=e.signer.getAddress():d.from&&(d.from=Me(e.provider,d.from));const f=yield Object(c.f)({args:ke(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:Object(c.f)(d)||{}}),data=e.interface.encodeFunctionData(t,f.args),h={data:data,to:f.address},m=f.overrides;if(null!=m.nonce&&(h.nonce=o.a.from(m.nonce).toNumber()),null!=m.gasLimit&&(h.gasLimit=o.a.from(m.gasLimit)),null!=m.gasPrice&&(h.gasPrice=o.a.from(m.gasPrice)),null!=m.maxFeePerGas&&(h.maxFeePerGas=o.a.from(m.maxFeePerGas)),null!=m.maxPriorityFeePerGas&&(h.maxPriorityFeePerGas=o.a.from(m.maxPriorityFeePerGas)),null!=m.from&&(h.from=m.from),null!=m.type&&(h.type=m.type),null!=m.accessList&&(h.accessList=Object(Ee.b)(m.accessList)),null==h.gasLimit&&null!=t.gas){let e=21e3;const r=Object(n.a)(data);for(let i=0;inull!=d[e]);return y.length&&Oe.throwError(`cannot override ${y.map(e=>JSON.stringify(e)).join(",")}`,l.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:y}),h;});}function Pe(e,t,r){const n=e.signer||e.provider;return function(...o){return Se(this,void 0,void 0,function*(){let d;if(o.length===t.inputs.length+1&&"object"==typeof o[o.length-1]){const e=Object(c.g)(o.pop());null!=e.blockTag&&(d=yield e.blockTag),delete e.blockTag,o.push(e);}null!=e.deployTransaction&&(yield e._deployed(d));const f=yield Ce(e,t,o),h=yield n.call(f,d);try{let n=e.interface.decodeFunctionResult(t,h);return r&&1===t.outputs.length&&(n=n[0]),n;}catch(t){throw t.code===l.b.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=o,t.transaction=f),t;}});};}function Fe(e,t,r){return t.constant?Pe(e,t,r):function(e,t){return function(...r){return Se(this,void 0,void 0,function*(){e.signer||Oe.throwError("sending a transaction requires a signer",l.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Ce(e,t,r),o=yield e.signer.sendTransaction(n),d=o.wait.bind(o);return o.wait=t=>d(t).then(t=>(t.events=t.logs.map(r=>{let n=Object(c.c)(r),o=null;try{o=e.interface.parseLog(r);}catch(e){}return o&&(n.args=o.args,n.decode=(data,t)=>e.interface.decodeEventLog(o.eventFragment,data,t),n.event=o.name,n.eventSignature=o.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n;}),t)),o;});};}(e,t);}function Le(filter){return!filter.address||null!=filter.topics&&0!==filter.topics.length?(filter.address||"*")+"@"+(filter.topics?filter.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):""):"*";}class Re{constructor(e,filter){Object(c.d)(this,"tag",e),Object(c.d)(this,"filter",filter),this._listeners=[];}addListener(e,t){this._listeners.push({listener:e,once:t});}removeListener(e){let t=!1;this._listeners=this._listeners.filter(r=>!(!t&&r.listener===e)||(t=!0,!1));}removeAllListeners(){this._listeners=[];}listeners(){return this._listeners.map(i=>i.listener);}listenerCount(){return this._listeners.length;}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter(t=>{const r=e.slice();return setTimeout(()=>{t.listener.apply(this,r);},0),!t.once;}),t;}prepareEvent(e){}getEmit(e){return[e];}}class Be extends Re{constructor(){super("error",null);}}class Ne extends Re{constructor(address,e,t,r){const filter={address:address};let n=e.getEventTopic(t);r?(n!==r[0]&&Oe.throwArgumentError("topic mismatch","topics",r),filter.topics=r.slice()):filter.topics=[n],super(Le(filter),filter),Object(c.d)(this,"address",address),Object(c.d)(this,"interface",e),Object(c.d)(this,"fragment",t);}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(data,e)=>this.interface.decodeEventLog(this.fragment,data,e);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics);}catch(t){e.args=null,e.decodeError=t;}}getEmit(e){const t=function(e){const t=[],r=function(path,object){if(Array.isArray(object))for(let e in object){const n=path.slice();n.push(e);try{r(n,object[e]);}catch(e){t.push({path:n,error:e});}}};return r([],e),t;}(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r;}}class xe extends Re{constructor(address,e){super("*",{address:address}),Object(c.d)(this,"address",address),Object(c.d)(this,"interface",e);}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(data,e)=>this.interface.decodeEventLog(t.eventFragment,data,e),e.args=t.args;}catch(e){}}}class je{constructor(e,t,r){Oe.checkNew(new.target,Ie),Object(c.d)(this,"interface",Object(c.e)(new.target,"getInterface")(t)),null==r?(Object(c.d)(this,"provider",null),Object(c.d)(this,"signer",null)):Ae.a.isSigner(r)?(Object(c.d)(this,"provider",r.provider||null),Object(c.d)(this,"signer",r)):we.b.isProvider(r)?(Object(c.d)(this,"provider",r),Object(c.d)(this,"signer",null)):Oe.throwArgumentError("invalid signer or provider","signerOrProvider",r),Object(c.d)(this,"callStatic",{}),Object(c.d)(this,"estimateGas",{}),Object(c.d)(this,"functions",{}),Object(c.d)(this,"populateTransaction",{}),Object(c.d)(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach(t=>{const r=this.interface.events[t];Object(c.d)(this.filters,t,(...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)})),e[r.name]||(e[r.name]=[]),e[r.name].push(t);}),Object.keys(e).forEach(t=>{const r=e[t];1===r.length?Object(c.d)(this.filters,t,this.filters[r[0]]):Oe.warn(`Duplicate definition of ${t} (${r.join(", ")})`);});}if(Object(c.d)(this,"_runningEvents",{}),Object(c.d)(this,"_wrappedEmits",{}),null==e&&Oe.throwArgumentError("invalid contract address or ENS name","addressOrName",e),Object(c.d)(this,"address",e),this.provider)Object(c.d)(this,"resolvedAddress",Me(this.provider,e));else try{Object(c.d)(this,"resolvedAddress",Promise.resolve(Object(v.a)(e)));}catch(e){Oe.throwError("provider is required to use ENS name as contract address",l.b.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"});}const n={},o={};Object.keys(this.interface.functions).forEach(e=>{const t=this.interface.functions[e];if(o[e])Oe.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{o[e]=!0;{const r=t.name;n[r]||(n[r]=[]),n[r].push(e);}null==this[e]&&Object(c.d)(this,e,Fe(this,t,!0)),null==this.functions[e]&&Object(c.d)(this.functions,e,Fe(this,t,!1)),null==this.callStatic[e]&&Object(c.d)(this.callStatic,e,Pe(this,t,!0)),null==this.populateTransaction[e]&&Object(c.d)(this.populateTransaction,e,function(e,t){return function(...r){return Ce(e,t,r);};}(this,t)),null==this.estimateGas[e]&&Object(c.d)(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return Se(this,void 0,void 0,function*(){r||Oe.throwError("estimate require a provider or signer",l.b.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const o=yield Ce(e,t,n);return yield r.estimateGas(o);});};}(this,t));}}),Object.keys(n).forEach(e=>{const t=n[e];if(t.length>1)return;const r=t[0];try{null==this[e]&&Object(c.d)(this,e,this[r]);}catch(e){}null==this.functions[e]&&Object(c.d)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&Object(c.d)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&Object(c.d)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&Object(c.d)(this.estimateGas,e,this.estimateGas[r]);});}static getContractAddress(e){return Object(v.b)(e);}static getInterface(e){return Te.isInterface(e)?e:new Te(e);}deployed(){return this._deployed();}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(code=>("0x"===code&&Oe.throwError("contract not deployed",l.b.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise;}fallback(e){this.signer||Oe.throwError("sending a transactions require a signer",l.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=Object(c.g)(e||{});return["from","to"].forEach(function(e){null!=t[e]&&Oe.throwError("cannot override "+e,l.b.errors.UNSUPPORTED_OPERATION,{operation:e});}),t.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(t));}connect(e){"string"==typeof e&&(e=new Ae.b(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Object(c.d)(t,"deployTransaction",this.deployTransaction),t;}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider);}static isIndexed(e){return ge.isIndexed(e);}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e;}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Be());if("event"===e)return this._normalizeRunningEvent(new Re("event",null));if("*"===e)return this._normalizeRunningEvent(new xe(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Ne(this.address,this.interface,t));}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Ne(this.address,this.interface,r,e.topics));}catch(e){}const filter={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Re(Le(filter),filter));}return this._normalizeRunningEvent(new xe(this.address,this.interface));}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag]);}}_wrapEvent(e,t,r){const n=Object(c.c)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e));},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n;}_addEventListener(e,t,r){if(this.provider||Oe.throwError("events require a provider or a signer with a provider",l.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t);}catch(e){n.decodeError=e.error;}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n);};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r);}}queryFilter(e,t,r){const o=this._getRunningEvent(e),filter=Object(c.g)(o.filter);return"string"==typeof t&&Object(n.l)(t,32)?(null!=r&&Oe.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),filter.blockHash=t):(filter.fromBlock=null!=t?t:0,filter.toBlock=null!=r?r:"latest"),this.provider.getLogs(filter).then(e=>e.map(e=>this._wrapEvent(o,e,null)));}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this;}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this;}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n;}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce((e,t)=>e+this._runningEvents[t].listenerCount(),0):this._getRunningEvent(e).listenerCount():0;}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach(t=>{e.push(t);});return e;}return this._getRunningEvent(e).listeners();}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t);}return this;}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this;}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this;}removeListener(e,t){return this.off(e,t);}}class Ie extends je{}class Je{constructor(e,t,r){let o=null;o="string"==typeof t?t:Object(n.j)(t)?Object(n.i)(t):t&&"string"==typeof t.object?t.object:"!","0x"!==o.substring(0,2)&&(o="0x"+o),(!Object(n.l)(o)||o.length%2)&&Oe.throwArgumentError("invalid bytecode","bytecode",t),r&&!Ae.a.isSigner(r)&&Oe.throwArgumentError("invalid signer","signer",r),Object(c.d)(this,"bytecode",o),Object(c.d)(this,"interface",Object(c.e)(new.target,"getInterface")(e)),Object(c.d)(this,"signer",r||null);}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){t=Object(c.g)(e.pop());for(const e in t)if(!_e[e])throw new Error("unknown transaction override "+e);}if(["data","from","to"].forEach(e=>{null!=t[e]&&Oe.throwError("cannot override "+e,l.b.errors.UNSUPPORTED_OPERATION,{operation:e});}),t.value){o.a.from(t.value).isZero()||this.interface.deploy.payable||Oe.throwError("non-payable constructor cannot override value",l.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value});}return Oe.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=Object(n.i)(Object(n.b)([this.bytecode,this.interface.encodeDeploy(e)])),t;}deploy(...e){return Se(this,void 0,void 0,function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),Oe.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield ke(this.signer,e,this.interface.deploy.inputs);r.push(t);const n=this.getDeployTransaction(...r),o=yield this.signer.sendTransaction(n),address=Object(c.e)(this.constructor,"getContractAddress")(o),l=Object(c.e)(this.constructor,"getContract")(address,this.interface,this.signer);return Object(c.d)(l,"deployTransaction",o),l;});}attach(address){return this.constructor.getContract(address,this.interface,this.signer);}connect(e){return new this.constructor(this.interface,this.bytecode,e);}static fromSolidity(e,t){null==e&&Oe.throwError("missing compiler output",l.b.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t);}static getInterface(e){return Ie.getInterface(e);}static getContractAddress(e){return Object(v.b)(e);}static getContract(address,e,t){return new Ie(address,e,t);}}},function(e,t,r){"use strict";r.r(t),r.d(t,"workerEvents",function(){return n;}),r.d(t,"numbers",function(){return o;});var n={INIT_WORKER:"initWorker",GET_COMMITMENT_EVENTS:"get_commitment_events",GET_UNSPENT_EVENTS:"get_unspent_events",GET_NULLIFIER_EVENT:"get_nullifier_event",GET_NULLIFIER_EVENTS_FROM_TX_HASH:"get_nullifier_events_from_tx_hash",UPDATE_NULLIFIER_EVENTS:"update_nullifier_events",GET_BATCH_EVENTS:"get_batch_events",GET_BATCH_COMMITMENTS_EVENTS:"get_batch_commitments_events",GET_EVENTS_FROM_TX_HASH:"get_events_from_tx_hash",SAVE_EVENTS:"save_events",GET_CACHED_EVENTS:"get_cached_events",GET_CACHED_COMMITMENTS_EVENTS:"get_cached_commitments_events",SAVE_LAST_SYNC_BLOCK:"save_last_sync_block"},o={ZERO:0,TWO:2,ONE:1,BYTES_31:31,BYTES_62:62,IS_SPENT_INDEX:1,OX_LENGTH:2,RECALL_DELAY:500,NULLIFIER_LENGTH:66,NONCE_BUF_LENGTH:24,COMMITMENTS_CHAIN:100,DEPLOYED_BLOCK:19097755,DECRYPT_WORKERS_COUNT:8,MIN_BLOCKS_INTERVAL_LINE:2e5,EPHEM_PUBLIC_KEY_BUF_LENGTH:56};},,function(e,t,r){var n=r(30),o=r(97),c=r(60),l=r(38),d=r(68),f=r(29),h=r(121),m=Object.getOwnPropertyDescriptor;t.f=n?m:function(e,t){if(e=l(e),t=d(t),h)try{return m(e,t);}catch(e){}if(f(e,t))return c(!o.f.call(e,t),e[t]);};},function(e,t,r){var n=r(23),o=r(18),c=r(29),l=r(59),d=r(92),f=r(95),h=r(98),m=r(99).CONFIGURABLE,y=h.get,v=h.enforce,T=String(String).split("String");(e.exports=function(e,t,r,f){var h,y=!!f&&!!f.unsafe,w=!!f&&!!f.enumerable,A=!!f&&!!f.noTargetGet,E=f&&void 0!==f.name?f.name:t;o(r)&&("Symbol("===String(E).slice(0,7)&&(E="["+String(E).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!c(r,"name")||m&&r.name!==E)&&l(r,"name",E),(h=v(r)).source||(h.source=T.join("string"==typeof E?E:""))),e!==n?(y?!A&&e[t]&&(w=!0):delete e[t],w?e[t]=r:l(e,t,r)):w?e[t]=r:d(t,r);})(Function.prototype,"toString",function(){return o(this)&&y(this).source||f(this);});},function(e,t,r){var n,o=r(36),c=r(173),l=r(100),d=r(71),html=r(174),f=r(86),h=r(70),m=h("IE_PROTO"),y=function(){},v=function(content){return"