@eluvio/elv-client-js 4.0.146 → 4.0.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ElvClient-min.js +14 -15
- package/dist/ElvClient-node-min.js +13 -14
- package/dist/ElvFrameClient-min.js +10 -10
- package/dist/ElvPermissionsClient-min.js +9 -9
- package/dist/ElvWalletClient-min.js +14 -15
- package/dist/ElvWalletClient-node-min.js +13 -14
- package/dist/src/AuthorizationClient.js +12 -9
- package/dist/src/ContentObjectAudit.js +3 -3
- package/dist/src/ContentObjectVerification.js +3 -3
- package/dist/src/Crypto.js +2 -2
- package/dist/src/ElvClient.js +30 -49
- package/dist/src/ElvWallet.js +5 -7
- package/dist/src/EthClient.js +9 -8
- package/dist/src/FrameClient.js +9 -8
- package/dist/src/HttpClient.js +2 -1
- package/dist/src/Id.js +2 -1
- package/dist/src/PermissionsClient.js +19 -31
- package/dist/src/RemoteSigner.js +8 -6
- package/dist/src/UserProfileClient.js +20 -35
- package/dist/src/Utils.js +3 -2
- package/dist/src/Validation.js +2 -10
- package/dist/src/client/ABRPublishing.js +253 -309
- package/dist/src/client/AccessGroups.js +2 -2
- package/dist/src/client/ContentAccess.js +3 -2
- package/dist/src/client/ContentManagement.js +3 -3
- package/dist/src/client/Contracts.js +12 -11
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/LiveConf.js +5 -3
- package/dist/src/client/LiveStream.js +2 -0
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/client/Shares.js +2 -2
- package/dist/src/walletClient/ClientMethods.js +2 -2
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +2 -2
- package/dist/src/walletClient/index.js +14 -17
- package/package.json +1 -1
- package/src/ElvClient.js +1 -0
- package/src/FrameClient.js +12 -0
- package/src/client/ContentAccess.js +44 -71
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=37)}([function(t,e,r){"use strict";r.d(e,"k",(function(){return a})),r.d(e,"j",(function(){return s})),r.d(e,"a",(function(){return c})),r.d(e,"b",(function(){return l})),r.d(e,"o",(function(){return f})),r.d(e,"p",(function(){return h})),r.d(e,"l",(function(){return p})),r.d(e,"i",(function(){return d})),r.d(e,"d",(function(){return m})),r.d(e,"e",(function(){return v})),r.d(e,"c",(function(){return y})),r.d(e,"g",(function(){return g})),r.d(e,"f",(function(){return b})),r.d(e,"h",(function(){return w})),r.d(e,"n",(function(){return _})),r.d(e,"m",(function(){return k}));var n=new(r(1).b)("bytes/5.7.0");function o(t){return!!t.toHexString}function i(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return i(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){return p(t)&&!(t.length%2)||s(t)}function u(t){return"number"==typeof t&&t==t&&t%1==0}function s(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!u(t.length)||t.length<0)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(!u(r)||r<0||r>=256)return!1}return!0}function c(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid arrayify value");for(var r=[];t;)r.unshift(255&t),t=parseInt(String(t/256));return 0===r.length&&r.push(0),i(new Uint8Array(r))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),o(t)&&(t=t.toHexString()),p(t)){var a=t.substring(2);a.length%2&&("left"===e.hexPad?a="0"+a:"right"===e.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",t));for(var u=[],c=0;c<a.length;c+=2)u.push(parseInt(a.substring(c,c+2),16));return i(new Uint8Array(u))}return s(t)?i(new Uint8Array(t)):n.throwArgumentError("invalid arrayify value","value",t)}function l(t){var e=t.map((function(t){return c(t)})),r=e.reduce((function(t,e){return t+e.length}),0),n=new Uint8Array(r);return e.reduce((function(t,e){return n.set(e,t),t+e.length}),0),i(n)}function f(t){var e=c(t);if(0===e.length)return e;for(var r=0;r<e.length&&0===e[r];)r++;return r&&(e=e.slice(r)),e}function h(t,e){(t=c(t)).length>e&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(e);return r.set(t,e-t.length),i(r)}function p(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function d(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid hexlify value");for(var r="";t;)r="0123456789abcdef"[15&t]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),o(t))return t.toHexString();if(p(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":n.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(s(t)){for(var i="0x",a=0;a<t.length;a++){var u=t[a];i+="0123456789abcdef"[(240&u)>>4]+"0123456789abcdef"[15&u]}return i}return n.throwArgumentError("invalid hexlify value","value",t)}function m(t){if("string"!=typeof t)t=d(t);else if(!p(t)||t.length%2)return null;return(t.length-2)/2}function v(t,e,r){return"string"!=typeof t?t=d(t):(!p(t)||t.length%2)&&n.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function y(t){var e="0x";return t.forEach((function(t){e+=d(t).substring(2)})),e}function g(t){var e=b(d(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function b(t){"string"!=typeof t&&(t=d(t)),p(t)||n.throwArgumentError("invalid hex string","value",t),t=t.substring(2);for(var e=0;e<t.length&&"0"===t[e];)e++;return"0x"+t.substring(e)}function w(t,e){for("string"!=typeof t?t=d(t):p(t)||n.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&n.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function _(t){var e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(t)){var r=c(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=d(r.slice(0,32)),e.s=d(r.slice(32,64))):65===r.length?(e.r=d(r.slice(0,32)),e.s=d(r.slice(32,64)),e.v=r[64]):n.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:n.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=d(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){var o=h(c(e._vs),32);e._vs=d(o);var i=o[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),o[0]&=127;var u=d(o);null==e.s?e.s=u:e.s!==u&&n.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?n.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{var s=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==s&&n.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&p(e.r)?e.r=w(e.r,32):n.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&p(e.s)?e.s=w(e.s,32):n.throwArgumentError("signature missing or invalid s","signature",t);var l=c(e.s);l[0]>=128&&n.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(l[0]|=128);var f=d(l);e._vs&&(p(e._vs)||n.throwArgumentError("signature invalid _vs","signature",t),e._vs=w(e._vs,32)),null==e._vs?e._vs=f:e._vs!==f&&n.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function k(t){return d(l([(t=_(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";r.d(e,"a",(function(){return h})),r.d(e,"b",(function(){return m}));function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:e+""}var a=!1,u=!1,s={debug:1,default:2,info:2,warning:3,error:4,off:5},c=s.default,l=null;var f,h,p=function(){try{var t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(f||(f={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(h||(h={}));var d="0123456789abcdef",m=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}return e=t,n=[{key:"globalLogger",value:function(){return l||(l=new t("logger/5.7.0")),l}},{key:"setCensorship",value:function(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),a){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!e,a=!!r}},{key:"setLogLevel",value:function(e){var r=s[e.toLowerCase()];null!=r?c=r:t.globalLogger().warn("invalid log level - "+e)}},{key:"from",value:function(e){return new t(e)}}],(r=[{key:"_log",value:function(t,e){var r=t.toLowerCase();null==s[r]&&this.throwArgumentError("invalid log level name","logLevel",t),c>s[r]||console.log.apply(console,e)}},{key:"debug",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this._log(t.levels.DEBUG,r)}},{key:"info",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this._log(t.levels.INFO,r)}},{key:"warn",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this._log(t.levels.WARNING,r)}},{key:"makeError",value:function(e,r,n){if(u)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach((function(t){var e=n[t];try{if(e instanceof Uint8Array){for(var r="",i=0;i<e.length;i++)r+=d[e[i]>>4],r+=d[15&e[i]];o.push(t+"=Uint8Array(0x"+r+")")}else o.push(t+"="+JSON.stringify(e))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}})),o.push("code=".concat(r)),o.push("version=".concat(this.version));var i=e,a="";switch(r){case h.NUMERIC_FAULT:a="NUMERIC_FAULT";var s=e;switch(s){case"overflow":case"underflow":case"division-by-zero":a+="-"+s;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result"}break;case h.CALL_EXCEPTION:case h.INSUFFICIENT_FUNDS:case h.MISSING_NEW:case h.NONCE_EXPIRED:case h.REPLACEMENT_UNDERPRICED:case h.TRANSACTION_REPLACED:case h.UNPREDICTABLE_GAS_LIMIT:a=r}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),o.length&&(e+=" ("+o.join(", ")+")");var c=new Error(e);return c.reason=i,c.code=r,Object.keys(n).forEach((function(t){c[t]=n[t]})),c}},{key:"throwError",value:function(t,e,r){throw this.makeError(t,e,r)}},{key:"throwArgumentError",value:function(e,r,n){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(t,e,r,n){t||this.throwError(e,r,n)}},{key:"assertArgument",value:function(t,e,r,n){t||this.throwArgumentError(e,r,n)}},{key:"checkNormalize",value:function(e){null==e&&(e="platform missing String.prototype.normalize"),p&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:p})}},{key:"checkSafeUint53",value:function(e,r){"number"==typeof e&&(null==r&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}},{key:"checkArgumentCount",value:function(e,r,n){n=n?": "+n:"",e<r&&this.throwError("missing argument"+n,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}},{key:"checkNew",value:function(e,r){e!==Object&&null!=e||this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();m.errors=h,m.levels=f},function(t,e,r){(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,n){"use strict";function o(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var u;"object"===e(t)?t.exports=a:n.BN=a,a.BN=a,a.wordSize=26;try{u="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(68).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void o(!1,"Invalid character in "+t)}function c(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function l(t,e,r,n){for(var i=0,a=0,u=Math.min(t.length,r),s=e;s<u;s++){var c=t.charCodeAt(s)-48;i*=n,a=c>=49?c-49+10:c>=17?c-17+10:c,o(c>=0&&a<n,"Invalid character"),i+=a}return i}function f(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(a.isBN=function(t){return t instanceof a||null!==t&&"object"===e(t)&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===e(t))return this._initArray(t,r,n);"hex"===r&&(r=16),o(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===r?this._parseHex(t,i,n):(this._parseBase(t,r,i),"le"===n&&this._initArray(this.toArray(),r,n)))},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(o("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a,u=0;if("be"===r)for(n=t.length-1,i=0;n>=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[i]|=a<<u&67108863,this.words[i+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);else if("le"===r)for(n=0,i=0;n<t.length;n+=3)a=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[i]|=a<<u&67108863,this.words[i+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);return this._strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,a=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)o=c(t,e,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)o=c(t,e,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=e)n++;n--,o=o/e|0;for(var i=t.length-r,a=i%n,u=Math.min(i,i-a)+r,s=0,c=r;c<u;c+=n)s=l(t,c,c+n,e),this.imuln(o),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==a){var f=1;for(s=l(t,c,t.length,e),c=0;c<a;c++)f*=e;this.imuln(f),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this._strip()},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype._move=function(t){f(t,this)},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){a.prototype.inspect=h}else a.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[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];a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,i=0,a=0;a<this.length;a++){var u=this.words[a],s=(16777215&(u<<n|i)).toString(16);i=u>>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),r=0!==i||a!==this.length-1?p[6-s.length]+s+r:s+r}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=m[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var h=f.modrn(l).toString(t);r=(f=f.idivn(l)).isZero()?h+r:p[c-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}o(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16,2)},u&&(a.prototype.toBuffer=function(t,e){return this.toArrayLike(u,t,e)}),a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function v(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var o=0|t.words[0],i=0|e.words[0],a=o*i,u=67108863&a,s=a/67108864|0;r.words[0]=u;for(var c=1;c<n;c++){for(var l=s>>>26,f=67108863&s,h=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=h;p++){var d=c-p|0;l+=(a=(o=0|t.words[d])*(i=0|e.words[p])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,s=0|l}return 0!==s?r.words[c]=0|s:r.length--,r._strip()}a.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);o(n<=i,"byte array longer than desired length"),o(i>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,i);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},a.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|n;t[r++]=255&a,r<t.length&&(t[r++]=a>>8&255),r<t.length&&(t[r++]=a>>16&255),6===i?(r<t.length&&(t[r++]=a>>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},a.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|n;t[r--]=255&a,r>=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===i?(r>=0&&(t[r--]=a>>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},a.prototype.ior=function(t){return o(0==(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},a.prototype.iand=function(t){return o(0==(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},a.prototype.ixor=function(t){return o(0==(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){o("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){o("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},a.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var o=0,i=0;i<n.length;i++)e=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&e,o=e>>>26;for(;0!==o&&i<r.length;i++)e=(0|r.words[i])+o,this.words[i]=67108863&e,o=e>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,o=this.cmp(t);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)i=(e=(0|r.words[a])-(0|n.words[a])+i)>>26,this.words[a]=67108863&e;for(;0!==i&&a<r.length;a++)i=(e=(0|r.words[a])+i)>>26,this.words[a]=67108863&e;if(0===i&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,r){var n,o,i,a=t.words,u=e.words,s=r.words,c=0,l=0|a[0],f=8191&l,h=l>>>13,p=0|a[1],d=8191&p,m=p>>>13,v=0|a[2],y=8191&v,g=v>>>13,b=0|a[3],w=8191&b,_=b>>>13,k=0|a[4],E=8191&k,x=k>>>13,A=0|a[5],O=8191&A,S=A>>>13,P=0|a[6],j=8191&P,T=P>>>13,N=0|a[7],I=8191&N,R=N>>>13,L=0|a[8],C=8191&L,M=L>>>13,B=0|a[9],F=8191&B,D=B>>>13,U=0|u[0],z=8191&U,G=U>>>13,H=0|u[1],q=8191&H,K=H>>>13,W=0|u[2],Q=8191&W,V=W>>>13,J=0|u[3],Y=8191&J,Z=J>>>13,X=0|u[4],$=8191&X,tt=X>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,ot=0|u[6],it=8191&ot,at=ot>>>13,ut=0|u[7],st=8191&ut,ct=ut>>>13,lt=0|u[8],ft=8191<,ht=lt>>>13,pt=0|u[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(c+(n=Math.imul(f,z))|0)+((8191&(o=(o=Math.imul(f,G))+Math.imul(h,z)|0))<<13)|0;c=((i=Math.imul(h,G))+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(d,z),o=(o=Math.imul(d,G))+Math.imul(m,z)|0,i=Math.imul(m,G);var yt=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(o=(o=o+Math.imul(f,K)|0)+Math.imul(h,q)|0))<<13)|0;c=((i=i+Math.imul(h,K)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,z),o=(o=Math.imul(y,G))+Math.imul(g,z)|0,i=Math.imul(g,G),n=n+Math.imul(d,q)|0,o=(o=o+Math.imul(d,K)|0)+Math.imul(m,q)|0,i=i+Math.imul(m,K)|0;var gt=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(o=(o=o+Math.imul(f,V)|0)+Math.imul(h,Q)|0))<<13)|0;c=((i=i+Math.imul(h,V)|0)+(o>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(w,z),o=(o=Math.imul(w,G))+Math.imul(_,z)|0,i=Math.imul(_,G),n=n+Math.imul(y,q)|0,o=(o=o+Math.imul(y,K)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,K)|0,n=n+Math.imul(d,Q)|0,o=(o=o+Math.imul(d,V)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,V)|0;var bt=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(o=(o=o+Math.imul(f,Z)|0)+Math.imul(h,Y)|0))<<13)|0;c=((i=i+Math.imul(h,Z)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(E,z),o=(o=Math.imul(E,G))+Math.imul(x,z)|0,i=Math.imul(x,G),n=n+Math.imul(w,q)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(y,Q)|0,o=(o=o+Math.imul(y,V)|0)+Math.imul(g,Q)|0,i=i+Math.imul(g,V)|0,n=n+Math.imul(d,Y)|0,o=(o=o+Math.imul(d,Z)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,Z)|0;var wt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(o=(o=o+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((i=i+Math.imul(h,tt)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(O,z),o=(o=Math.imul(O,G))+Math.imul(S,z)|0,i=Math.imul(S,G),n=n+Math.imul(E,q)|0,o=(o=o+Math.imul(E,K)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,K)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,V)|0,n=n+Math.imul(y,Y)|0,o=(o=o+Math.imul(y,Z)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,Z)|0,n=n+Math.imul(d,$)|0,o=(o=o+Math.imul(d,tt)|0)+Math.imul(m,$)|0,i=i+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(o=(o=o+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((i=i+Math.imul(h,nt)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,z),o=(o=Math.imul(j,G))+Math.imul(T,z)|0,i=Math.imul(T,G),n=n+Math.imul(O,q)|0,o=(o=o+Math.imul(O,K)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(E,Q)|0,o=(o=o+Math.imul(E,V)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,V)|0,n=n+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,i=i+Math.imul(_,Z)|0,n=n+Math.imul(y,$)|0,o=(o=o+Math.imul(y,tt)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0,n=n+Math.imul(d,rt)|0,o=(o=o+Math.imul(d,nt)|0)+Math.imul(m,rt)|0,i=i+Math.imul(m,nt)|0;var kt=(c+(n=n+Math.imul(f,it)|0)|0)+((8191&(o=(o=o+Math.imul(f,at)|0)+Math.imul(h,it)|0))<<13)|0;c=((i=i+Math.imul(h,at)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(I,z),o=(o=Math.imul(I,G))+Math.imul(R,z)|0,i=Math.imul(R,G),n=n+Math.imul(j,q)|0,o=(o=o+Math.imul(j,K)|0)+Math.imul(T,q)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(O,Q)|0,o=(o=o+Math.imul(O,V)|0)+Math.imul(S,Q)|0,i=i+Math.imul(S,V)|0,n=n+Math.imul(E,Y)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,Z)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,tt)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,o=(o=o+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0,n=n+Math.imul(d,it)|0,o=(o=o+Math.imul(d,at)|0)+Math.imul(m,it)|0,i=i+Math.imul(m,at)|0;var Et=(c+(n=n+Math.imul(f,st)|0)|0)+((8191&(o=(o=o+Math.imul(f,ct)|0)+Math.imul(h,st)|0))<<13)|0;c=((i=i+Math.imul(h,ct)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,z),o=(o=Math.imul(C,G))+Math.imul(M,z)|0,i=Math.imul(M,G),n=n+Math.imul(I,q)|0,o=(o=o+Math.imul(I,K)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(j,Q)|0,o=(o=o+Math.imul(j,V)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,V)|0,n=n+Math.imul(O,Y)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,Z)|0,n=n+Math.imul(E,$)|0,o=(o=o+Math.imul(E,tt)|0)+Math.imul(x,$)|0,i=i+Math.imul(x,tt)|0,n=n+Math.imul(w,rt)|0,o=(o=o+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,n=n+Math.imul(y,it)|0,o=(o=o+Math.imul(y,at)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,at)|0,n=n+Math.imul(d,st)|0,o=(o=o+Math.imul(d,ct)|0)+Math.imul(m,st)|0,i=i+Math.imul(m,ct)|0;var xt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(o=(o=o+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((i=i+Math.imul(h,ht)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(F,z),o=(o=Math.imul(F,G))+Math.imul(D,z)|0,i=Math.imul(D,G),n=n+Math.imul(C,q)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,K)|0,n=n+Math.imul(I,Q)|0,o=(o=o+Math.imul(I,V)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,V)|0,n=n+Math.imul(j,Y)|0,o=(o=o+Math.imul(j,Z)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,Z)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,tt)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,tt)|0,n=n+Math.imul(E,rt)|0,o=(o=o+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,i=i+Math.imul(x,nt)|0,n=n+Math.imul(w,it)|0,o=(o=o+Math.imul(w,at)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,at)|0,n=n+Math.imul(y,st)|0,o=(o=o+Math.imul(y,ct)|0)+Math.imul(g,st)|0,i=i+Math.imul(g,ct)|0,n=n+Math.imul(d,ft)|0,o=(o=o+Math.imul(d,ht)|0)+Math.imul(m,ft)|0,i=i+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,dt)|0)|0)+((8191&(o=(o=o+Math.imul(f,mt)|0)+Math.imul(h,dt)|0))<<13)|0;c=((i=i+Math.imul(h,mt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,q),o=(o=Math.imul(F,K))+Math.imul(D,q)|0,i=Math.imul(D,K),n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,V)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,V)|0,n=n+Math.imul(I,Y)|0,o=(o=o+Math.imul(I,Z)|0)+Math.imul(R,Y)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(j,$)|0,o=(o=o+Math.imul(j,tt)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,tt)|0,n=n+Math.imul(O,rt)|0,o=(o=o+Math.imul(O,nt)|0)+Math.imul(S,rt)|0,i=i+Math.imul(S,nt)|0,n=n+Math.imul(E,it)|0,o=(o=o+Math.imul(E,at)|0)+Math.imul(x,it)|0,i=i+Math.imul(x,at)|0,n=n+Math.imul(w,st)|0,o=(o=o+Math.imul(w,ct)|0)+Math.imul(_,st)|0,i=i+Math.imul(_,ct)|0,n=n+Math.imul(y,ft)|0,o=(o=o+Math.imul(y,ht)|0)+Math.imul(g,ft)|0,i=i+Math.imul(g,ht)|0;var Ot=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(o=(o=o+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;c=((i=i+Math.imul(m,mt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,Q),o=(o=Math.imul(F,V))+Math.imul(D,Q)|0,i=Math.imul(D,V),n=n+Math.imul(C,Y)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(M,Y)|0,i=i+Math.imul(M,Z)|0,n=n+Math.imul(I,$)|0,o=(o=o+Math.imul(I,tt)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,tt)|0,n=n+Math.imul(j,rt)|0,o=(o=o+Math.imul(j,nt)|0)+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,n=n+Math.imul(O,it)|0,o=(o=o+Math.imul(O,at)|0)+Math.imul(S,it)|0,i=i+Math.imul(S,at)|0,n=n+Math.imul(E,st)|0,o=(o=o+Math.imul(E,ct)|0)+Math.imul(x,st)|0,i=i+Math.imul(x,ct)|0,n=n+Math.imul(w,ft)|0,o=(o=o+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,i=i+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(y,dt)|0)|0)+((8191&(o=(o=o+Math.imul(y,mt)|0)+Math.imul(g,dt)|0))<<13)|0;c=((i=i+Math.imul(g,mt)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,Y),o=(o=Math.imul(F,Z))+Math.imul(D,Y)|0,i=Math.imul(D,Z),n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,tt)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,tt)|0,n=n+Math.imul(I,rt)|0,o=(o=o+Math.imul(I,nt)|0)+Math.imul(R,rt)|0,i=i+Math.imul(R,nt)|0,n=n+Math.imul(j,it)|0,o=(o=o+Math.imul(j,at)|0)+Math.imul(T,it)|0,i=i+Math.imul(T,at)|0,n=n+Math.imul(O,st)|0,o=(o=o+Math.imul(O,ct)|0)+Math.imul(S,st)|0,i=i+Math.imul(S,ct)|0,n=n+Math.imul(E,ft)|0,o=(o=o+Math.imul(E,ht)|0)+Math.imul(x,ft)|0,i=i+Math.imul(x,ht)|0;var Pt=(c+(n=n+Math.imul(w,dt)|0)|0)+((8191&(o=(o=o+Math.imul(w,mt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((i=i+Math.imul(_,mt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(F,$),o=(o=Math.imul(F,tt))+Math.imul(D,$)|0,i=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,o=(o=o+Math.imul(C,nt)|0)+Math.imul(M,rt)|0,i=i+Math.imul(M,nt)|0,n=n+Math.imul(I,it)|0,o=(o=o+Math.imul(I,at)|0)+Math.imul(R,it)|0,i=i+Math.imul(R,at)|0,n=n+Math.imul(j,st)|0,o=(o=o+Math.imul(j,ct)|0)+Math.imul(T,st)|0,i=i+Math.imul(T,ct)|0,n=n+Math.imul(O,ft)|0,o=(o=o+Math.imul(O,ht)|0)+Math.imul(S,ft)|0,i=i+Math.imul(S,ht)|0;var jt=(c+(n=n+Math.imul(E,dt)|0)|0)+((8191&(o=(o=o+Math.imul(E,mt)|0)+Math.imul(x,dt)|0))<<13)|0;c=((i=i+Math.imul(x,mt)|0)+(o>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(F,rt),o=(o=Math.imul(F,nt))+Math.imul(D,rt)|0,i=Math.imul(D,nt),n=n+Math.imul(C,it)|0,o=(o=o+Math.imul(C,at)|0)+Math.imul(M,it)|0,i=i+Math.imul(M,at)|0,n=n+Math.imul(I,st)|0,o=(o=o+Math.imul(I,ct)|0)+Math.imul(R,st)|0,i=i+Math.imul(R,ct)|0,n=n+Math.imul(j,ft)|0,o=(o=o+Math.imul(j,ht)|0)+Math.imul(T,ft)|0,i=i+Math.imul(T,ht)|0;var Tt=(c+(n=n+Math.imul(O,dt)|0)|0)+((8191&(o=(o=o+Math.imul(O,mt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((i=i+Math.imul(S,mt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,it),o=(o=Math.imul(F,at))+Math.imul(D,it)|0,i=Math.imul(D,at),n=n+Math.imul(C,st)|0,o=(o=o+Math.imul(C,ct)|0)+Math.imul(M,st)|0,i=i+Math.imul(M,ct)|0,n=n+Math.imul(I,ft)|0,o=(o=o+Math.imul(I,ht)|0)+Math.imul(R,ft)|0,i=i+Math.imul(R,ht)|0;var Nt=(c+(n=n+Math.imul(j,dt)|0)|0)+((8191&(o=(o=o+Math.imul(j,mt)|0)+Math.imul(T,dt)|0))<<13)|0;c=((i=i+Math.imul(T,mt)|0)+(o>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(F,st),o=(o=Math.imul(F,ct))+Math.imul(D,st)|0,i=Math.imul(D,ct),n=n+Math.imul(C,ft)|0,o=(o=o+Math.imul(C,ht)|0)+Math.imul(M,ft)|0,i=i+Math.imul(M,ht)|0;var It=(c+(n=n+Math.imul(I,dt)|0)|0)+((8191&(o=(o=o+Math.imul(I,mt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((i=i+Math.imul(R,mt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(F,ft),o=(o=Math.imul(F,ht))+Math.imul(D,ft)|0,i=Math.imul(D,ht);var Rt=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(o=(o=o+Math.imul(C,mt)|0)+Math.imul(M,dt)|0))<<13)|0;c=((i=i+Math.imul(M,mt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Lt=(c+(n=Math.imul(F,dt))|0)+((8191&(o=(o=Math.imul(F,mt))+Math.imul(D,dt)|0))<<13)|0;return c=((i=Math.imul(D,mt))+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,s[0]=vt,s[1]=yt,s[2]=gt,s[3]=bt,s[4]=wt,s[5]=_t,s[6]=kt,s[7]=Et,s[8]=xt,s[9]=At,s[10]=Ot,s[11]=St,s[12]=Pt,s[13]=jt,s[14]=Tt,s[15]=Nt,s[16]=It,s[17]=Rt,s[18]=Lt,0!==c&&(s[19]=c,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var a=o;o=0;for(var u=67108863&n,s=Math.min(i,e.length-1),c=Math.max(0,i-t.length+1);c<=s;c++){var l=i-c,f=(0|t.words[l])*(0|e.words[c]),h=67108863&f;u=67108863&(h=h+u|0),o+=(a=(a=a+(f/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}r.words[i]=u,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r._strip()}function b(t,e,r){return g(t,e,r)}function w(t,e){this.x=t,this.y=e}Math.imul||(y=v),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?v(this,t,e):r<1024?g(this,t,e):b(this,t,e)},w.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},w.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,o=0;o<e;o++)n|=(1&t)<<e-o-1,t>>=1;return n},w.prototype.permute=function(t,e,r,n,o,i){for(var a=0;a<i;a++)n[a]=e[t[a]],o[a]=r[t[a]]},w.prototype.transform=function(t,e,r,n,o,i){this.permute(i,t,e,r,n,o);for(var a=1;a<o;a<<=1)for(var u=a<<1,s=Math.cos(2*Math.PI/u),c=Math.sin(2*Math.PI/u),l=0;l<o;l+=u)for(var f=s,h=c,p=0;p<a;p++){var d=r[l+p],m=n[l+p],v=r[l+p+a],y=n[l+p+a],g=f*v-h*y;y=f*y+h*v,v=g,r[l+p]=d+v,n[l+p]=m+y,r[l+p+a]=d-v,n[l+p+a]=m-y,p!==u&&(g=s*f-c*h,h=s*h+c*f,f=g)}},w.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,o=0;for(r=r/2|0;r;r>>>=1)o++;return 1<<o+1+n},w.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var o=t[n];t[n]=t[r-n-1],t[r-n-1]=o,o=e[n],e[n]=-e[r-n-1],e[r-n-1]=-o}},w.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var o=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&o,r=o<67108864?0:o/67108864|0}return t},w.prototype.convert13b=function(t,e,r,n){for(var i=0,a=0;a<e;a++)i+=0|t[a],r[2*a]=8191&i,i>>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*e;a<n;++a)r[a]=0;o(0===i),o(0==(-8192&i))},w.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},w.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),o=this.makeRBT(n),i=this.stub(n),a=new Array(n),u=new Array(n),s=new Array(n),c=new Array(n),l=new Array(n),f=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,a,n),this.convert13b(e.words,e.length,c,n),this.transform(a,i,u,s,n,o),this.transform(c,i,l,f,n,o);for(var p=0;p<n;p++){var d=u[p]*l[p]-s[p]*f[p];s[p]=u[p]*f[p]+s[p]*l[p],u[p]=d}return this.conjugate(u,s,n),this.transform(u,s,h,i,n,o),this.conjugate(h,i,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),b(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){var e=t<0;e&&(t=-t),o("number"==typeof t),o(t<67108864);for(var r=0,n=0;n<this.length;n++){var i=(0|this.words[n])*t,a=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,o=r%26;e[r]=t.words[n]>>>o&1}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var o=r.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(r=r.mul(o));return r},a.prototype.iushln=function(t){o("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var u=this.words[e]&i,s=(0|this.words[e])-u<<r;this.words[e]=s|a,a=u>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},a.prototype.ishln=function(t){return o(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){var n;o("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var i=t%26,a=Math.min((t-i)/26,this.length),u=67108863^67108863>>>i<<i,s=r;if(n-=a,n=Math.max(0,n),s){for(var c=0;c<a;c++)s.words[c]=this.words[c];s.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=n);c--){var f=0|this.words[c];this.words[c]=l<<26-i|f>>>i,l=f&u}return s&&0!==l&&(s.words[s.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(t,e,r){return o(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){o("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},a.prototype.imaskn=function(t){o("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(o(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this._strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return o("number"==typeof t),o(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(o("number"==typeof t),o(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var n,i,a=t.length+r;this._expand(a);var u=0;for(n=0;n<t.length;n++){i=(0|this.words[n+r])+u;var s=(0|t.words[n])*e;u=((i-=67108863&s)>>26)-(s/67108864|0),this.words[n+r]=67108863&i}for(;n<this.length-r;n++)u=(i=(0|this.words[n+r])+u)>>26,this.words[n+r]=67108863&i;if(0===u)return this._strip();for(o(-1===u),u=0,n=0;n<this.length;n++)u=(i=-(0|this.words[n])+u)>>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,i=0|o.words[o.length-1];0!==(r=26-this._countBits(i))&&(o=o.ushln(r),n.iushln(r),i=0|o.words[o.length-1]);var u,s=n.length-o.length;if("mod"!==e){(u=new a(null)).length=s+1,u.words=new Array(u.length);for(var c=0;c<u.length;c++)u.words[c]=0}var l=n.clone()._ishlnsubmul(o,1,s);0===l.negative&&(n=l,u&&(u.words[s]=1));for(var f=s-1;f>=0;f--){var h=67108864*(0|n.words[o.length+f])+(0|n.words[o.length+f-1]);for(h=Math.min(h/i|0,67108863),n._ishlnsubmul(o,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(o,1,f),n.isZero()||(n.negative^=1);u&&(u.words[f]=h)}return u&&u._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},a.prototype.divmod=function(t,e,r){return o(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(n=u.div.neg()),"div"!==e&&(i=u.mod.neg(),r&&0!==i.negative&&i.iadd(t)),{div:n,mod:i}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(n=u.div.neg()),{div:n,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(i=u.mod.neg(),r&&0!==i.negative&&i.isub(t)),{div:u.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,i,u},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),o=t.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modrn=function(t){var e=t<0;e&&(t=-t),o(t<=67108863);for(var r=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%t;return e?-n:n},a.prototype.modn=function(t){return this.modrn(t)},a.prototype.idivn=function(t){var e=t<0;e&&(t=-t),o(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/t|0,r=i%t}return this._strip(),e?this.ineg():this},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){o(0===t.negative),o(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new a(1),i=new a(0),u=new a(0),s=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(l),i.isub(f)),n.iushrn(1),i.iushrn(1);for(var d=0,m=1;0==(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(l),s.isub(f)),u.iushrn(1),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(u),i.isub(s)):(r.isub(e),u.isub(n),s.isub(i))}return{a:u,b:s,gcd:r.iushln(c)}},a.prototype._invmp=function(t){o(0===t.negative),o(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,i=new a(1),u=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u)):(r.isub(e),u.isub(i))}return(n=0===e.cmpn(1)?i:u).cmpn(0)<0&&n.iadd(t),n},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=e.cmp(r);if(o<0){var i=e;e=r,r=i}else if(0===o||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){o("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var i=n,a=r;0!==i&&a<this.length;a++){var u=0|this.words[a];i=(u+=i)>>>26,u&=67108863,this.words[a]=u}return 0!==i&&(this.words[a]=i,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|t.words[r];if(n!==o){n<o?e=-1:n>o&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new S(t)},a.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var _={k256:null,p224:null,p192:null,p25519:null};function k(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else o(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function P(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}k.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},k.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},k.prototype.split=function(t,e){t.iushrn(this.n,0,e)},k.prototype.imulK=function(t){return t.imul(this.k)},i(E,k),E.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=4194303&o,n=10;n<t.length;n++){var i=0|t.words[n];t.words[n-10]=(4194303&i)<<4|o>>>22,o=i}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},E.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(x,k),i(A,k),i(O,k),O.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,o=67108863&n;n>>>=26,t.words[r]=o,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(_[t])return _[t];var e;if("k256"===t)e=new E;else if("p224"===t)e=new x;else if("p192"===t)e=new A;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new O}return _[t]=e,e},S.prototype._verify1=function(t){o(0===t.negative,"red works only with positives"),o(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){o(0==(t.negative|e.negative),"red works only with positives"),o(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(o(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);o(!n.isZero());var u=new a(1).toRed(this),s=u.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(s);)l.redIAdd(s);for(var f=this.pow(l,n),h=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=i;0!==p.cmp(u);){for(var m=p,v=0;0!==m.cmp(u);v++)m=m.redSqr();o(v<d);var y=this.pow(f,new a(1).iushln(d-v-1));h=h.redMul(y),f=y.redSqr(),p=p.redMul(f),d=v}return h},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new a(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var o=r[0],i=0,u=0,s=e.bitLength()%26;for(0===s&&(s=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=s-1;l>=0;l--){var f=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==f||0!==i?(i<<=1,i|=f,(4===++u||0===n&&0===l)&&(o=this.mul(o,r[i]),u=0,i=0)):u=0}s=26}return o},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new P(t)},i(P,S),P.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},P.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},P.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},P.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},P.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(9)(t))},,function(t,e,r){var n=e;n.utils=r(7),n.common=r(13),n.sha=r(70),n.ripemd=r(74),n.hmac=r(75),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(t,e,r){"use strict";!function(e){function r(t){return parseInt(t)===t}function n(t){if(!r(t.length))return!1;for(var e=0;e<t.length;e++)if(!r(t[e])||t[e]<0||t[e]>255)return!1;return!0}function o(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!n(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&n(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function i(t){return new Uint8Array(t)}function a(t,e,r,n,o){null==n&&null==o||(t=t.slice?t.slice(n,o):Array.prototype.slice.call(t,n,o)),e.set(t,r)}var u,s={toBytes:function(t){var e=[],r=0;for(t=encodeURI(t);r<t.length;){var n=t.charCodeAt(r++);37===n?(e.push(parseInt(t.substr(r,2),16)),r+=2):e.push(n)}return o(e)},fromBytes:function(t){for(var e=[],r=0;r<t.length;){var n=t[r];n<128?(e.push(String.fromCharCode(n)),r++):n>191&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},c=(u="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},fromBytes:function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(u[(240&n)>>4]+u[15&n])}return e.join("")}}),l={16:10,24:12,32:14},f=[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],h=[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],p=[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],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[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],y=[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],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[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],k=[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],E=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],x=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],A=[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 O(t){for(var e=[],r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}var S=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:o(e,!0)}),this._prepare()};S.prototype._prepare=function(){var t=l[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(t+1),o=this.key.length/4,i=O(this.key);for(e=0;e<o;e++)r=e>>2,this._Ke[r][e%4]=i[e],this._Kd[t-r][e%4]=i[e];for(var a,u=0,s=o;s<n;){if(a=i[o-1],i[0]^=h[a>>16&255]<<24^h[a>>8&255]<<16^h[255&a]<<8^h[a>>24&255]^f[u]<<24,u+=1,8!=o)for(e=1;e<o;e++)i[e]^=i[e-1];else{for(e=1;e<o/2;e++)i[e]^=i[e-1];a=i[o/2-1],i[o/2]^=h[255&a]^h[a>>8&255]<<8^h[a>>16&255]<<16^h[a>>24&255]<<24;for(e=o/2+1;e<o;e++)i[e]^=i[e-1]}for(e=0;e<o&&s<n;)c=s>>2,p=s%4,this._Ke[c][p]=i[e],this._Kd[t-c][p]=i[e++],s++}for(var c=1;c<t;c++)for(var p=0;p<4;p++)a=this._Kd[c][p],this._Kd[c][p]=k[a>>24&255]^E[a>>16&255]^x[a>>8&255]^A[255&a]},S.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=O(t),o=0;o<4;o++)n[o]^=this._Ke[0][o];for(var a=1;a<e;a++){for(o=0;o<4;o++)r[o]=d[n[o]>>24&255]^m[n[(o+1)%4]>>16&255]^v[n[(o+2)%4]>>8&255]^y[255&n[(o+3)%4]]^this._Ke[a][o];n=r.slice()}var u,s=i(16);for(o=0;o<4;o++)u=this._Ke[e][o],s[4*o]=255&(h[n[o]>>24&255]^u>>24),s[4*o+1]=255&(h[n[(o+1)%4]>>16&255]^u>>16),s[4*o+2]=255&(h[n[(o+2)%4]>>8&255]^u>>8),s[4*o+3]=255&(h[255&n[(o+3)%4]]^u);return s},S.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=O(t),o=0;o<4;o++)n[o]^=this._Kd[0][o];for(var a=1;a<e;a++){for(o=0;o<4;o++)r[o]=g[n[o]>>24&255]^b[n[(o+3)%4]>>16&255]^w[n[(o+2)%4]>>8&255]^_[255&n[(o+1)%4]]^this._Kd[a][o];n=r.slice()}var u,s=i(16);for(o=0;o<4;o++)u=this._Kd[e][o],s[4*o]=255&(p[n[o]>>24&255]^u>>24),s[4*o+1]=255&(p[n[(o+3)%4]>>16&255]^u>>16),s[4*o+2]=255&(p[n[(o+2)%4]>>8&255]^u>>8),s[4*o+3]=255&(p[255&n[(o+1)%4]]^u);return s};var P=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new S(e)};P.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=i(t.length),r=i(16),n=0;n<t.length;n+=16)a(t,r,0,n,n+16),a(r=this._aes.encrypt(r),e,n);return e},P.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=i(t.length),r=i(16),n=0;n<t.length;n+=16)a(t,r,0,n,n+16),a(r=this._aes.decrypt(r),e,n);return e};var j=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else r=i(16);this._lastCipherblock=o(r,!0),this._aes=new S(e)};j.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=i(t.length),r=i(16),n=0;n<t.length;n+=16){a(t,r,0,n,n+16);for(var u=0;u<16;u++)r[u]^=this._lastCipherblock[u];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,e,n)}return e},j.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=i(t.length),r=i(16),n=0;n<t.length;n+=16){a(t,r,0,n,n+16),r=this._aes.decrypt(r);for(var u=0;u<16;u++)e[n+u]=r[u]^this._lastCipherblock[u];a(t,this._lastCipherblock,0,n,n+16)}return e};var T=function t(e,r,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 size)")}else r=i(16);n||(n=1),this.segmentSize=n,this._shiftRegister=o(r,!0),this._aes=new S(e)};T.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},T.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(t,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var N=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else r=i(16);this._lastPrecipher=o(r,!0),this._lastPrecipherIndex=16,this._aes=new S(e)};N.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},N.prototype.decrypt=N.prototype.encrypt;var I=function t(e){if(!(this instanceof t))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=i(16),this.setValue(e)):this.setBytes(e)};I.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");for(var e=15;e>=0;--e)this._counter[e]=t%256,t>>=8},I.prototype.setBytes=function(t){if(16!=(t=o(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},I.prototype.increment=function(){for(var t=15;t>=0;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var R=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof I||(r=new I(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new S(e)};R.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[r]^=this._remainingCounter[this._remainingCounterIndex++];return e},R.prototype.decrypt=R.prototype.encrypt;var L={AES:S,Counter:I,ModeOfOperation:{ecb:P,cbc:j,cfb:T,ofb:N,ctr:R},utils:{hex:c,utf8:s},padding:{pkcs7:{pad:function(t){var e=16-(t=o(t,!0)).length%16,r=i(t.length+e);a(t,r);for(var n=t.length;n<r.length;n++)r[n]=e;return r},strip:function(t){if((t=o(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(e>16)throw new Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n<e;n++)if(t[r+n]!==e)throw new Error("PKCS#7 invalid padding byte");var u=i(r);return a(t,u,0,0,r),u}}},_arrayTest:{coerceArray:o,createArray:i,copyArray:a}};t.exports=L}()},function(t,e,r){"use strict";var n=r(12),o=r(69);function i(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function u(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=o,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),o=0;o<t.length;o+=2)r.push(parseInt(t[o]+t[o+1],16))}else for(var n=0,o=0;o<t.length;o++){var a=t.charCodeAt(o);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):i(t,o)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++o)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(o=0;o<t.length;o++)r[o]=0|t[o];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=u(t[r].toString(16));return e},e.htonl=a,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var o=t[n];"little"===e&&(o=a(o)),r+=s(o.toString(16))}return r},e.zero2=u,e.zero8=s,e.join32=function(t,e,r,o){var i=r-e;n(i%4==0);for(var a=new Array(i/4),u=0,s=e;u<a.length;u++,s+=4){var c;c="big"===o?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],a[u]=c>>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,o=0;n<t.length;n++,o+=4){var i=t[n];"big"===e?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,o){return t+e+r+n+o>>>0},e.sum64=function(t,e,r,n){var o=t[e],i=n+t[e+1]>>>0,a=(i<n?1:0)+r+o;t[e]=a>>>0,t[e+1]=i},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,o,i,a,u){var s=0,c=e;return s+=(c=c+n>>>0)<e?1:0,s+=(c=c+i>>>0)<i?1:0,t+r+o+a+(s+=(c=c+u>>>0)<u?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,o,i,a,u){return e+n+i+u>>>0},e.sum64_5_hi=function(t,e,r,n,o,i,a,u,s,c){var l=0,f=e;return l+=(f=f+n>>>0)<e?1:0,l+=(f=f+i>>>0)<i?1:0,l+=(f=f+u>>>0)<u?1:0,t+r+o+a+s+(l+=(f=f+c>>>0)<c?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,o,i,a,u,s,c){return e+n+i+u+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},,,function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var n=r(7),o=r(12);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=i,i.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var o=0;o<t.length;o+=this._delta32)this._update(t,o,o+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),o(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t>>>24&255,n[o++]=t>>>16&255,n[o++]=t>>>8&255,n[o++]=255&t}else for(n[o++]=255&t,n[o++]=t>>>8&255,n[o++]=t>>>16&255,n[o++]=t>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n}},function(t,e,r){"use strict";(function(e){!function(r){function n(t){var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),r=1779033703,n=3144134277,o=1013904242,i=2773480762,a=1359893119,u=2600822924,s=528734635,c=1541459225,l=new Uint32Array(64);function f(t){for(var f=0,h=t.length;h>=64;){var p=r,d=n,m=o,v=i,y=a,g=u,b=s,w=c,_=void 0,k=void 0,E=void 0,x=void 0,A=void 0;for(k=0;k<16;k++)E=f+4*k,l[k]=(255&t[E])<<24|(255&t[E+1])<<16|(255&t[E+2])<<8|255&t[E+3];for(k=16;k<64;k++)x=((_=l[k-2])>>>17|_<<15)^(_>>>19|_<<13)^_>>>10,A=((_=l[k-15])>>>7|_<<25)^(_>>>18|_<<14)^_>>>3,l[k]=(x+l[k-7]|0)+(A+l[k-16]|0)|0;for(k=0;k<64;k++)x=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&g^~y&b)|0)+(w+(e[k]+l[k]|0)|0)|0,A=((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+(p&d^p&m^d&m)|0,w=b,b=g,g=y,y=v+x|0,v=m,m=d,d=p,p=x+A|0;r=r+p|0,n=n+d|0,o=o+m|0,i=i+v|0,a=a+y|0,u=u+g|0,s=s+b|0,c=c+w|0,f+=64,h-=64}}f(t);var h,p=t.length%64,d=t.length/536870912|0,m=t.length<<3,v=p<56?56:120,y=t.slice(t.length-p,t.length);for(y.push(128),h=p+1;h<v;h++)y.push(0);return y.push(d>>>24&255),y.push(d>>>16&255),y.push(d>>>8&255),y.push(d>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),f(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function o(t,e,r){t=t.length<=64?t:n(t);var o,i=64+e.length+4,a=new Array(i),u=new Array(64),s=[];for(o=0;o<64;o++)a[o]=54;for(o=0;o<t.length;o++)a[o]^=t[o];for(o=0;o<e.length;o++)a[64+o]=e[o];for(o=i-4;o<i;o++)a[o]=0;for(o=0;o<64;o++)u[o]=92;for(o=0;o<t.length;o++)u[o]^=t[o];function c(){for(var t=i-1;t>=i-4;t--){if(a[t]++,a[t]<=255)return;a[t]=0}}for(;r>=32;)c(),s=s.concat(n(u.concat(n(a)))),r-=32;return r>0&&(c(),s=s.concat(n(u.concat(n(a))).slice(0,r))),s}function i(t,e,r,n,o){var i;for(c(t,16*(2*r-1),o,0,16),i=0;i<2*r;i++)s(t,16*i,o,16),u(o,n),c(o,0,t,e+16*i,16);for(i=0;i<r;i++)c(t,e+2*i*16,t,16*i,16);for(i=0;i<r;i++)c(t,e+16*(2*i+1),t,16*(i+r),16)}function a(t,e){return t<<e|t>>>32-e}function u(t,e){c(t,0,e,0,16);for(var r=8;r>0;r-=2)e[4]^=a(e[0]+e[12],7),e[8]^=a(e[4]+e[0],9),e[12]^=a(e[8]+e[4],13),e[0]^=a(e[12]+e[8],18),e[9]^=a(e[5]+e[1],7),e[13]^=a(e[9]+e[5],9),e[1]^=a(e[13]+e[9],13),e[5]^=a(e[1]+e[13],18),e[14]^=a(e[10]+e[6],7),e[2]^=a(e[14]+e[10],9),e[6]^=a(e[2]+e[14],13),e[10]^=a(e[6]+e[2],18),e[3]^=a(e[15]+e[11],7),e[7]^=a(e[3]+e[15],9),e[11]^=a(e[7]+e[3],13),e[15]^=a(e[11]+e[7],18),e[1]^=a(e[0]+e[3],7),e[2]^=a(e[1]+e[0],9),e[3]^=a(e[2]+e[1],13),e[0]^=a(e[3]+e[2],18),e[6]^=a(e[5]+e[4],7),e[7]^=a(e[6]+e[5],9),e[4]^=a(e[7]+e[6],13),e[5]^=a(e[4]+e[7],18),e[11]^=a(e[10]+e[9],7),e[8]^=a(e[11]+e[10],9),e[9]^=a(e[8]+e[11],13),e[10]^=a(e[9]+e[8],18),e[12]^=a(e[15]+e[14],7),e[13]^=a(e[12]+e[15],9),e[14]^=a(e[13]+e[12],13),e[15]^=a(e[14]+e[13],18);for(var n=0;n<16;++n)t[n]+=e[n]}function s(t,e,r,n){for(var o=0;o<n;o++)r[o]^=t[e+o]}function c(t,e,r,n,o){for(;o--;)r[n++]=t[e++]}function l(t){if(!t||"number"!=typeof t.length)return!1;for(var e=0;e<t.length;e++){var r=t[e];if("number"!=typeof r||r%1||r<0||r>=256)return!1}return!0}function f(t,e){if("number"!=typeof t||t%1)throw new Error("invalid "+e);return t}function h(t,r,n,a,u,h,p){if(n=f(n,"N"),a=f(a,"r"),u=f(u,"p"),h=f(h,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>2147483647/128/a)throw new Error("N too large");if(a>2147483647/128/u)throw new Error("r too large");if(!l(t))throw new Error("password must be an array or buffer");if(t=Array.prototype.slice.call(t),!l(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);for(var d=o(t,r,128*u*a),m=new Uint32Array(32*u*a),v=0;v<m.length;v++){var y=4*v;m[v]=(255&d[y+3])<<24|(255&d[y+2])<<16|(255&d[y+1])<<8|(255&d[y+0])<<0}var g,b,w=new Uint32Array(64*a),_=new Uint32Array(32*a*n),k=32*a,E=new Uint32Array(16),x=new Uint32Array(16),A=u*n*2,O=0,S=null,P=!1,j=0,T=0,N=p?parseInt(1e3/a):4294967295,I=void 0!==e?e:setTimeout,R=function e(){if(P)return p(new Error("cancelled"),O/A);var r;switch(j){case 0:c(m,b=32*T*a,w,0,k),j=1,g=0;case 1:(r=n-g)>N&&(r=N);for(var l=0;l<r;l++)c(w,0,_,(g+l)*k,k),i(w,k,a,E,x);if(g+=r,O+=r,p){var f=parseInt(1e3*O/A);if(f!==S){if(P=p(null,O/A))break;S=f}}if(g<n)break;g=0,j=2;case 2:(r=n-g)>N&&(r=N);for(var v=0;v<r;v++){var y=w[16*(2*a-1)]&n-1;s(_,y*k,w,k),i(w,k,a,E,x)}if(g+=r,O+=r,p){var R=parseInt(1e3*O/A);if(R!==S){if(P=p(null,O/A))break;S=R}}if(g<n)break;if(c(w,0,m,b,k),++T<u){j=0;break}d=[];for(var L=0;L<m.length;L++)d.push(m[L]>>0&255),d.push(m[L]>>8&255),d.push(m[L]>>16&255),d.push(m[L]>>24&255);var C=o(t,d,h);return p&&p(null,1,C),C}p&&I(e)};if(!p)for(;;){var L=R();if(null!=L)return L}R()}var p={scrypt:function(t,e,r,n,o,i,a){return new Promise((function(u,s){var c=0;a&&a(0),h(t,e,r,n,o,i,(function(t,e,r){if(t)s(t);else if(r)a&&1!==c&&a(1),u(new Uint8Array(r));else if(a&&e!==c)return c=e,a(e)}))}))},syncScrypt:function(t,e,r,n,o,i){return new Uint8Array(h(t,e,r,n,o,i))}};t.exports=p}()}).call(this,r(76).setImmediate)},,function(t,e,r){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(40)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"===("undefined"==typeof globalThis?"undefined":n(globalThis))?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,s,"next",t)}function s(t){r(a,o,i,u,s,"throw",t)}u(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";(function(t){
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=37)}([function(t,e,r){"use strict";r.d(e,"k",(function(){return a})),r.d(e,"j",(function(){return s})),r.d(e,"a",(function(){return c})),r.d(e,"b",(function(){return l})),r.d(e,"o",(function(){return f})),r.d(e,"p",(function(){return h})),r.d(e,"l",(function(){return p})),r.d(e,"i",(function(){return d})),r.d(e,"d",(function(){return v})),r.d(e,"e",(function(){return y})),r.d(e,"c",(function(){return m})),r.d(e,"g",(function(){return g})),r.d(e,"f",(function(){return b})),r.d(e,"h",(function(){return w})),r.d(e,"n",(function(){return _})),r.d(e,"m",(function(){return k}));var n=new(r(1).b)("bytes/5.7.0");function o(t){return!!t.toHexString}function i(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return i(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){return p(t)&&!(t.length%2)||s(t)}function u(t){return"number"==typeof t&&t==t&&t%1==0}function s(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!u(t.length)||t.length<0)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(!u(r)||r<0||r>=256)return!1}return!0}function c(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid arrayify value");for(var r=[];t;)r.unshift(255&t),t=parseInt(String(t/256));return 0===r.length&&r.push(0),i(new Uint8Array(r))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),o(t)&&(t=t.toHexString()),p(t)){var a=t.substring(2);a.length%2&&("left"===e.hexPad?a="0"+a:"right"===e.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",t));for(var u=[],c=0;c<a.length;c+=2)u.push(parseInt(a.substring(c,c+2),16));return i(new Uint8Array(u))}return s(t)?i(new Uint8Array(t)):n.throwArgumentError("invalid arrayify value","value",t)}function l(t){var e=t.map((function(t){return c(t)})),r=e.reduce((function(t,e){return t+e.length}),0),n=new Uint8Array(r);return e.reduce((function(t,e){return n.set(e,t),t+e.length}),0),i(n)}function f(t){var e=c(t);if(0===e.length)return e;for(var r=0;r<e.length&&0===e[r];)r++;return r&&(e=e.slice(r)),e}function h(t,e){(t=c(t)).length>e&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(e);return r.set(t,e-t.length),i(r)}function p(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function d(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid hexlify value");for(var r="";t;)r="0123456789abcdef"[15&t]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),o(t))return t.toHexString();if(p(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":n.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(s(t)){for(var i="0x",a=0;a<t.length;a++){var u=t[a];i+="0123456789abcdef"[(240&u)>>4]+"0123456789abcdef"[15&u]}return i}return n.throwArgumentError("invalid hexlify value","value",t)}function v(t){if("string"!=typeof t)t=d(t);else if(!p(t)||t.length%2)return null;return(t.length-2)/2}function y(t,e,r){return"string"!=typeof t?t=d(t):(!p(t)||t.length%2)&&n.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function m(t){var e="0x";return t.forEach((function(t){e+=d(t).substring(2)})),e}function g(t){var e=b(d(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function b(t){"string"!=typeof t&&(t=d(t)),p(t)||n.throwArgumentError("invalid hex string","value",t),t=t.substring(2);for(var e=0;e<t.length&&"0"===t[e];)e++;return"0x"+t.substring(e)}function w(t,e){for("string"!=typeof t?t=d(t):p(t)||n.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&n.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function _(t){var e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(t)){var r=c(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=d(r.slice(0,32)),e.s=d(r.slice(32,64))):65===r.length?(e.r=d(r.slice(0,32)),e.s=d(r.slice(32,64)),e.v=r[64]):n.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:n.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=d(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){var o=h(c(e._vs),32);e._vs=d(o);var i=o[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),o[0]&=127;var u=d(o);null==e.s?e.s=u:e.s!==u&&n.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?n.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{var s=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==s&&n.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&p(e.r)?e.r=w(e.r,32):n.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&p(e.s)?e.s=w(e.s,32):n.throwArgumentError("signature missing or invalid s","signature",t);var l=c(e.s);l[0]>=128&&n.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(l[0]|=128);var f=d(l);e._vs&&(p(e._vs)||n.throwArgumentError("signature invalid _vs","signature",t),e._vs=w(e._vs,32)),null==e._vs?e._vs=f:e._vs!==f&&n.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function k(t){return d(l([(t=_(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";r.d(e,"a",(function(){return f})),r.d(e,"b",(function(){return d}));function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.key,a=void 0,a=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===n(a)?a:String(a)),o)}var i,a}var i=!1,a=!1,u={debug:1,default:2,info:2,warning:3,error:4,off:5},s=u.default,c=null;var l,f,h=function(){try{var t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(l||(l={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(f||(f={}));var p="0123456789abcdef",d=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}var e,r,n;return e=t,n=[{key:"globalLogger",value:function(){return c||(c=new t("logger/5.7.0")),c}},{key:"setCensorship",value:function(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!e,i=!!r}},{key:"setLogLevel",value:function(e){var r=u[e.toLowerCase()];null!=r?s=r:t.globalLogger().warn("invalid log level - "+e)}},{key:"from",value:function(e){return new t(e)}}],(r=[{key:"_log",value:function(t,e){var r=t.toLowerCase();null==u[r]&&this.throwArgumentError("invalid log level name","logLevel",t),s>u[r]||console.log.apply(console,e)}},{key:"debug",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this._log(t.levels.DEBUG,r)}},{key:"info",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this._log(t.levels.INFO,r)}},{key:"warn",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this._log(t.levels.WARNING,r)}},{key:"makeError",value:function(e,r,n){if(a)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach((function(t){var e=n[t];try{if(e instanceof Uint8Array){for(var r="",i=0;i<e.length;i++)r+=p[e[i]>>4],r+=p[15&e[i]];o.push(t+"=Uint8Array(0x"+r+")")}else o.push(t+"="+JSON.stringify(e))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}})),o.push("code=".concat(r)),o.push("version=".concat(this.version));var i=e,u="";switch(r){case f.NUMERIC_FAULT:u="NUMERIC_FAULT";var s=e;switch(s){case"overflow":case"underflow":case"division-by-zero":u+="-"+s;break;case"negative-power":case"negative-width":u+="-unsupported";break;case"unbound-bitwise-result":u+="-unbound-result"}break;case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:u=r}u&&(e+=" [ See: https://links.ethers.org/v5-errors-"+u+" ]"),o.length&&(e+=" ("+o.join(", ")+")");var c=new Error(e);return c.reason=i,c.code=r,Object.keys(n).forEach((function(t){c[t]=n[t]})),c}},{key:"throwError",value:function(t,e,r){throw this.makeError(t,e,r)}},{key:"throwArgumentError",value:function(e,r,n){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(t,e,r,n){t||this.throwError(e,r,n)}},{key:"assertArgument",value:function(t,e,r,n){t||this.throwArgumentError(e,r,n)}},{key:"checkNormalize",value:function(e){null==e&&(e="platform missing String.prototype.normalize"),h&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:h})}},{key:"checkSafeUint53",value:function(e,r){"number"==typeof e&&(null==r&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}},{key:"checkArgumentCount",value:function(e,r,n){n=n?": "+n:"",e<r&&this.throwError("missing argument"+n,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}},{key:"checkNew",value:function(e,r){e!==Object&&null!=e||this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();d.errors=f,d.levels=l},function(t,e,r){(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,n){"use strict";function o(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var u;"object"===e(t)?t.exports=a:n.BN=a,a.BN=a,a.wordSize=26;try{u="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(68).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void o(!1,"Invalid character in "+t)}function c(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function l(t,e,r,n){for(var i=0,a=0,u=Math.min(t.length,r),s=e;s<u;s++){var c=t.charCodeAt(s)-48;i*=n,a=c>=49?c-49+10:c>=17?c-17+10:c,o(c>=0&&a<n,"Invalid character"),i+=a}return i}function f(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(a.isBN=function(t){return t instanceof a||null!==t&&"object"===e(t)&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===e(t))return this._initArray(t,r,n);"hex"===r&&(r=16),o(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===r?this._parseHex(t,i,n):(this._parseBase(t,r,i),"le"===n&&this._initArray(this.toArray(),r,n)))},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(o("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a,u=0;if("be"===r)for(n=t.length-1,i=0;n>=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[i]|=a<<u&67108863,this.words[i+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);else if("le"===r)for(n=0,i=0;n<t.length;n+=3)a=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[i]|=a<<u&67108863,this.words[i+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);return this._strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,a=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)o=c(t,e,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)o=c(t,e,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=e)n++;n--,o=o/e|0;for(var i=t.length-r,a=i%n,u=Math.min(i,i-a)+r,s=0,c=r;c<u;c+=n)s=l(t,c,c+n,e),this.imuln(o),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==a){var f=1;for(s=l(t,c,t.length,e),c=0;c<a;c++)f*=e;this.imuln(f),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this._strip()},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype._move=function(t){f(t,this)},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){a.prototype.inspect=h}else a.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],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];a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,i=0,a=0;a<this.length;a++){var u=this.words[a],s=(16777215&(u<<n|i)).toString(16);i=u>>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),r=0!==i||a!==this.length-1?p[6-s.length]+s+r:s+r}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=v[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var h=f.modrn(l).toString(t);r=(f=f.idivn(l)).isZero()?h+r:p[c-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}o(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16,2)},u&&(a.prototype.toBuffer=function(t,e){return this.toArrayLike(u,t,e)}),a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function y(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var o=0|t.words[0],i=0|e.words[0],a=o*i,u=67108863&a,s=a/67108864|0;r.words[0]=u;for(var c=1;c<n;c++){for(var l=s>>>26,f=67108863&s,h=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=h;p++){var d=c-p|0;l+=(a=(o=0|t.words[d])*(i=0|e.words[p])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,s=0|l}return 0!==s?r.words[c]=0|s:r.length--,r._strip()}a.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);o(n<=i,"byte array longer than desired length"),o(i>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,i);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},a.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|n;t[r++]=255&a,r<t.length&&(t[r++]=a>>8&255),r<t.length&&(t[r++]=a>>16&255),6===i?(r<t.length&&(t[r++]=a>>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},a.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|n;t[r--]=255&a,r>=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===i?(r>=0&&(t[r--]=a>>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},a.prototype.ior=function(t){return o(0==(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},a.prototype.iand=function(t){return o(0==(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},a.prototype.ixor=function(t){return o(0==(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){o("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){o("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},a.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var o=0,i=0;i<n.length;i++)e=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&e,o=e>>>26;for(;0!==o&&i<r.length;i++)e=(0|r.words[i])+o,this.words[i]=67108863&e,o=e>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,o=this.cmp(t);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)i=(e=(0|r.words[a])-(0|n.words[a])+i)>>26,this.words[a]=67108863&e;for(;0!==i&&a<r.length;a++)i=(e=(0|r.words[a])+i)>>26,this.words[a]=67108863&e;if(0===i&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,r){var n,o,i,a=t.words,u=e.words,s=r.words,c=0,l=0|a[0],f=8191&l,h=l>>>13,p=0|a[1],d=8191&p,v=p>>>13,y=0|a[2],m=8191&y,g=y>>>13,b=0|a[3],w=8191&b,_=b>>>13,k=0|a[4],E=8191&k,x=k>>>13,A=0|a[5],O=8191&A,S=A>>>13,P=0|a[6],j=8191&P,T=P>>>13,R=0|a[7],N=8191&R,I=R>>>13,L=0|a[8],C=8191&L,M=L>>>13,B=0|a[9],F=8191&B,D=B>>>13,U=0|u[0],z=8191&U,G=U>>>13,H=0|u[1],q=8191&H,K=H>>>13,W=0|u[2],Q=8191&W,V=W>>>13,J=0|u[3],Y=8191&J,Z=J>>>13,X=0|u[4],$=8191&X,tt=X>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,ot=0|u[6],it=8191&ot,at=ot>>>13,ut=0|u[7],st=8191&ut,ct=ut>>>13,lt=0|u[8],ft=8191<,ht=lt>>>13,pt=0|u[9],dt=8191&pt,vt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(c+(n=Math.imul(f,z))|0)+((8191&(o=(o=Math.imul(f,G))+Math.imul(h,z)|0))<<13)|0;c=((i=Math.imul(h,G))+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(d,z),o=(o=Math.imul(d,G))+Math.imul(v,z)|0,i=Math.imul(v,G);var mt=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(o=(o=o+Math.imul(f,K)|0)+Math.imul(h,q)|0))<<13)|0;c=((i=i+Math.imul(h,K)|0)+(o>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,z),o=(o=Math.imul(m,G))+Math.imul(g,z)|0,i=Math.imul(g,G),n=n+Math.imul(d,q)|0,o=(o=o+Math.imul(d,K)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,K)|0;var gt=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(o=(o=o+Math.imul(f,V)|0)+Math.imul(h,Q)|0))<<13)|0;c=((i=i+Math.imul(h,V)|0)+(o>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(w,z),o=(o=Math.imul(w,G))+Math.imul(_,z)|0,i=Math.imul(_,G),n=n+Math.imul(m,q)|0,o=(o=o+Math.imul(m,K)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,K)|0,n=n+Math.imul(d,Q)|0,o=(o=o+Math.imul(d,V)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,V)|0;var bt=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(o=(o=o+Math.imul(f,Z)|0)+Math.imul(h,Y)|0))<<13)|0;c=((i=i+Math.imul(h,Z)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(E,z),o=(o=Math.imul(E,G))+Math.imul(x,z)|0,i=Math.imul(x,G),n=n+Math.imul(w,q)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(m,Q)|0,o=(o=o+Math.imul(m,V)|0)+Math.imul(g,Q)|0,i=i+Math.imul(g,V)|0,n=n+Math.imul(d,Y)|0,o=(o=o+Math.imul(d,Z)|0)+Math.imul(v,Y)|0,i=i+Math.imul(v,Z)|0;var wt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(o=(o=o+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((i=i+Math.imul(h,tt)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(O,z),o=(o=Math.imul(O,G))+Math.imul(S,z)|0,i=Math.imul(S,G),n=n+Math.imul(E,q)|0,o=(o=o+Math.imul(E,K)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,K)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,V)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,V)|0,n=n+Math.imul(m,Y)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,Z)|0,n=n+Math.imul(d,$)|0,o=(o=o+Math.imul(d,tt)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(o=(o=o+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((i=i+Math.imul(h,nt)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,z),o=(o=Math.imul(j,G))+Math.imul(T,z)|0,i=Math.imul(T,G),n=n+Math.imul(O,q)|0,o=(o=o+Math.imul(O,K)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(E,Q)|0,o=(o=o+Math.imul(E,V)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,V)|0,n=n+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,i=i+Math.imul(_,Z)|0,n=n+Math.imul(m,$)|0,o=(o=o+Math.imul(m,tt)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0,n=n+Math.imul(d,rt)|0,o=(o=o+Math.imul(d,nt)|0)+Math.imul(v,rt)|0,i=i+Math.imul(v,nt)|0;var kt=(c+(n=n+Math.imul(f,it)|0)|0)+((8191&(o=(o=o+Math.imul(f,at)|0)+Math.imul(h,it)|0))<<13)|0;c=((i=i+Math.imul(h,at)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,z),o=(o=Math.imul(N,G))+Math.imul(I,z)|0,i=Math.imul(I,G),n=n+Math.imul(j,q)|0,o=(o=o+Math.imul(j,K)|0)+Math.imul(T,q)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(O,Q)|0,o=(o=o+Math.imul(O,V)|0)+Math.imul(S,Q)|0,i=i+Math.imul(S,V)|0,n=n+Math.imul(E,Y)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,Z)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,tt)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,o=(o=o+Math.imul(m,nt)|0)+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0,n=n+Math.imul(d,it)|0,o=(o=o+Math.imul(d,at)|0)+Math.imul(v,it)|0,i=i+Math.imul(v,at)|0;var Et=(c+(n=n+Math.imul(f,st)|0)|0)+((8191&(o=(o=o+Math.imul(f,ct)|0)+Math.imul(h,st)|0))<<13)|0;c=((i=i+Math.imul(h,ct)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,z),o=(o=Math.imul(C,G))+Math.imul(M,z)|0,i=Math.imul(M,G),n=n+Math.imul(N,q)|0,o=(o=o+Math.imul(N,K)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,K)|0,n=n+Math.imul(j,Q)|0,o=(o=o+Math.imul(j,V)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,V)|0,n=n+Math.imul(O,Y)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,Z)|0,n=n+Math.imul(E,$)|0,o=(o=o+Math.imul(E,tt)|0)+Math.imul(x,$)|0,i=i+Math.imul(x,tt)|0,n=n+Math.imul(w,rt)|0,o=(o=o+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,n=n+Math.imul(m,it)|0,o=(o=o+Math.imul(m,at)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,at)|0,n=n+Math.imul(d,st)|0,o=(o=o+Math.imul(d,ct)|0)+Math.imul(v,st)|0,i=i+Math.imul(v,ct)|0;var xt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(o=(o=o+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((i=i+Math.imul(h,ht)|0)+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(F,z),o=(o=Math.imul(F,G))+Math.imul(D,z)|0,i=Math.imul(D,G),n=n+Math.imul(C,q)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,K)|0,n=n+Math.imul(N,Q)|0,o=(o=o+Math.imul(N,V)|0)+Math.imul(I,Q)|0,i=i+Math.imul(I,V)|0,n=n+Math.imul(j,Y)|0,o=(o=o+Math.imul(j,Z)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,Z)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,tt)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,tt)|0,n=n+Math.imul(E,rt)|0,o=(o=o+Math.imul(E,nt)|0)+Math.imul(x,rt)|0,i=i+Math.imul(x,nt)|0,n=n+Math.imul(w,it)|0,o=(o=o+Math.imul(w,at)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,at)|0,n=n+Math.imul(m,st)|0,o=(o=o+Math.imul(m,ct)|0)+Math.imul(g,st)|0,i=i+Math.imul(g,ct)|0,n=n+Math.imul(d,ft)|0,o=(o=o+Math.imul(d,ht)|0)+Math.imul(v,ft)|0,i=i+Math.imul(v,ht)|0;var At=(c+(n=n+Math.imul(f,dt)|0)|0)+((8191&(o=(o=o+Math.imul(f,vt)|0)+Math.imul(h,dt)|0))<<13)|0;c=((i=i+Math.imul(h,vt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,q),o=(o=Math.imul(F,K))+Math.imul(D,q)|0,i=Math.imul(D,K),n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,V)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,V)|0,n=n+Math.imul(N,Y)|0,o=(o=o+Math.imul(N,Z)|0)+Math.imul(I,Y)|0,i=i+Math.imul(I,Z)|0,n=n+Math.imul(j,$)|0,o=(o=o+Math.imul(j,tt)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,tt)|0,n=n+Math.imul(O,rt)|0,o=(o=o+Math.imul(O,nt)|0)+Math.imul(S,rt)|0,i=i+Math.imul(S,nt)|0,n=n+Math.imul(E,it)|0,o=(o=o+Math.imul(E,at)|0)+Math.imul(x,it)|0,i=i+Math.imul(x,at)|0,n=n+Math.imul(w,st)|0,o=(o=o+Math.imul(w,ct)|0)+Math.imul(_,st)|0,i=i+Math.imul(_,ct)|0,n=n+Math.imul(m,ft)|0,o=(o=o+Math.imul(m,ht)|0)+Math.imul(g,ft)|0,i=i+Math.imul(g,ht)|0;var Ot=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(o=(o=o+Math.imul(d,vt)|0)+Math.imul(v,dt)|0))<<13)|0;c=((i=i+Math.imul(v,vt)|0)+(o>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,Q),o=(o=Math.imul(F,V))+Math.imul(D,Q)|0,i=Math.imul(D,V),n=n+Math.imul(C,Y)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(M,Y)|0,i=i+Math.imul(M,Z)|0,n=n+Math.imul(N,$)|0,o=(o=o+Math.imul(N,tt)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,tt)|0,n=n+Math.imul(j,rt)|0,o=(o=o+Math.imul(j,nt)|0)+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,n=n+Math.imul(O,it)|0,o=(o=o+Math.imul(O,at)|0)+Math.imul(S,it)|0,i=i+Math.imul(S,at)|0,n=n+Math.imul(E,st)|0,o=(o=o+Math.imul(E,ct)|0)+Math.imul(x,st)|0,i=i+Math.imul(x,ct)|0,n=n+Math.imul(w,ft)|0,o=(o=o+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,i=i+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(m,dt)|0)|0)+((8191&(o=(o=o+Math.imul(m,vt)|0)+Math.imul(g,dt)|0))<<13)|0;c=((i=i+Math.imul(g,vt)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,Y),o=(o=Math.imul(F,Z))+Math.imul(D,Y)|0,i=Math.imul(D,Z),n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,tt)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,tt)|0,n=n+Math.imul(N,rt)|0,o=(o=o+Math.imul(N,nt)|0)+Math.imul(I,rt)|0,i=i+Math.imul(I,nt)|0,n=n+Math.imul(j,it)|0,o=(o=o+Math.imul(j,at)|0)+Math.imul(T,it)|0,i=i+Math.imul(T,at)|0,n=n+Math.imul(O,st)|0,o=(o=o+Math.imul(O,ct)|0)+Math.imul(S,st)|0,i=i+Math.imul(S,ct)|0,n=n+Math.imul(E,ft)|0,o=(o=o+Math.imul(E,ht)|0)+Math.imul(x,ft)|0,i=i+Math.imul(x,ht)|0;var Pt=(c+(n=n+Math.imul(w,dt)|0)|0)+((8191&(o=(o=o+Math.imul(w,vt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((i=i+Math.imul(_,vt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(F,$),o=(o=Math.imul(F,tt))+Math.imul(D,$)|0,i=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,o=(o=o+Math.imul(C,nt)|0)+Math.imul(M,rt)|0,i=i+Math.imul(M,nt)|0,n=n+Math.imul(N,it)|0,o=(o=o+Math.imul(N,at)|0)+Math.imul(I,it)|0,i=i+Math.imul(I,at)|0,n=n+Math.imul(j,st)|0,o=(o=o+Math.imul(j,ct)|0)+Math.imul(T,st)|0,i=i+Math.imul(T,ct)|0,n=n+Math.imul(O,ft)|0,o=(o=o+Math.imul(O,ht)|0)+Math.imul(S,ft)|0,i=i+Math.imul(S,ht)|0;var jt=(c+(n=n+Math.imul(E,dt)|0)|0)+((8191&(o=(o=o+Math.imul(E,vt)|0)+Math.imul(x,dt)|0))<<13)|0;c=((i=i+Math.imul(x,vt)|0)+(o>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(F,rt),o=(o=Math.imul(F,nt))+Math.imul(D,rt)|0,i=Math.imul(D,nt),n=n+Math.imul(C,it)|0,o=(o=o+Math.imul(C,at)|0)+Math.imul(M,it)|0,i=i+Math.imul(M,at)|0,n=n+Math.imul(N,st)|0,o=(o=o+Math.imul(N,ct)|0)+Math.imul(I,st)|0,i=i+Math.imul(I,ct)|0,n=n+Math.imul(j,ft)|0,o=(o=o+Math.imul(j,ht)|0)+Math.imul(T,ft)|0,i=i+Math.imul(T,ht)|0;var Tt=(c+(n=n+Math.imul(O,dt)|0)|0)+((8191&(o=(o=o+Math.imul(O,vt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((i=i+Math.imul(S,vt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,it),o=(o=Math.imul(F,at))+Math.imul(D,it)|0,i=Math.imul(D,at),n=n+Math.imul(C,st)|0,o=(o=o+Math.imul(C,ct)|0)+Math.imul(M,st)|0,i=i+Math.imul(M,ct)|0,n=n+Math.imul(N,ft)|0,o=(o=o+Math.imul(N,ht)|0)+Math.imul(I,ft)|0,i=i+Math.imul(I,ht)|0;var Rt=(c+(n=n+Math.imul(j,dt)|0)|0)+((8191&(o=(o=o+Math.imul(j,vt)|0)+Math.imul(T,dt)|0))<<13)|0;c=((i=i+Math.imul(T,vt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(F,st),o=(o=Math.imul(F,ct))+Math.imul(D,st)|0,i=Math.imul(D,ct),n=n+Math.imul(C,ft)|0,o=(o=o+Math.imul(C,ht)|0)+Math.imul(M,ft)|0,i=i+Math.imul(M,ht)|0;var Nt=(c+(n=n+Math.imul(N,dt)|0)|0)+((8191&(o=(o=o+Math.imul(N,vt)|0)+Math.imul(I,dt)|0))<<13)|0;c=((i=i+Math.imul(I,vt)|0)+(o>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(F,ft),o=(o=Math.imul(F,ht))+Math.imul(D,ft)|0,i=Math.imul(D,ht);var It=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(o=(o=o+Math.imul(C,vt)|0)+Math.imul(M,dt)|0))<<13)|0;c=((i=i+Math.imul(M,vt)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863;var Lt=(c+(n=Math.imul(F,dt))|0)+((8191&(o=(o=Math.imul(F,vt))+Math.imul(D,dt)|0))<<13)|0;return c=((i=Math.imul(D,vt))+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,s[0]=yt,s[1]=mt,s[2]=gt,s[3]=bt,s[4]=wt,s[5]=_t,s[6]=kt,s[7]=Et,s[8]=xt,s[9]=At,s[10]=Ot,s[11]=St,s[12]=Pt,s[13]=jt,s[14]=Tt,s[15]=Rt,s[16]=Nt,s[17]=It,s[18]=Lt,0!==c&&(s[19]=c,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var a=o;o=0;for(var u=67108863&n,s=Math.min(i,e.length-1),c=Math.max(0,i-t.length+1);c<=s;c++){var l=i-c,f=(0|t.words[l])*(0|e.words[c]),h=67108863&f;u=67108863&(h=h+u|0),o+=(a=(a=a+(f/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}r.words[i]=u,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r._strip()}function b(t,e,r){return g(t,e,r)}function w(t,e){this.x=t,this.y=e}Math.imul||(m=y),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?y(this,t,e):r<1024?g(this,t,e):b(this,t,e)},w.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},w.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,o=0;o<e;o++)n|=(1&t)<<e-o-1,t>>=1;return n},w.prototype.permute=function(t,e,r,n,o,i){for(var a=0;a<i;a++)n[a]=e[t[a]],o[a]=r[t[a]]},w.prototype.transform=function(t,e,r,n,o,i){this.permute(i,t,e,r,n,o);for(var a=1;a<o;a<<=1)for(var u=a<<1,s=Math.cos(2*Math.PI/u),c=Math.sin(2*Math.PI/u),l=0;l<o;l+=u)for(var f=s,h=c,p=0;p<a;p++){var d=r[l+p],v=n[l+p],y=r[l+p+a],m=n[l+p+a],g=f*y-h*m;m=f*m+h*y,y=g,r[l+p]=d+y,n[l+p]=v+m,r[l+p+a]=d-y,n[l+p+a]=v-m,p!==u&&(g=s*f-c*h,h=s*h+c*f,f=g)}},w.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,o=0;for(r=r/2|0;r;r>>>=1)o++;return 1<<o+1+n},w.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var o=t[n];t[n]=t[r-n-1],t[r-n-1]=o,o=e[n],e[n]=-e[r-n-1],e[r-n-1]=-o}},w.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var o=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&o,r=o<67108864?0:o/67108864|0}return t},w.prototype.convert13b=function(t,e,r,n){for(var i=0,a=0;a<e;a++)i+=0|t[a],r[2*a]=8191&i,i>>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*e;a<n;++a)r[a]=0;o(0===i),o(0==(-8192&i))},w.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},w.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),o=this.makeRBT(n),i=this.stub(n),a=new Array(n),u=new Array(n),s=new Array(n),c=new Array(n),l=new Array(n),f=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,a,n),this.convert13b(e.words,e.length,c,n),this.transform(a,i,u,s,n,o),this.transform(c,i,l,f,n,o);for(var p=0;p<n;p++){var d=u[p]*l[p]-s[p]*f[p];s[p]=u[p]*f[p]+s[p]*l[p],u[p]=d}return this.conjugate(u,s,n),this.transform(u,s,h,i,n,o),this.conjugate(h,i,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),b(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){var e=t<0;e&&(t=-t),o("number"==typeof t),o(t<67108864);for(var r=0,n=0;n<this.length;n++){var i=(0|this.words[n])*t,a=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,o=r%26;e[r]=t.words[n]>>>o&1}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var o=r.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(r=r.mul(o));return r},a.prototype.iushln=function(t){o("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var u=this.words[e]&i,s=(0|this.words[e])-u<<r;this.words[e]=s|a,a=u>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this._strip()},a.prototype.ishln=function(t){return o(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){var n;o("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var i=t%26,a=Math.min((t-i)/26,this.length),u=67108863^67108863>>>i<<i,s=r;if(n-=a,n=Math.max(0,n),s){for(var c=0;c<a;c++)s.words[c]=this.words[c];s.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=n);c--){var f=0|this.words[c];this.words[c]=l<<26-i|f>>>i,l=f&u}return s&&0!==l&&(s.words[s.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(t,e,r){return o(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){o("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},a.prototype.imaskn=function(t){o("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(o(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this._strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return o("number"==typeof t),o(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(o("number"==typeof t),o(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var n,i,a=t.length+r;this._expand(a);var u=0;for(n=0;n<t.length;n++){i=(0|this.words[n+r])+u;var s=(0|t.words[n])*e;u=((i-=67108863&s)>>26)-(s/67108864|0),this.words[n+r]=67108863&i}for(;n<this.length-r;n++)u=(i=(0|this.words[n+r])+u)>>26,this.words[n+r]=67108863&i;if(0===u)return this._strip();for(o(-1===u),u=0,n=0;n<this.length;n++)u=(i=-(0|this.words[n])+u)>>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,i=0|o.words[o.length-1];0!==(r=26-this._countBits(i))&&(o=o.ushln(r),n.iushln(r),i=0|o.words[o.length-1]);var u,s=n.length-o.length;if("mod"!==e){(u=new a(null)).length=s+1,u.words=new Array(u.length);for(var c=0;c<u.length;c++)u.words[c]=0}var l=n.clone()._ishlnsubmul(o,1,s);0===l.negative&&(n=l,u&&(u.words[s]=1));for(var f=s-1;f>=0;f--){var h=67108864*(0|n.words[o.length+f])+(0|n.words[o.length+f-1]);for(h=Math.min(h/i|0,67108863),n._ishlnsubmul(o,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(o,1,f),n.isZero()||(n.negative^=1);u&&(u.words[f]=h)}return u&&u._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},a.prototype.divmod=function(t,e,r){return o(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(n=u.div.neg()),"div"!==e&&(i=u.mod.neg(),r&&0!==i.negative&&i.iadd(t)),{div:n,mod:i}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(n=u.div.neg()),{div:n,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(i=u.mod.neg(),r&&0!==i.negative&&i.isub(t)),{div:u.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,i,u},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),o=t.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modrn=function(t){var e=t<0;e&&(t=-t),o(t<=67108863);for(var r=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%t;return e?-n:n},a.prototype.modn=function(t){return this.modrn(t)},a.prototype.idivn=function(t){var e=t<0;e&&(t=-t),o(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/t|0,r=i%t}return this._strip(),e?this.ineg():this},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){o(0===t.negative),o(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new a(1),i=new a(0),u=new a(0),s=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(l),i.isub(f)),n.iushrn(1),i.iushrn(1);for(var d=0,v=1;0==(r.words[0]&v)&&d<26;++d,v<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(l),s.isub(f)),u.iushrn(1),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(u),i.isub(s)):(r.isub(e),u.isub(n),s.isub(i))}return{a:u,b:s,gcd:r.iushln(c)}},a.prototype._invmp=function(t){o(0===t.negative),o(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,i=new a(1),u=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u)):(r.isub(e),u.isub(i))}return(n=0===e.cmpn(1)?i:u).cmpn(0)<0&&n.iadd(t),n},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=e.cmp(r);if(o<0){var i=e;e=r,r=i}else if(0===o||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){o("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var i=n,a=r;0!==i&&a<this.length;a++){var u=0|this.words[a];i=(u+=i)>>>26,u&=67108863,this.words[a]=u}return 0!==i&&(this.words[a]=i,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|t.words[r];if(n!==o){n<o?e=-1:n>o&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new S(t)},a.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var _={k256:null,p224:null,p192:null,p25519:null};function k(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else o(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function P(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}k.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},k.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},k.prototype.split=function(t,e){t.iushrn(this.n,0,e)},k.prototype.imulK=function(t){return t.imul(this.k)},i(E,k),E.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=4194303&o,n=10;n<t.length;n++){var i=0|t.words[n];t.words[n-10]=(4194303&i)<<4|o>>>22,o=i}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},E.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(x,k),i(A,k),i(O,k),O.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,o=67108863&n;n>>>=26,t.words[r]=o,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(_[t])return _[t];var e;if("k256"===t)e=new E;else if("p224"===t)e=new x;else if("p192"===t)e=new A;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new O}return _[t]=e,e},S.prototype._verify1=function(t){o(0===t.negative,"red works only with positives"),o(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){o(0==(t.negative|e.negative),"red works only with positives"),o(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(o(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);o(!n.isZero());var u=new a(1).toRed(this),s=u.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(s);)l.redIAdd(s);for(var f=this.pow(l,n),h=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=i;0!==p.cmp(u);){for(var v=p,y=0;0!==v.cmp(u);y++)v=v.redSqr();o(y<d);var m=this.pow(f,new a(1).iushln(d-y-1));h=h.redMul(m),f=m.redSqr(),p=p.redMul(f),d=y}return h},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new a(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var o=r[0],i=0,u=0,s=e.bitLength()%26;for(0===s&&(s=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=s-1;l>=0;l--){var f=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==f||0!==i?(i<<=1,i|=f,(4===++u||0===n&&0===l)&&(o=this.mul(o,r[i]),u=0,i=0)):u=0}s=26}return o},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new P(t)},i(P,S),P.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},P.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},P.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},P.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},P.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(9)(t))},,function(t,e,r){var n=e;n.utils=r(7),n.common=r(13),n.sha=r(70),n.ripemd=r(74),n.hmac=r(75),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(t,e,r){"use strict";!function(e){function r(t){return parseInt(t)===t}function n(t){if(!r(t.length))return!1;for(var e=0;e<t.length;e++)if(!r(t[e])||t[e]<0||t[e]>255)return!1;return!0}function o(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!n(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&n(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function i(t){return new Uint8Array(t)}function a(t,e,r,n,o){null==n&&null==o||(t=t.slice?t.slice(n,o):Array.prototype.slice.call(t,n,o)),e.set(t,r)}var u,s={toBytes:function(t){var e=[],r=0;for(t=encodeURI(t);r<t.length;){var n=t.charCodeAt(r++);37===n?(e.push(parseInt(t.substr(r,2),16)),r+=2):e.push(n)}return o(e)},fromBytes:function(t){for(var e=[],r=0;r<t.length;){var n=t[r];n<128?(e.push(String.fromCharCode(n)),r++):n>191&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},c=(u="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},fromBytes:function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(u[(240&n)>>4]+u[15&n])}return e.join("")}}),l={16:10,24:12,32:14},f=[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],h=[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],p=[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],d=[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],v=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],y=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],m=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[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],k=[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],E=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],x=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],A=[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 O(t){for(var e=[],r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}var S=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:o(e,!0)}),this._prepare()};S.prototype._prepare=function(){var t=l[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(t+1),o=this.key.length/4,i=O(this.key);for(e=0;e<o;e++)r=e>>2,this._Ke[r][e%4]=i[e],this._Kd[t-r][e%4]=i[e];for(var a,u=0,s=o;s<n;){if(a=i[o-1],i[0]^=h[a>>16&255]<<24^h[a>>8&255]<<16^h[255&a]<<8^h[a>>24&255]^f[u]<<24,u+=1,8!=o)for(e=1;e<o;e++)i[e]^=i[e-1];else{for(e=1;e<o/2;e++)i[e]^=i[e-1];a=i[o/2-1],i[o/2]^=h[255&a]^h[a>>8&255]<<8^h[a>>16&255]<<16^h[a>>24&255]<<24;for(e=o/2+1;e<o;e++)i[e]^=i[e-1]}for(e=0;e<o&&s<n;)c=s>>2,p=s%4,this._Ke[c][p]=i[e],this._Kd[t-c][p]=i[e++],s++}for(var c=1;c<t;c++)for(var p=0;p<4;p++)a=this._Kd[c][p],this._Kd[c][p]=k[a>>24&255]^E[a>>16&255]^x[a>>8&255]^A[255&a]},S.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=O(t),o=0;o<4;o++)n[o]^=this._Ke[0][o];for(var a=1;a<e;a++){for(o=0;o<4;o++)r[o]=d[n[o]>>24&255]^v[n[(o+1)%4]>>16&255]^y[n[(o+2)%4]>>8&255]^m[255&n[(o+3)%4]]^this._Ke[a][o];n=r.slice()}var u,s=i(16);for(o=0;o<4;o++)u=this._Ke[e][o],s[4*o]=255&(h[n[o]>>24&255]^u>>24),s[4*o+1]=255&(h[n[(o+1)%4]>>16&255]^u>>16),s[4*o+2]=255&(h[n[(o+2)%4]>>8&255]^u>>8),s[4*o+3]=255&(h[255&n[(o+3)%4]]^u);return s},S.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=O(t),o=0;o<4;o++)n[o]^=this._Kd[0][o];for(var a=1;a<e;a++){for(o=0;o<4;o++)r[o]=g[n[o]>>24&255]^b[n[(o+3)%4]>>16&255]^w[n[(o+2)%4]>>8&255]^_[255&n[(o+1)%4]]^this._Kd[a][o];n=r.slice()}var u,s=i(16);for(o=0;o<4;o++)u=this._Kd[e][o],s[4*o]=255&(p[n[o]>>24&255]^u>>24),s[4*o+1]=255&(p[n[(o+3)%4]>>16&255]^u>>16),s[4*o+2]=255&(p[n[(o+2)%4]>>8&255]^u>>8),s[4*o+3]=255&(p[255&n[(o+1)%4]]^u);return s};var P=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new S(e)};P.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=i(t.length),r=i(16),n=0;n<t.length;n+=16)a(t,r,0,n,n+16),a(r=this._aes.encrypt(r),e,n);return e},P.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=i(t.length),r=i(16),n=0;n<t.length;n+=16)a(t,r,0,n,n+16),a(r=this._aes.decrypt(r),e,n);return e};var j=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else r=i(16);this._lastCipherblock=o(r,!0),this._aes=new S(e)};j.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=i(t.length),r=i(16),n=0;n<t.length;n+=16){a(t,r,0,n,n+16);for(var u=0;u<16;u++)r[u]^=this._lastCipherblock[u];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,e,n)}return e},j.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=i(t.length),r=i(16),n=0;n<t.length;n+=16){a(t,r,0,n,n+16),r=this._aes.decrypt(r);for(var u=0;u<16;u++)e[n+u]=r[u]^this._lastCipherblock[u];a(t,this._lastCipherblock,0,n,n+16)}return e};var T=function t(e,r,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 size)")}else r=i(16);n||(n=1),this.segmentSize=n,this._shiftRegister=o(r,!0),this._aes=new S(e)};T.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},T.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(t,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var R=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else r=i(16);this._lastPrecipher=o(r,!0),this._lastPrecipherIndex=16,this._aes=new S(e)};R.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},R.prototype.decrypt=R.prototype.encrypt;var N=function t(e){if(!(this instanceof t))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=i(16),this.setValue(e)):this.setBytes(e)};N.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");for(var e=15;e>=0;--e)this._counter[e]=t%256,t>>=8},N.prototype.setBytes=function(t){if(16!=(t=o(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},N.prototype.increment=function(){for(var t=15;t>=0;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var I=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof N||(r=new N(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new S(e)};I.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[r]^=this._remainingCounter[this._remainingCounterIndex++];return e},I.prototype.decrypt=I.prototype.encrypt;var L={AES:S,Counter:N,ModeOfOperation:{ecb:P,cbc:j,cfb:T,ofb:R,ctr:I},utils:{hex:c,utf8:s},padding:{pkcs7:{pad:function(t){var e=16-(t=o(t,!0)).length%16,r=i(t.length+e);a(t,r);for(var n=t.length;n<r.length;n++)r[n]=e;return r},strip:function(t){if((t=o(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(e>16)throw new Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n<e;n++)if(t[r+n]!==e)throw new Error("PKCS#7 invalid padding byte");var u=i(r);return a(t,u,0,0,r),u}}},_arrayTest:{coerceArray:o,createArray:i,copyArray:a}};t.exports=L}()},function(t,e,r){"use strict";var n=r(12),o=r(69);function i(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function u(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=o,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),o=0;o<t.length;o+=2)r.push(parseInt(t[o]+t[o+1],16))}else for(var n=0,o=0;o<t.length;o++){var a=t.charCodeAt(o);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):i(t,o)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++o)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(o=0;o<t.length;o++)r[o]=0|t[o];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=u(t[r].toString(16));return e},e.htonl=a,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var o=t[n];"little"===e&&(o=a(o)),r+=s(o.toString(16))}return r},e.zero2=u,e.zero8=s,e.join32=function(t,e,r,o){var i=r-e;n(i%4==0);for(var a=new Array(i/4),u=0,s=e;u<a.length;u++,s+=4){var c;c="big"===o?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],a[u]=c>>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,o=0;n<t.length;n++,o+=4){var i=t[n];"big"===e?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,o){return t+e+r+n+o>>>0},e.sum64=function(t,e,r,n){var o=t[e],i=n+t[e+1]>>>0,a=(i<n?1:0)+r+o;t[e]=a>>>0,t[e+1]=i},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,o,i,a,u){var s=0,c=e;return s+=(c=c+n>>>0)<e?1:0,s+=(c=c+i>>>0)<i?1:0,t+r+o+a+(s+=(c=c+u>>>0)<u?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,o,i,a,u){return e+n+i+u>>>0},e.sum64_5_hi=function(t,e,r,n,o,i,a,u,s,c){var l=0,f=e;return l+=(f=f+n>>>0)<e?1:0,l+=(f=f+i>>>0)<i?1:0,l+=(f=f+u>>>0)<u?1:0,t+r+o+a+s+(l+=(f=f+c>>>0)<c?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,o,i,a,u,s,c){return e+n+i+u+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},,,function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var n=r(7),o=r(12);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=i,i.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var o=0;o<t.length;o+=this._delta32)this._update(t,o,o+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),o(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t>>>24&255,n[o++]=t>>>16&255,n[o++]=t>>>8&255,n[o++]=255&t}else for(n[o++]=255&t,n[o++]=t>>>8&255,n[o++]=t>>>16&255,n[o++]=t>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n}},function(t,e,r){"use strict";(function(e){!function(r){function n(t){var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),r=1779033703,n=3144134277,o=1013904242,i=2773480762,a=1359893119,u=2600822924,s=528734635,c=1541459225,l=new Uint32Array(64);function f(t){for(var f=0,h=t.length;h>=64;){var p=r,d=n,v=o,y=i,m=a,g=u,b=s,w=c,_=void 0,k=void 0,E=void 0,x=void 0,A=void 0;for(k=0;k<16;k++)E=f+4*k,l[k]=(255&t[E])<<24|(255&t[E+1])<<16|(255&t[E+2])<<8|255&t[E+3];for(k=16;k<64;k++)x=((_=l[k-2])>>>17|_<<15)^(_>>>19|_<<13)^_>>>10,A=((_=l[k-15])>>>7|_<<25)^(_>>>18|_<<14)^_>>>3,l[k]=(x+l[k-7]|0)+(A+l[k-16]|0)|0;for(k=0;k<64;k++)x=(((m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&b)|0)+(w+(e[k]+l[k]|0)|0)|0,A=((p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10))+(p&d^p&v^d&v)|0,w=b,b=g,g=m,m=y+x|0,y=v,v=d,d=p,p=x+A|0;r=r+p|0,n=n+d|0,o=o+v|0,i=i+y|0,a=a+m|0,u=u+g|0,s=s+b|0,c=c+w|0,f+=64,h-=64}}f(t);var h,p=t.length%64,d=t.length/536870912|0,v=t.length<<3,y=p<56?56:120,m=t.slice(t.length-p,t.length);for(m.push(128),h=p+1;h<y;h++)m.push(0);return m.push(d>>>24&255),m.push(d>>>16&255),m.push(d>>>8&255),m.push(d>>>0&255),m.push(v>>>24&255),m.push(v>>>16&255),m.push(v>>>8&255),m.push(v>>>0&255),f(m),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function o(t,e,r){t=t.length<=64?t:n(t);var o,i=64+e.length+4,a=new Array(i),u=new Array(64),s=[];for(o=0;o<64;o++)a[o]=54;for(o=0;o<t.length;o++)a[o]^=t[o];for(o=0;o<e.length;o++)a[64+o]=e[o];for(o=i-4;o<i;o++)a[o]=0;for(o=0;o<64;o++)u[o]=92;for(o=0;o<t.length;o++)u[o]^=t[o];function c(){for(var t=i-1;t>=i-4;t--){if(a[t]++,a[t]<=255)return;a[t]=0}}for(;r>=32;)c(),s=s.concat(n(u.concat(n(a)))),r-=32;return r>0&&(c(),s=s.concat(n(u.concat(n(a))).slice(0,r))),s}function i(t,e,r,n,o){var i;for(c(t,16*(2*r-1),o,0,16),i=0;i<2*r;i++)s(t,16*i,o,16),u(o,n),c(o,0,t,e+16*i,16);for(i=0;i<r;i++)c(t,e+2*i*16,t,16*i,16);for(i=0;i<r;i++)c(t,e+16*(2*i+1),t,16*(i+r),16)}function a(t,e){return t<<e|t>>>32-e}function u(t,e){c(t,0,e,0,16);for(var r=8;r>0;r-=2)e[4]^=a(e[0]+e[12],7),e[8]^=a(e[4]+e[0],9),e[12]^=a(e[8]+e[4],13),e[0]^=a(e[12]+e[8],18),e[9]^=a(e[5]+e[1],7),e[13]^=a(e[9]+e[5],9),e[1]^=a(e[13]+e[9],13),e[5]^=a(e[1]+e[13],18),e[14]^=a(e[10]+e[6],7),e[2]^=a(e[14]+e[10],9),e[6]^=a(e[2]+e[14],13),e[10]^=a(e[6]+e[2],18),e[3]^=a(e[15]+e[11],7),e[7]^=a(e[3]+e[15],9),e[11]^=a(e[7]+e[3],13),e[15]^=a(e[11]+e[7],18),e[1]^=a(e[0]+e[3],7),e[2]^=a(e[1]+e[0],9),e[3]^=a(e[2]+e[1],13),e[0]^=a(e[3]+e[2],18),e[6]^=a(e[5]+e[4],7),e[7]^=a(e[6]+e[5],9),e[4]^=a(e[7]+e[6],13),e[5]^=a(e[4]+e[7],18),e[11]^=a(e[10]+e[9],7),e[8]^=a(e[11]+e[10],9),e[9]^=a(e[8]+e[11],13),e[10]^=a(e[9]+e[8],18),e[12]^=a(e[15]+e[14],7),e[13]^=a(e[12]+e[15],9),e[14]^=a(e[13]+e[12],13),e[15]^=a(e[14]+e[13],18);for(var n=0;n<16;++n)t[n]+=e[n]}function s(t,e,r,n){for(var o=0;o<n;o++)r[o]^=t[e+o]}function c(t,e,r,n,o){for(;o--;)r[n++]=t[e++]}function l(t){if(!t||"number"!=typeof t.length)return!1;for(var e=0;e<t.length;e++){var r=t[e];if("number"!=typeof r||r%1||r<0||r>=256)return!1}return!0}function f(t,e){if("number"!=typeof t||t%1)throw new Error("invalid "+e);return t}function h(t,r,n,a,u,h,p){if(n=f(n,"N"),a=f(a,"r"),u=f(u,"p"),h=f(h,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>2147483647/128/a)throw new Error("N too large");if(a>2147483647/128/u)throw new Error("r too large");if(!l(t))throw new Error("password must be an array or buffer");if(t=Array.prototype.slice.call(t),!l(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);for(var d=o(t,r,128*u*a),v=new Uint32Array(32*u*a),y=0;y<v.length;y++){var m=4*y;v[y]=(255&d[m+3])<<24|(255&d[m+2])<<16|(255&d[m+1])<<8|(255&d[m+0])<<0}var g,b,w=new Uint32Array(64*a),_=new Uint32Array(32*a*n),k=32*a,E=new Uint32Array(16),x=new Uint32Array(16),A=u*n*2,O=0,S=null,P=!1,j=0,T=0,R=p?parseInt(1e3/a):4294967295,N=void 0!==e?e:setTimeout,I=function e(){if(P)return p(new Error("cancelled"),O/A);var r;switch(j){case 0:c(v,b=32*T*a,w,0,k),j=1,g=0;case 1:(r=n-g)>R&&(r=R);for(var l=0;l<r;l++)c(w,0,_,(g+l)*k,k),i(w,k,a,E,x);if(g+=r,O+=r,p){var f=parseInt(1e3*O/A);if(f!==S){if(P=p(null,O/A))break;S=f}}if(g<n)break;g=0,j=2;case 2:(r=n-g)>R&&(r=R);for(var y=0;y<r;y++){var m=w[16*(2*a-1)]&n-1;s(_,m*k,w,k),i(w,k,a,E,x)}if(g+=r,O+=r,p){var I=parseInt(1e3*O/A);if(I!==S){if(P=p(null,O/A))break;S=I}}if(g<n)break;if(c(w,0,v,b,k),++T<u){j=0;break}d=[];for(var L=0;L<v.length;L++)d.push(v[L]>>0&255),d.push(v[L]>>8&255),d.push(v[L]>>16&255),d.push(v[L]>>24&255);var C=o(t,d,h);return p&&p(null,1,C),C}p&&N(e)};if(!p)for(;;){var L=I();if(null!=L)return L}I()}var p={scrypt:function(t,e,r,n,o,i,a){return new Promise((function(u,s){var c=0;a&&a(0),h(t,e,r,n,o,i,(function(t,e,r){if(t)s(t);else if(r)a&&1!==c&&a(1),u(new Uint8Array(r));else if(a&&e!==c)return c=e,a(e)}))}))},syncScrypt:function(t,e,r,n,o,i){return new Uint8Array(h(t,e,r,n,o,i))}};t.exports=p}()}).call(this,r(76).setImmediate)},,function(t,e,r){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(40)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"===("undefined"==typeof globalThis?"undefined":n(globalThis))?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,s,"next",t)}function s(t){r(a,o,i,u,s,"throw",t)}u(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";(function(t){
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
7
|
*/
|
|
8
|
-
var n=r(47),o=r(48),i=r(49);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=u(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(s.isBuffer(e)){var r=0|p(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(l(e),t=u(t,e<0?0:0|p(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(n)return U(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,o);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,o){var i,a=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,s/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(i=r;i<u;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===s)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var f=!0,h=0;h<s;h++)if(c(t,i+h)!==c(e,h)){f=!1;break}if(f)return i}return-1}function b(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function w(t,e,r,n){return G(U(e,t.length-r),t,r,n)}function _(t,e,r,n){return G(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function k(t,e,r,n){return _(t,e,r,n)}function E(t,e,r,n){return G(z(e),t,r,n)}function x(t,e,r,n){return G(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,s,c=t[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&c)<<6|63&i)>127&&(l=s);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(s=(15&c)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(s=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=s,e.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},e.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return c(null,t,e,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,r){return function(t,e,r,n){return l(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},s.allocUnsafe=function(t){return f(null,t)},s.allocUnsafeSlow=function(t){return f(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?O(this,0,t):m.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),c=this.slice(n,o),l=t.slice(e,r),f=0;f<u;++f)if(c[f]!==l[f]){i=c[f],a=l[f];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return k(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function P(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=D(t[i]);return o}function T(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function N(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function C(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||C(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return i||C(t,0,r,8),o.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=s.prototype;else{var o=e-t;r=new s(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},s.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);I(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);I(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=s.isBuffer(t)?t:U(new s(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function U(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(8))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var s,c=[],l=!1,f=-1;function h(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&p())}function p(){if(!l){var t=u(h);l=!0;for(var e=c.length;e;){for(s=c,c=[];++f<e;)s&&s[f].run();f=-1,e=c.length}s=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||l||u(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}for(var o="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={},a=0;a<o.length;a++){var u=o.charAt(a);if(void 0!==i[u])throw new TypeError(u+" is ambiguous");i[u]=a}function s(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function c(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=s(e)^n>>5}for(e=s(e),r=0;r<t.length;++r){var o=t.charCodeAt(r);e=s(e)^31&o}return e}function l(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;var o=(t=r).lastIndexOf("1");if(-1===o)return"No separator character for "+t;if(0===o)return"Missing prefix for "+t;var a=t.slice(0,o),u=t.slice(o+1);if(u.length<6)return"Data too short";var l=c(a);if("string"==typeof l)return l;for(var f=[],h=0;h<u.length;++h){var p=u.charAt(h),d=i[p];if(void 0===d)return"Unknown character "+p;l=s(l)^d,h+6>=u.length||f.push(d)}return 1!==l?"Invalid checksum for "+t:{prefix:a,words:f}}function f(t,e,r,n){for(var o=0,i=0,a=(1<<r)-1,u=[],s=0;s<t.length;++s)for(o=o<<e|t[s],i+=e;i>=r;)i-=r,u.push(o>>i&a);if(n)i>0&&u.push(o<<r-i&a);else{if(i>=e)return"Excess padding";if(o<<r-i&a)return"Non-zero padding"}return u}t.exports={decodeUnsafe:function(){var t=l.apply(null,arguments);if("object"===n(t))return t},decode:function(t){var e=l.apply(null,arguments);if("object"===n(e))return e;throw new Error(e)},encode:function(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");var n=c(t=t.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=t+"1",a=0;a<e.length;++a){var u=e[a];if(u>>5!=0)throw new Error("Non 5-bit word");n=s(n)^u,i+=o.charAt(u)}for(a=0;a<6;++a)n=s(n);for(n^=1,a=0;a<6;++a){i+=o.charAt(n>>5*(5-a)&31)}return i},toWordsUnsafe:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}}},,function(t,e,r){var n=r(25);t.exports=function(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(17).default,o=r(41);t.exports=function(t){var e=o(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(26);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){(function(t,n){var o;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
|
|
9
|
-
/*! https://mths.be/punycode v1.4.0 by @mathias */!function(a){var u="object"==i(e)&&e&&!e.nodeType&&e,s="object"==i(t)&&t&&!t.nodeType&&t,c="object"==(void 0===n?"undefined":i(n))&&n;c.global!==c&&c.window!==c&&c.self!==c||(a=c);var l,f,h=2147483647,p=/^xn--/,d=/[^\x20-\x7E]/,
|
|
8
|
+
var n=r(47),o=r(48),i=r(49);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=u(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(s.isBuffer(e)){var r=0|p(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(l(e),t=u(t,e<0?0:0|p(e)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(n)return U(t).length;e=(""+e).toLowerCase(),n=!0}}function v(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,o);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,o){var i,a=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,s/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(i=r;i<u;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===s)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var f=!0,h=0;h<s;h++)if(c(t,i+h)!==c(e,h)){f=!1;break}if(f)return i}return-1}function b(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function w(t,e,r,n){return G(U(e,t.length-r),t,r,n)}function _(t,e,r,n){return G(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function k(t,e,r,n){return _(t,e,r,n)}function E(t,e,r,n){return G(z(e),t,r,n)}function x(t,e,r,n){return G(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,s,c=t[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&c)<<6|63&i)>127&&(l=s);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(s=(15&c)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(s=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=s,e.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},e.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return c(null,t,e,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,r){return function(t,e,r,n){return l(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},s.allocUnsafe=function(t){return f(null,t)},s.allocUnsafeSlow=function(t){return f(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?O(this,0,t):v.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),c=this.slice(n,o),l=t.slice(e,r),f=0;f<u;++f)if(c[f]!==l[f]){i=c[f],a=l[f];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return k(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function P(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=D(t[i]);return o}function T(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function I(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function C(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||C(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return i||C(t,0,r,8),o.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=s.prototype;else{var o=e-t;r=new s(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},s.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||N(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||N(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);N(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);N(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=s.isBuffer(t)?t:U(new s(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function U(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(8))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var s,c=[],l=!1,f=-1;function h(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&p())}function p(){if(!l){var t=u(h);l=!0;for(var e=c.length;e;){for(s=c,c=[];++f<e;)s&&s[f].run();f=-1,e=c.length}s=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||l||u(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}for(var o="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={},a=0;a<o.length;a++){var u=o.charAt(a);if(void 0!==i[u])throw new TypeError(u+" is ambiguous");i[u]=a}function s(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function c(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=s(e)^n>>5}for(e=s(e),r=0;r<t.length;++r){var o=t.charCodeAt(r);e=s(e)^31&o}return e}function l(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;var o=(t=r).lastIndexOf("1");if(-1===o)return"No separator character for "+t;if(0===o)return"Missing prefix for "+t;var a=t.slice(0,o),u=t.slice(o+1);if(u.length<6)return"Data too short";var l=c(a);if("string"==typeof l)return l;for(var f=[],h=0;h<u.length;++h){var p=u.charAt(h),d=i[p];if(void 0===d)return"Unknown character "+p;l=s(l)^d,h+6>=u.length||f.push(d)}return 1!==l?"Invalid checksum for "+t:{prefix:a,words:f}}function f(t,e,r,n){for(var o=0,i=0,a=(1<<r)-1,u=[],s=0;s<t.length;++s)for(o=o<<e|t[s],i+=e;i>=r;)i-=r,u.push(o>>i&a);if(n)i>0&&u.push(o<<r-i&a);else{if(i>=e)return"Excess padding";if(o<<r-i&a)return"Non-zero padding"}return u}t.exports={decodeUnsafe:function(){var t=l.apply(null,arguments);if("object"===n(t))return t},decode:function(t){var e=l.apply(null,arguments);if("object"===n(e))return e;throw new Error(e)},encode:function(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");var n=c(t=t.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=t+"1",a=0;a<e.length;++a){var u=e[a];if(u>>5!=0)throw new Error("Non 5-bit word");n=s(n)^u,i+=o.charAt(u)}for(a=0;a<6;++a)n=s(n);for(n^=1,a=0;a<6;++a){i+=o.charAt(n>>5*(5-a)&31)}return i},toWordsUnsafe:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}}},,function(t,e,r){var n=r(25);t.exports=function(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(17).default,o=r(41);t.exports=function(t){var e=o(t,"string");return"symbol"===n(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(26);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){(function(t,n){var o;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
|
|
9
|
+
/*! https://mths.be/punycode v1.4.0 by @mathias */!function(a){var u="object"==i(e)&&e&&!e.nodeType&&e,s="object"==i(t)&&t&&!t.nodeType&&t,c="object"==(void 0===n?"undefined":i(n))&&n;c.global!==c&&c.window!==c&&c.self!==c||(a=c);var l,f,h=2147483647,p=/^xn--/,d=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function b(t){throw new RangeError(y[t])}function w(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function _(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+w((t=t.replace(v,".")).split("."),e).join(".")}function k(t){for(var e,r,n=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(r=t.charCodeAt(o++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--):n.push(e);return n}function E(t){return w(t,(function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function A(t,e,r){var n=0;for(t=r?m(t/700):t>>1,t+=m(t/e);t>455;n+=36)t=m(t/35);return m(n+36*t/(t+38))}function O(t){var e,r,n,o,i,a,u,s,c,l,f,p=[],d=t.length,v=0,y=128,g=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&b("not-basic"),p.push(t.charCodeAt(n));for(o=r>0?r+1:0;o<d;){for(i=v,a=1,u=36;o>=d&&b("invalid-input"),((s=(f=t.charCodeAt(o++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||s>m((h-v)/a))&&b("overflow"),v+=s*a,!(s<(c=u<=g?1:u>=g+26?26:u-g));u+=36)a>m(h/(l=36-c))&&b("overflow"),a*=l;g=A(v-i,e=p.length+1,0==i),m(v/e)>h-y&&b("overflow"),y+=m(v/e),v%=e,p.splice(v++,0,y)}return E(p)}function S(t){var e,r,n,o,i,a,u,s,c,l,f,p,d,v,y,w=[];for(p=(t=k(t)).length,e=128,r=0,i=72,a=0;a<p;++a)(f=t[a])<128&&w.push(g(f));for(n=o=w.length,o&&w.push("-");n<p;){for(u=h,a=0;a<p;++a)(f=t[a])>=e&&f<u&&(u=f);for(u-e>m((h-r)/(d=n+1))&&b("overflow"),r+=(u-e)*d,e=u,a=0;a<p;++a)if((f=t[a])<e&&++r>h&&b("overflow"),f==e){for(s=r,c=36;!(s<(l=c<=i?1:c>=i+26?26:c-i));c+=36)y=s-l,v=36-l,w.push(g(x(l+y%v,0))),s=m(y/v);w.push(g(x(s,0))),i=A(r,d,n==o),r=0,++n}++r,++e}return w.join("")}if(l={version:"1.3.2",ucs2:{decode:k,encode:E},decode:O,encode:S,toASCII:function(t){return _(t,(function(t){return d.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return _(t,(function(t){return p.test(t)?O(t.slice(4).toLowerCase()):t}))}},"object"==i(r(21))&&r(21))void 0===(o=function(){return l}.call(e,r,e,t))||(t.exports=o);else if(u&&s)if(t.exports==u)s.exports=l;else for(f in l)l.hasOwnProperty(f)&&(u[f]=l[f]);else a.punycode=l}(this)}).call(this,r(9)(t),r(8))},function(t,e,r){(function(t){var n,o;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
|
|
10
10
|
/*!
|
|
11
11
|
* URI.js - Mutating URLs
|
|
12
12
|
* IPv6 Support
|
|
@@ -32,7 +32,7 @@ var n=r(47),o=r(48),i=r(49);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647
|
|
|
32
32
|
* Licensed under
|
|
33
33
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
34
34
|
*
|
|
35
|
-
*/!function(a,u){"use strict";"object"===i(t)&&t.exports?t.exports=u():void 0===(o="function"==typeof(n=u)?n.call(e,r,e,t):n)||(t.exports=o)}(0,(function(t){"use strict";var e=t&&t.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return!1;var o=r.list[t.slice(e+1)];return!!o&&o.indexOf(" "+t.slice(n+1,e)+" ")>=0},is:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;if(t.lastIndexOf(".",e-1)>=0)return!1;var n=r.list[t.slice(e+1)];return!!n&&n.indexOf(" "+t.slice(0,e)+" ")>=0},get:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return null;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return null;var o=r.list[t.slice(e+1)];return o?o.indexOf(" "+t.slice(n+1,e)+" ")<0?null:t.slice(n+1):null},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return r}))}).call(this,r(9)(t))},function(t,e,r){"use strict";var n=r(7).rotr32;function o(t,e,r){return t&e^~t&r}function i(t,e,r){return t&e^t&r^e&r}function a(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?o(e,r,n):1===t||3===t?a(e,r,n):2===t?i(e,r,n):void 0},e.ch32=o,e.maj32=i,e.p32=a,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(7),o=r(13),i=r(31),a=r(12),u=n.sum32,s=n.sum32_4,c=n.sum32_5,l=i.ch32,f=i.maj32,h=i.s0_256,p=i.s1_256,d=i.g0_256,m=i.g1_256,v=o.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(g,v),t.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(m(r[n-2]),r[n-7],d(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],v=this.h[2],y=this.h[3],g=this.h[4],b=this.h[5],w=this.h[6],_=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var k=c(_,p(g),l(g,b,w),this.k[n],r[n]),E=u(h(o),f(o,i,v));_=w,w=b,b=g,g=u(y,k),y=v,v=i,i=o,o=u(k,E)}this.h[0]=u(this.h[0],o),this.h[1]=u(this.h[1],i),this.h[2]=u(this.h[2],v),this.h[3]=u(this.h[3],y),this.h[4]=u(this.h[4],g),this.h[5]=u(this.h[5],b),this.h[6]=u(this.h[6],w),this.h[7]=u(this.h[7],_)},g.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(7),o=r(13),i=r(12),a=n.rotr64_hi,u=n.rotr64_lo,s=n.shr64_hi,c=n.shr64_lo,l=n.sum64,f=n.sum64_hi,h=n.sum64_lo,p=n.sum64_4_hi,d=n.sum64_4_lo,m=n.sum64_5_hi,v=n.sum64_5_lo,y=o.BlockHash,g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(t,e,r,n,o){var i=t&r^~t&o;return i<0&&(i+=4294967296),i}function _(t,e,r,n,o,i){var a=e&n^~e&i;return a<0&&(a+=4294967296),a}function k(t,e,r,n,o){var i=t&r^t&o^r&o;return i<0&&(i+=4294967296),i}function E(t,e,r,n,o,i){var a=e&n^e&i^n&i;return a<0&&(a+=4294967296),a}function x(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=u(t,e,28)^u(e,t,2)^u(e,t,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function S(t,e){var r=u(t,e,14)^u(t,e,18)^u(e,t,9);return r<0&&(r+=4294967296),r}function P(t,e){var r=a(t,e,1)^a(t,e,8)^s(t,e,7);return r<0&&(r+=4294967296),r}function j(t,e){var r=u(t,e,1)^u(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,19)^a(e,t,29)^s(t,e,6);return r<0&&(r+=4294967296),r}function N(t,e){var r=u(t,e,19)^u(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(b,y),t.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var o=T(r[n-4],r[n-3]),i=N(r[n-4],r[n-3]),a=r[n-14],u=r[n-13],s=P(r[n-30],r[n-29]),c=j(r[n-30],r[n-29]),l=r[n-32],f=r[n-31];r[n]=p(o,i,a,u,s,c,l,f),r[n+1]=d(o,i,a,u,s,c,l,f)}},b.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],o=this.h[1],a=this.h[2],u=this.h[3],s=this.h[4],c=this.h[5],p=this.h[6],d=this.h[7],y=this.h[8],g=this.h[9],b=this.h[10],P=this.h[11],j=this.h[12],T=this.h[13],N=this.h[14],I=this.h[15];i(this.k.length===r.length);for(var R=0;R<r.length;R+=2){var L=N,C=I,M=O(y,g),B=S(y,g),F=w(y,g,b,P,j),D=_(y,g,b,P,j,T),U=this.k[R],z=this.k[R+1],G=r[R],H=r[R+1],q=m(L,C,M,B,F,D,U,z,G,H),K=v(L,C,M,B,F,D,U,z,G,H);L=x(n,o),C=A(n,o),M=k(n,o,a,u,s),B=E(n,o,a,u,s,c);var W=f(L,C,M,B),Q=h(L,C,M,B);N=j,I=T,j=b,T=P,b=y,P=g,y=f(p,d,q,K),g=h(d,d,q,K),p=s,d=c,s=a,c=u,a=n,u=o,n=f(q,K,W,Q),o=h(q,K,W,Q)}l(this.h,0,n,o),l(this.h,2,a,u),l(this.h,4,s,c),l(this.h,6,p,d),l(this.h,8,y,g),l(this.h,10,b,P),l(this.h,12,j,T),l(this.h,14,N,I)},b.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return H}));var n=r(2),o=r.n(n),i=r(4),a=r.n(i);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;function s(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var c=l;function l(t,e){if(!t)throw new Error(e||"Assertion failed")}l.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var f=s((function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var o=t.charCodeAt(n),i=o>>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(t,e){return"hex"===e?o(t):t}})),h=s((function(t,e){var r=e;r.assert=c,r.toArray=f.toArray,r.zero2=f.zero2,r.toHex=f.toHex,r.encode=f.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var o=1<<e+1,i=t.clone(),a=0;a<n.length;a++){var u,s=i.andln(o-1);i.isOdd()?(u=s>(o>>1)-1?(o>>1)-s:s,i.isubn(u)):u=0,n[a]=u,i.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,o=0,i=0;t.cmpn(-o)>0||e.cmpn(-i)>0;){var a,u,s=t.andln(3)+o&3,c=e.andln(3)+i&3;3===s&&(s=-1),3===c&&(c=-1),a=0==(1&s)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?s:-s,r[0].push(a),u=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==s?c:-c,r[1].push(u),2*o===a+1&&(o=1-o),2*i===u+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new o.a(t,"hex","le")}})),p=h.getNAF,d=h.getJSF,m=h.assert;function v(t,e){this.type=t,this.p=new o.a(e.p,16),this.red=e.prime?o.a.red(e.prime):o.a.mont(this.p),this.zero=new o.a(0).toRed(this.red),this.one=new o.a(1).toRed(this.red),this.two=new o.a(2).toRed(this.red),this.n=e.n&&new o.a(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var y=v;function g(t,e){this.curve=t,this.type=e,this.precomputed=null}v.prototype.point=function(){throw new Error("Not implemented")},v.prototype.validate=function(){throw new Error("Not implemented")},v.prototype._fixedNafMul=function(t,e){m(t.precomputed);var r=t._getDoubles(),n=p(e,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var i,a,u=[];for(i=0;i<n.length;i+=r.step){a=0;for(var s=i+r.step-1;s>=i;s--)a=(a<<1)+n[s];u.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=o;f>0;f--){for(i=0;i<u.length;i++)(a=u[i])===f?l=l.mixedAdd(r.points[i]):a===-f&&(l=l.mixedAdd(r.points[i].neg()));c=c.add(l)}return c.toP()},v.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var o=n.points,i=p(e,r,this._bitLength),a=this.jpoint(null,null,null),u=i.length-1;u>=0;u--){for(var s=0;u>=0&&0===i[u];u--)s++;if(u>=0&&s++,a=a.dblp(s),u<0)break;var c=i[u];m(0!==c),a="affine"===t.type?c>0?a.mixedAdd(o[c-1>>1]):a.mixedAdd(o[-c-1>>1].neg()):c>0?a.add(o[c-1>>1]):a.add(o[-c-1>>1].neg())}return"affine"===t.type?a.toP():a},v.prototype._wnafMulAdd=function(t,e,r,n,o){var i,a,u,s=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(i=0;i<n;i++){var h=(u=e[i])._getNAFPoints(t);s[i]=h.wnd,c[i]=h.points}for(i=n-1;i>=1;i-=2){var m=i-1,v=i;if(1===s[m]&&1===s[v]){var y=[e[m],null,null,e[v]];0===e[m].y.cmp(e[v].y)?(y[1]=e[m].add(e[v]),y[2]=e[m].toJ().mixedAdd(e[v].neg())):0===e[m].y.cmp(e[v].y.redNeg())?(y[1]=e[m].toJ().mixedAdd(e[v]),y[2]=e[m].add(e[v].neg())):(y[1]=e[m].toJ().mixedAdd(e[v]),y[2]=e[m].toJ().mixedAdd(e[v].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=d(r[m],r[v]);for(f=Math.max(b[0].length,f),l[m]=new Array(f),l[v]=new Array(f),a=0;a<f;a++){var w=0|b[0][a],_=0|b[1][a];l[m][a]=g[3*(w+1)+(_+1)],l[v][a]=0,c[m]=y}}else l[m]=p(r[m],s[m],this._bitLength),l[v]=p(r[v],s[v],this._bitLength),f=Math.max(l[m].length,f),f=Math.max(l[v].length,f)}var k=this.jpoint(null,null,null),E=this._wnafT4;for(i=f;i>=0;i--){for(var x=0;i>=0;){var A=!0;for(a=0;a<n;a++)E[a]=0|l[a][i],0!==E[a]&&(A=!1);if(!A)break;x++,i--}if(i>=0&&x++,k=k.dblp(x),i<0)break;for(a=0;a<n;a++){var O=E[a];0!==O&&(O>0?u=c[a][O-1>>1]:O<0&&(u=c[a][-O-1>>1].neg()),k="affine"===u.type?k.mixedAdd(u):k.add(u))}}for(i=0;i<n;i++)c[i]=null;return o?k:k.toP()},v.BasePoint=g,g.prototype.eq=function(){throw new Error("Not implemented")},g.prototype.validate=function(){return this.curve.validate(this)},v.prototype.decodePoint=function(t,e){t=h.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?m(t[t.length-1]%2==0):7===t[0]&&m(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},g.prototype.encodeCompressed=function(t){return this.encode(t,!0)},g.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},g.prototype.encode=function(t,e){return h.encode(this._encode(e),t)},g.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},g.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},g.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<e;o+=t){for(var i=0;i<t;i++)n=n.dbl();r.push(n)}return{step:t,points:r}},g.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)e[o]=e[o-1].add(n);return{wnd:t,points:e}},g.prototype._getBeta=function(){return null},g.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var b=s((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}})),w=h.assert;function _(t){y.call(this,"short",t),this.a=new o.a(t.a,16).toRed(this.red),this.b=new o.a(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}b(_,y);var k=_;function E(t,e,r,n){y.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o.a(e,16),this.y=new o.a(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function x(t,e,r,n){y.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o.a(0)):(this.x=new o.a(e,16),this.y=new o.a(r,16),this.z=new o.a(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}_.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new o.a(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new o.a(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],w(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new o.a(t.a,16),b:new o.a(t.b,16)}})):this._getEndoBasis(r)}}},_.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:o.a.mont(t),r=new o.a(2).toRed(e).redInvm(),n=r.redNeg(),i=new o.a(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},_.prototype._getEndoBasis=function(t){for(var e,r,n,i,a,u,s,c,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,p=this.n.clone(),d=new o.a(1),m=new o.a(0),v=new o.a(0),y=new o.a(1),g=0;0!==h.cmpn(0);){var b=p.div(h);c=p.sub(b.mul(h)),l=v.sub(b.mul(d));var w=y.sub(b.mul(m));if(!n&&c.cmp(f)<0)e=s.neg(),r=d,n=c.neg(),i=l;else if(n&&2==++g)break;s=c,p=h,h=c,v=d,d=l,y=m,m=w}a=c.neg(),u=l;var _=n.sqr().add(i.sqr());return a.sqr().add(u.sqr()).cmp(_)>=0&&(a=e,u=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),u=u.neg()),[{a:n,b:i},{a:a,b:u}]},_.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],o=n.b.mul(t).divRound(this.n),i=r.b.neg().mul(t).divRound(this.n),a=o.mul(r.a),u=i.mul(n.a),s=o.mul(r.b),c=i.mul(n.b);return{k1:t.sub(a).sub(u),k2:s.add(c).neg()}},_.prototype.pointFromX=function(t,e){(t=new o.a(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},_.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),o=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},_.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<t.length;i++){var a=this._endoSplit(e[i]),u=t[i],s=u._getBeta();a.k1.negative&&(a.k1.ineg(),u=u.neg(!0)),a.k2.negative&&(a.k2.ineg(),s=s.neg(!0)),n[2*i]=u,n[2*i+1]=s,o[2*i]=a.k1,o[2*i+1]=a.k2}for(var c=this._wnafMulAdd(1,n,o,2*i,r),l=0;l<2*i;l++)n[l]=null,o[l]=null;return c},b(E,y.BasePoint),_.prototype.point=function(t,e,r){return new E(this,t,e,r)},_.prototype.pointFromJSON=function(t,e){return E.fromJSON(this,t,e)},E.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},E.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},E.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function o(e){return t.point(e[0],e[1],r)}var i=e[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},E.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},E.prototype.isInfinity=function(){return this.inf},E.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},E.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},E.prototype.getX=function(){return this.x.fromRed()},E.prototype.getY=function(){return this.y.fromRed()},E.prototype.mul=function(t){return t=new o.a(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},E.prototype.mulAdd=function(t,e,r){var n=[this,e],o=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},E.prototype.jmulAdd=function(t,e,r){var n=[this,e],o=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},E.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},E.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},E.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},b(x,y.BasePoint),_.prototype.jpoint=function(t,e,r){return new x(this,t,e,r)},x.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},x.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},x.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),o=t.x.redMul(r),i=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),u=n.redSub(o),s=i.redSub(a);if(0===u.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=u.redSqr(),l=c.redMul(u),f=n.redMul(c),h=s.redSqr().redIAdd(l).redISub(f).redISub(f),p=s.redMul(f.redISub(h)).redISub(i.redMul(l)),d=this.z.redMul(t.z).redMul(u);return this.curve.jpoint(h,p,d)},x.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),o=this.y,i=t.y.redMul(e).redMul(this.z),a=r.redSub(n),u=o.redSub(i);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),c=s.redMul(a),l=r.redMul(s),f=u.redSqr().redIAdd(c).redISub(l).redISub(l),h=u.redMul(l.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(a);return this.curve.jpoint(f,h,p)},x.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,a=this.y,u=this.z,s=u.redSqr().redSqr(),c=a.redAdd(a);for(e=0;e<t;e++){var l=i.redSqr(),f=c.redSqr(),h=f.redSqr(),p=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(s)),d=i.redMul(f),m=p.redSqr().redISub(d.redAdd(d)),v=d.redISub(m),y=p.redMul(v);y=y.redIAdd(y).redISub(h);var g=c.redMul(u);e+1<t&&(s=s.redMul(h)),i=m,u=g,c=y}return this.curve.jpoint(i,c.redMul(o),u)},x.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},x.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var u=n.redAdd(n).redIAdd(n),s=u.redSqr().redISub(a).redISub(a),c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),t=s,e=u.redMul(a.redISub(s)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),p=this.x.redAdd(f).redSqr().redISub(l).redISub(h);p=p.redIAdd(p);var d=l.redAdd(l).redIAdd(l),m=d.redSqr(),v=h.redIAdd(h);v=(v=v.redIAdd(v)).redIAdd(v),t=m.redISub(p).redISub(p),e=d.redMul(p.redISub(t)).redISub(v),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},x.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var u=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=u.redSqr().redISub(a).redISub(a);t=s;var c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),e=u.redMul(a.redISub(s)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),p=this.x.redSub(l).redMul(this.x.redAdd(l));p=p.redAdd(p).redIAdd(p);var d=h.redIAdd(h),m=(d=d.redIAdd(d)).redAdd(d);t=p.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var v=f.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),e=p.redMul(d.redISub(t)).redISub(v)}return this.curve.jpoint(t,e,r)},x.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=e.redSqr(),a=r.redSqr(),u=i.redAdd(i).redIAdd(i).redIAdd(t.redMul(o)),s=e.redAdd(e),c=(s=s.redIAdd(s)).redMul(a),l=u.redSqr().redISub(c.redAdd(c)),f=c.redISub(l),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=u.redMul(f).redISub(h),d=r.redAdd(r).redMul(n);return this.curve.jpoint(l,p,d)},x.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),o=t.redAdd(t).redIAdd(t),i=o.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(n),u=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(i)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var c=o.redIAdd(a).redSqr().redISub(i).redISub(u).redISub(s),l=e.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(u).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.y.redMul(c.redMul(s.redISub(c)).redISub(a.redMul(u)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=this.z.redAdd(a).redSqr().redISub(r).redISub(u);return this.curve.jpoint(f,h,p)},x.prototype.mul=function(t,e){return t=new o.a(t,e),this.curve._wnafMul(this,t)},x.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),o=r.redMul(t.z);return 0===this.y.redMul(o).redISub(t.y.redMul(n)).cmpn(0)},x.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),o=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},x.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},x.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var A=s((function(t,e){var r=e;r.base=y,r.short=k,r.mont=null,r.edwards=null})),O=s((function(t,e){var r,n=e,o=h.assert;function i(t){"short"===t.type?this.curve=new A.short(t):"edwards"===t.type?this.curve=new A.edwards(t):this.curve=new A.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new i(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(t){r=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function S(t){if(!(this instanceof S))return new S(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=f.toArray(t.entropy,t.entropyEnc||"hex"),r=f.toArray(t.nonce,t.nonceEnc||"hex"),n=f.toArray(t.pers,t.persEnc||"hex");c(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var P=S;S.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},S.prototype._hmac=function(){return new a.a.hmac(this.hash,this.K)},S.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},S.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=f.toArray(t,e),r=f.toArray(r,n),c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},S.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=f.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var i=o.slice(0,t);return this._update(r),this._reseed++,f.encode(i,e)};var j=h.assert;function T(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var N=T;T.fromPublic=function(t,e,r){return e instanceof T?e:new T(t,{pub:e,pubEnc:r})},T.fromPrivate=function(t,e,r){return e instanceof T?e:new T(t,{priv:e,privEnc:r})},T.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},T.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},T.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},T.prototype._importPrivate=function(t,e){this.priv=new o.a(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},T.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?j(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||j(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},T.prototype.derive=function(t){return t.validate()||j(t.validate(),"public point not validated"),t.mul(this.priv).getX()},T.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},T.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},T.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var I=h.assert;function R(t,e){if(t instanceof R)return t;this._importDER(t,e)||(I(t.r&&t.s,"Signature without r or s"),this.r=new o.a(t.r,16),this.s=new o.a(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var L=R;function C(){this.place=0}function M(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,a=e.place;i<n;i++,a++)o<<=8,o|=t[a],o>>>=0;return!(o<=127)&&(e.place=a,o)}function B(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function F(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}R.prototype._importDER=function(t,e){t=h.toArray(t,e);var r=new C;if(48!==t[r.place++])return!1;var n=M(t,r);if(!1===n)return!1;if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var i=M(t,r);if(!1===i)return!1;var a=t.slice(r.place,i+r.place);if(r.place+=i,2!==t[r.place++])return!1;var u=M(t,r);if(!1===u)return!1;if(t.length!==u+r.place)return!1;var s=t.slice(r.place,u+r.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new o.a(a),this.s=new o.a(s),this.recoveryParam=null,!0},R.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=B(e),r=B(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];F(n,e.length),(n=n.concat(e)).push(2),F(n,r.length);var o=n.concat(r),i=[48];return F(i,o.length),i=i.concat(o),h.encode(i,t)};var D=function(){throw new Error("unsupported")},U=h.assert;function z(t){if(!(this instanceof z))return new z(t);"string"==typeof t&&(U(Object.prototype.hasOwnProperty.call(O,t),"Unknown curve "+t),t=O[t]),t instanceof O.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var G=z;z.prototype.keyPair=function(t){return new N(this,t)},z.prototype.keyFromPrivate=function(t,e){return N.fromPrivate(this,t,e)},z.prototype.keyFromPublic=function(t,e){return N.fromPublic(this,t,e)},z.prototype.genKeyPair=function(t){t||(t={});for(var e=new P({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||D(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new o.a(2));;){var i=new o.a(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},z.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},z.prototype.sign=function(t,e,r,n){"object"===u(r)&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new o.a(t,16));for(var i=this.n.byteLength(),a=e.getPrivate().toArray("be",i),s=t.toArray("be",i),c=new P({hash:this.hash,entropy:a,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new o.a(1)),f=0;;f++){var h=n.k?n.k(f):new o.a(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var d=p.getX(),m=d.umod(this.n);if(0!==m.cmpn(0)){var v=h.invm(this.n).mul(m.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==d.cmp(m)?2:0);return n.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new L({r:m,s:v,recoveryParam:y})}}}}}},z.prototype.verify=function(t,e,r,n){t=this._truncateToN(new o.a(t,16)),r=this.keyFromPublic(r,n);var i=(e=new L(e,"hex")).r,a=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var u,s=a.invm(this.n),c=s.mul(t).umod(this.n),l=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&u.eqXToP(i):!(u=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===u.getX().umod(this.n).cmp(i)},z.prototype.recoverPubKey=function(t,e,r,n){U((3&r)===r,"The recovery param is more than two bits"),e=new L(e,n);var i=this.n,a=new o.a(t),u=e.r,s=e.s,c=1&r,l=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");u=l?this.curve.pointFromX(u.add(this.curve.n),c):this.curve.pointFromX(u,c);var f=e.r.invm(i),h=i.sub(a).mul(f).umod(i),p=s.mul(f).umod(i);return this.g.mulAdd(h,u,p)},z.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new L(e,n)).recoveryParam)return e.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(t,e,o)}catch(t){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var H=s((function(t,e){var r=e;r.version="6.5.4",r.utils=h,r.rand=function(){throw new Error("unsupported")},r.curve=A,r.curves=O,r.ec=G,r.eddsa=null})).ec}).call(this,r(8))},function(t,e,r){(function(t,n,o){var i;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
|
|
35
|
+
*/!function(a,u){"use strict";"object"===i(t)&&t.exports?t.exports=u():void 0===(o="function"==typeof(n=u)?n.call(e,r,e,t):n)||(t.exports=o)}(0,(function(t){"use strict";var e=t&&t.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return!1;var o=r.list[t.slice(e+1)];return!!o&&o.indexOf(" "+t.slice(n+1,e)+" ")>=0},is:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;if(t.lastIndexOf(".",e-1)>=0)return!1;var n=r.list[t.slice(e+1)];return!!n&&n.indexOf(" "+t.slice(0,e)+" ")>=0},get:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return null;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return null;var o=r.list[t.slice(e+1)];return o?o.indexOf(" "+t.slice(n+1,e)+" ")<0?null:t.slice(n+1):null},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return r}))}).call(this,r(9)(t))},function(t,e,r){"use strict";var n=r(7).rotr32;function o(t,e,r){return t&e^~t&r}function i(t,e,r){return t&e^t&r^e&r}function a(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?o(e,r,n):1===t||3===t?a(e,r,n):2===t?i(e,r,n):void 0},e.ch32=o,e.maj32=i,e.p32=a,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(7),o=r(13),i=r(31),a=r(12),u=n.sum32,s=n.sum32_4,c=n.sum32_5,l=i.ch32,f=i.maj32,h=i.s0_256,p=i.s1_256,d=i.g0_256,v=i.g1_256,y=o.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(g,y),t.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(v(r[n-2]),r[n-7],d(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],y=this.h[2],m=this.h[3],g=this.h[4],b=this.h[5],w=this.h[6],_=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var k=c(_,p(g),l(g,b,w),this.k[n],r[n]),E=u(h(o),f(o,i,y));_=w,w=b,b=g,g=u(m,k),m=y,y=i,i=o,o=u(k,E)}this.h[0]=u(this.h[0],o),this.h[1]=u(this.h[1],i),this.h[2]=u(this.h[2],y),this.h[3]=u(this.h[3],m),this.h[4]=u(this.h[4],g),this.h[5]=u(this.h[5],b),this.h[6]=u(this.h[6],w),this.h[7]=u(this.h[7],_)},g.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(7),o=r(13),i=r(12),a=n.rotr64_hi,u=n.rotr64_lo,s=n.shr64_hi,c=n.shr64_lo,l=n.sum64,f=n.sum64_hi,h=n.sum64_lo,p=n.sum64_4_hi,d=n.sum64_4_lo,v=n.sum64_5_hi,y=n.sum64_5_lo,m=o.BlockHash,g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(t,e,r,n,o){var i=t&r^~t&o;return i<0&&(i+=4294967296),i}function _(t,e,r,n,o,i){var a=e&n^~e&i;return a<0&&(a+=4294967296),a}function k(t,e,r,n,o){var i=t&r^t&o^r&o;return i<0&&(i+=4294967296),i}function E(t,e,r,n,o,i){var a=e&n^e&i^n&i;return a<0&&(a+=4294967296),a}function x(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=u(t,e,28)^u(e,t,2)^u(e,t,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function S(t,e){var r=u(t,e,14)^u(t,e,18)^u(e,t,9);return r<0&&(r+=4294967296),r}function P(t,e){var r=a(t,e,1)^a(t,e,8)^s(t,e,7);return r<0&&(r+=4294967296),r}function j(t,e){var r=u(t,e,1)^u(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,19)^a(e,t,29)^s(t,e,6);return r<0&&(r+=4294967296),r}function R(t,e){var r=u(t,e,19)^u(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(b,m),t.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var o=T(r[n-4],r[n-3]),i=R(r[n-4],r[n-3]),a=r[n-14],u=r[n-13],s=P(r[n-30],r[n-29]),c=j(r[n-30],r[n-29]),l=r[n-32],f=r[n-31];r[n]=p(o,i,a,u,s,c,l,f),r[n+1]=d(o,i,a,u,s,c,l,f)}},b.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],o=this.h[1],a=this.h[2],u=this.h[3],s=this.h[4],c=this.h[5],p=this.h[6],d=this.h[7],m=this.h[8],g=this.h[9],b=this.h[10],P=this.h[11],j=this.h[12],T=this.h[13],R=this.h[14],N=this.h[15];i(this.k.length===r.length);for(var I=0;I<r.length;I+=2){var L=R,C=N,M=O(m,g),B=S(m,g),F=w(m,g,b,P,j),D=_(m,g,b,P,j,T),U=this.k[I],z=this.k[I+1],G=r[I],H=r[I+1],q=v(L,C,M,B,F,D,U,z,G,H),K=y(L,C,M,B,F,D,U,z,G,H);L=x(n,o),C=A(n,o),M=k(n,o,a,u,s),B=E(n,o,a,u,s,c);var W=f(L,C,M,B),Q=h(L,C,M,B);R=j,N=T,j=b,T=P,b=m,P=g,m=f(p,d,q,K),g=h(d,d,q,K),p=s,d=c,s=a,c=u,a=n,u=o,n=f(q,K,W,Q),o=h(q,K,W,Q)}l(this.h,0,n,o),l(this.h,2,a,u),l(this.h,4,s,c),l(this.h,6,p,d),l(this.h,8,m,g),l(this.h,10,b,P),l(this.h,12,j,T),l(this.h,14,R,N)},b.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return H}));var n=r(2),o=r.n(n),i=r(4),a=r.n(i);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;function s(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var c=l;function l(t,e){if(!t)throw new Error(e||"Assertion failed")}l.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var f=s((function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var o=t.charCodeAt(n),i=o>>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(t,e){return"hex"===e?o(t):t}})),h=s((function(t,e){var r=e;r.assert=c,r.toArray=f.toArray,r.zero2=f.zero2,r.toHex=f.toHex,r.encode=f.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var o=1<<e+1,i=t.clone(),a=0;a<n.length;a++){var u,s=i.andln(o-1);i.isOdd()?(u=s>(o>>1)-1?(o>>1)-s:s,i.isubn(u)):u=0,n[a]=u,i.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,o=0,i=0;t.cmpn(-o)>0||e.cmpn(-i)>0;){var a,u,s=t.andln(3)+o&3,c=e.andln(3)+i&3;3===s&&(s=-1),3===c&&(c=-1),a=0==(1&s)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?s:-s,r[0].push(a),u=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==s?c:-c,r[1].push(u),2*o===a+1&&(o=1-o),2*i===u+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new o.a(t,"hex","le")}})),p=h.getNAF,d=h.getJSF,v=h.assert;function y(t,e){this.type=t,this.p=new o.a(e.p,16),this.red=e.prime?o.a.red(e.prime):o.a.mont(this.p),this.zero=new o.a(0).toRed(this.red),this.one=new o.a(1).toRed(this.red),this.two=new o.a(2).toRed(this.red),this.n=e.n&&new o.a(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var m=y;function g(t,e){this.curve=t,this.type=e,this.precomputed=null}y.prototype.point=function(){throw new Error("Not implemented")},y.prototype.validate=function(){throw new Error("Not implemented")},y.prototype._fixedNafMul=function(t,e){v(t.precomputed);var r=t._getDoubles(),n=p(e,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var i,a,u=[];for(i=0;i<n.length;i+=r.step){a=0;for(var s=i+r.step-1;s>=i;s--)a=(a<<1)+n[s];u.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=o;f>0;f--){for(i=0;i<u.length;i++)(a=u[i])===f?l=l.mixedAdd(r.points[i]):a===-f&&(l=l.mixedAdd(r.points[i].neg()));c=c.add(l)}return c.toP()},y.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var o=n.points,i=p(e,r,this._bitLength),a=this.jpoint(null,null,null),u=i.length-1;u>=0;u--){for(var s=0;u>=0&&0===i[u];u--)s++;if(u>=0&&s++,a=a.dblp(s),u<0)break;var c=i[u];v(0!==c),a="affine"===t.type?c>0?a.mixedAdd(o[c-1>>1]):a.mixedAdd(o[-c-1>>1].neg()):c>0?a.add(o[c-1>>1]):a.add(o[-c-1>>1].neg())}return"affine"===t.type?a.toP():a},y.prototype._wnafMulAdd=function(t,e,r,n,o){var i,a,u,s=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(i=0;i<n;i++){var h=(u=e[i])._getNAFPoints(t);s[i]=h.wnd,c[i]=h.points}for(i=n-1;i>=1;i-=2){var v=i-1,y=i;if(1===s[v]&&1===s[y]){var m=[e[v],null,null,e[y]];0===e[v].y.cmp(e[y].y)?(m[1]=e[v].add(e[y]),m[2]=e[v].toJ().mixedAdd(e[y].neg())):0===e[v].y.cmp(e[y].y.redNeg())?(m[1]=e[v].toJ().mixedAdd(e[y]),m[2]=e[v].add(e[y].neg())):(m[1]=e[v].toJ().mixedAdd(e[y]),m[2]=e[v].toJ().mixedAdd(e[y].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=d(r[v],r[y]);for(f=Math.max(b[0].length,f),l[v]=new Array(f),l[y]=new Array(f),a=0;a<f;a++){var w=0|b[0][a],_=0|b[1][a];l[v][a]=g[3*(w+1)+(_+1)],l[y][a]=0,c[v]=m}}else l[v]=p(r[v],s[v],this._bitLength),l[y]=p(r[y],s[y],this._bitLength),f=Math.max(l[v].length,f),f=Math.max(l[y].length,f)}var k=this.jpoint(null,null,null),E=this._wnafT4;for(i=f;i>=0;i--){for(var x=0;i>=0;){var A=!0;for(a=0;a<n;a++)E[a]=0|l[a][i],0!==E[a]&&(A=!1);if(!A)break;x++,i--}if(i>=0&&x++,k=k.dblp(x),i<0)break;for(a=0;a<n;a++){var O=E[a];0!==O&&(O>0?u=c[a][O-1>>1]:O<0&&(u=c[a][-O-1>>1].neg()),k="affine"===u.type?k.mixedAdd(u):k.add(u))}}for(i=0;i<n;i++)c[i]=null;return o?k:k.toP()},y.BasePoint=g,g.prototype.eq=function(){throw new Error("Not implemented")},g.prototype.validate=function(){return this.curve.validate(this)},y.prototype.decodePoint=function(t,e){t=h.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?v(t[t.length-1]%2==0):7===t[0]&&v(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},g.prototype.encodeCompressed=function(t){return this.encode(t,!0)},g.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},g.prototype.encode=function(t,e){return h.encode(this._encode(e),t)},g.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},g.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},g.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<e;o+=t){for(var i=0;i<t;i++)n=n.dbl();r.push(n)}return{step:t,points:r}},g.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)e[o]=e[o-1].add(n);return{wnd:t,points:e}},g.prototype._getBeta=function(){return null},g.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var b=s((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}})),w=h.assert;function _(t){m.call(this,"short",t),this.a=new o.a(t.a,16).toRed(this.red),this.b=new o.a(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}b(_,m);var k=_;function E(t,e,r,n){m.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o.a(e,16),this.y=new o.a(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function x(t,e,r,n){m.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o.a(0)):(this.x=new o.a(e,16),this.y=new o.a(r,16),this.z=new o.a(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}_.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new o.a(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new o.a(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],w(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new o.a(t.a,16),b:new o.a(t.b,16)}})):this._getEndoBasis(r)}}},_.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:o.a.mont(t),r=new o.a(2).toRed(e).redInvm(),n=r.redNeg(),i=new o.a(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},_.prototype._getEndoBasis=function(t){for(var e,r,n,i,a,u,s,c,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,p=this.n.clone(),d=new o.a(1),v=new o.a(0),y=new o.a(0),m=new o.a(1),g=0;0!==h.cmpn(0);){var b=p.div(h);c=p.sub(b.mul(h)),l=y.sub(b.mul(d));var w=m.sub(b.mul(v));if(!n&&c.cmp(f)<0)e=s.neg(),r=d,n=c.neg(),i=l;else if(n&&2==++g)break;s=c,p=h,h=c,y=d,d=l,m=v,v=w}a=c.neg(),u=l;var _=n.sqr().add(i.sqr());return a.sqr().add(u.sqr()).cmp(_)>=0&&(a=e,u=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),u=u.neg()),[{a:n,b:i},{a:a,b:u}]},_.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],o=n.b.mul(t).divRound(this.n),i=r.b.neg().mul(t).divRound(this.n),a=o.mul(r.a),u=i.mul(n.a),s=o.mul(r.b),c=i.mul(n.b);return{k1:t.sub(a).sub(u),k2:s.add(c).neg()}},_.prototype.pointFromX=function(t,e){(t=new o.a(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},_.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),o=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},_.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<t.length;i++){var a=this._endoSplit(e[i]),u=t[i],s=u._getBeta();a.k1.negative&&(a.k1.ineg(),u=u.neg(!0)),a.k2.negative&&(a.k2.ineg(),s=s.neg(!0)),n[2*i]=u,n[2*i+1]=s,o[2*i]=a.k1,o[2*i+1]=a.k2}for(var c=this._wnafMulAdd(1,n,o,2*i,r),l=0;l<2*i;l++)n[l]=null,o[l]=null;return c},b(E,m.BasePoint),_.prototype.point=function(t,e,r){return new E(this,t,e,r)},_.prototype.pointFromJSON=function(t,e){return E.fromJSON(this,t,e)},E.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},E.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},E.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function o(e){return t.point(e[0],e[1],r)}var i=e[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},E.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},E.prototype.isInfinity=function(){return this.inf},E.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},E.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},E.prototype.getX=function(){return this.x.fromRed()},E.prototype.getY=function(){return this.y.fromRed()},E.prototype.mul=function(t){return t=new o.a(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},E.prototype.mulAdd=function(t,e,r){var n=[this,e],o=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},E.prototype.jmulAdd=function(t,e,r){var n=[this,e],o=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},E.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},E.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},E.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},b(x,m.BasePoint),_.prototype.jpoint=function(t,e,r){return new x(this,t,e,r)},x.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},x.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},x.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),o=t.x.redMul(r),i=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),u=n.redSub(o),s=i.redSub(a);if(0===u.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=u.redSqr(),l=c.redMul(u),f=n.redMul(c),h=s.redSqr().redIAdd(l).redISub(f).redISub(f),p=s.redMul(f.redISub(h)).redISub(i.redMul(l)),d=this.z.redMul(t.z).redMul(u);return this.curve.jpoint(h,p,d)},x.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),o=this.y,i=t.y.redMul(e).redMul(this.z),a=r.redSub(n),u=o.redSub(i);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),c=s.redMul(a),l=r.redMul(s),f=u.redSqr().redIAdd(c).redISub(l).redISub(l),h=u.redMul(l.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(a);return this.curve.jpoint(f,h,p)},x.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,a=this.y,u=this.z,s=u.redSqr().redSqr(),c=a.redAdd(a);for(e=0;e<t;e++){var l=i.redSqr(),f=c.redSqr(),h=f.redSqr(),p=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(s)),d=i.redMul(f),v=p.redSqr().redISub(d.redAdd(d)),y=d.redISub(v),m=p.redMul(y);m=m.redIAdd(m).redISub(h);var g=c.redMul(u);e+1<t&&(s=s.redMul(h)),i=v,u=g,c=m}return this.curve.jpoint(i,c.redMul(o),u)},x.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},x.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var u=n.redAdd(n).redIAdd(n),s=u.redSqr().redISub(a).redISub(a),c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),t=s,e=u.redMul(a.redISub(s)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),p=this.x.redAdd(f).redSqr().redISub(l).redISub(h);p=p.redIAdd(p);var d=l.redAdd(l).redIAdd(l),v=d.redSqr(),y=h.redIAdd(h);y=(y=y.redIAdd(y)).redIAdd(y),t=v.redISub(p).redISub(p),e=d.redMul(p.redISub(t)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},x.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var u=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=u.redSqr().redISub(a).redISub(a);t=s;var c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),e=u.redMul(a.redISub(s)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),p=this.x.redSub(l).redMul(this.x.redAdd(l));p=p.redAdd(p).redIAdd(p);var d=h.redIAdd(h),v=(d=d.redIAdd(d)).redAdd(d);t=p.redSqr().redISub(v),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var y=f.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),e=p.redMul(d.redISub(t)).redISub(y)}return this.curve.jpoint(t,e,r)},x.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=e.redSqr(),a=r.redSqr(),u=i.redAdd(i).redIAdd(i).redIAdd(t.redMul(o)),s=e.redAdd(e),c=(s=s.redIAdd(s)).redMul(a),l=u.redSqr().redISub(c.redAdd(c)),f=c.redISub(l),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=u.redMul(f).redISub(h),d=r.redAdd(r).redMul(n);return this.curve.jpoint(l,p,d)},x.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),o=t.redAdd(t).redIAdd(t),i=o.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(n),u=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(i)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var c=o.redIAdd(a).redSqr().redISub(i).redISub(u).redISub(s),l=e.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(u).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.y.redMul(c.redMul(s.redISub(c)).redISub(a.redMul(u)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=this.z.redAdd(a).redSqr().redISub(r).redISub(u);return this.curve.jpoint(f,h,p)},x.prototype.mul=function(t,e){return t=new o.a(t,e),this.curve._wnafMul(this,t)},x.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),o=r.redMul(t.z);return 0===this.y.redMul(o).redISub(t.y.redMul(n)).cmpn(0)},x.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),o=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},x.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},x.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var A=s((function(t,e){var r=e;r.base=m,r.short=k,r.mont=null,r.edwards=null})),O=s((function(t,e){var r,n=e,o=h.assert;function i(t){"short"===t.type?this.curve=new A.short(t):"edwards"===t.type?this.curve=new A.edwards(t):this.curve=new A.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new i(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(t){r=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function S(t){if(!(this instanceof S))return new S(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=f.toArray(t.entropy,t.entropyEnc||"hex"),r=f.toArray(t.nonce,t.nonceEnc||"hex"),n=f.toArray(t.pers,t.persEnc||"hex");c(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var P=S;S.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},S.prototype._hmac=function(){return new a.a.hmac(this.hash,this.K)},S.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},S.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=f.toArray(t,e),r=f.toArray(r,n),c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},S.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=f.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var i=o.slice(0,t);return this._update(r),this._reseed++,f.encode(i,e)};var j=h.assert;function T(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var R=T;T.fromPublic=function(t,e,r){return e instanceof T?e:new T(t,{pub:e,pubEnc:r})},T.fromPrivate=function(t,e,r){return e instanceof T?e:new T(t,{priv:e,privEnc:r})},T.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},T.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},T.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},T.prototype._importPrivate=function(t,e){this.priv=new o.a(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},T.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?j(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||j(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},T.prototype.derive=function(t){return t.validate()||j(t.validate(),"public point not validated"),t.mul(this.priv).getX()},T.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},T.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},T.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var N=h.assert;function I(t,e){if(t instanceof I)return t;this._importDER(t,e)||(N(t.r&&t.s,"Signature without r or s"),this.r=new o.a(t.r,16),this.s=new o.a(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var L=I;function C(){this.place=0}function M(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,a=e.place;i<n;i++,a++)o<<=8,o|=t[a],o>>>=0;return!(o<=127)&&(e.place=a,o)}function B(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function F(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}I.prototype._importDER=function(t,e){t=h.toArray(t,e);var r=new C;if(48!==t[r.place++])return!1;var n=M(t,r);if(!1===n)return!1;if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var i=M(t,r);if(!1===i)return!1;var a=t.slice(r.place,i+r.place);if(r.place+=i,2!==t[r.place++])return!1;var u=M(t,r);if(!1===u)return!1;if(t.length!==u+r.place)return!1;var s=t.slice(r.place,u+r.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new o.a(a),this.s=new o.a(s),this.recoveryParam=null,!0},I.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=B(e),r=B(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];F(n,e.length),(n=n.concat(e)).push(2),F(n,r.length);var o=n.concat(r),i=[48];return F(i,o.length),i=i.concat(o),h.encode(i,t)};var D=function(){throw new Error("unsupported")},U=h.assert;function z(t){if(!(this instanceof z))return new z(t);"string"==typeof t&&(U(Object.prototype.hasOwnProperty.call(O,t),"Unknown curve "+t),t=O[t]),t instanceof O.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var G=z;z.prototype.keyPair=function(t){return new R(this,t)},z.prototype.keyFromPrivate=function(t,e){return R.fromPrivate(this,t,e)},z.prototype.keyFromPublic=function(t,e){return R.fromPublic(this,t,e)},z.prototype.genKeyPair=function(t){t||(t={});for(var e=new P({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||D(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new o.a(2));;){var i=new o.a(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},z.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},z.prototype.sign=function(t,e,r,n){"object"===u(r)&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new o.a(t,16));for(var i=this.n.byteLength(),a=e.getPrivate().toArray("be",i),s=t.toArray("be",i),c=new P({hash:this.hash,entropy:a,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new o.a(1)),f=0;;f++){var h=n.k?n.k(f):new o.a(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var d=p.getX(),v=d.umod(this.n);if(0!==v.cmpn(0)){var y=h.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==d.cmp(v)?2:0);return n.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),m^=1),new L({r:v,s:y,recoveryParam:m})}}}}}},z.prototype.verify=function(t,e,r,n){t=this._truncateToN(new o.a(t,16)),r=this.keyFromPublic(r,n);var i=(e=new L(e,"hex")).r,a=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var u,s=a.invm(this.n),c=s.mul(t).umod(this.n),l=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&u.eqXToP(i):!(u=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===u.getX().umod(this.n).cmp(i)},z.prototype.recoverPubKey=function(t,e,r,n){U((3&r)===r,"The recovery param is more than two bits"),e=new L(e,n);var i=this.n,a=new o.a(t),u=e.r,s=e.s,c=1&r,l=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");u=l?this.curve.pointFromX(u.add(this.curve.n),c):this.curve.pointFromX(u,c);var f=e.r.invm(i),h=i.sub(a).mul(f).umod(i),p=s.mul(f).umod(i);return this.g.mulAdd(h,u,p)},z.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new L(e,n)).recoveryParam)return e.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(t,e,o)}catch(t){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var H=s((function(t,e){var r=e;r.version="6.5.4",r.utils=h,r.rand=function(){throw new Error("unsupported")},r.curve=A,r.curves=O,r.ec=G,r.eddsa=null})).ec}).call(this,r(8))},function(t,e,r){(function(t,n,o){var i;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
|
|
36
36
|
/**
|
|
37
37
|
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
38
38
|
*
|
|
@@ -40,12 +40,12 @@ var n=r(47),o=r(48),i=r(49);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647
|
|
|
40
40
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
41
41
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
42
42
|
* @license MIT
|
|
43
|
-
*/!function(){"use strict";var u="input is invalid type",s="object"===("undefined"==typeof window?"undefined":a(window)),c=s?window:{};c.JS_SHA3_NO_WINDOW&&(s=!1);var l=!s&&"object"===("undefined"==typeof self?"undefined":a(self));!c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===t?"undefined":a(t))&&t.versions&&t.versions.node?c=n:l&&(c=self);var f=!c.JS_SHA3_NO_COMMON_JS&&"object"===a(o)&&o.exports,h=r(21),p=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),m=[4,1024,262144,67108864],v=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],g=[224,256,384,512],b=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],_={128:168,256:136};!c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!p||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"===a(t)&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var k=function(t,e,r){return function(n){return new B(t,e,t).update(n)[r]()}},E=function(t,e,r){return function(n,o){return new B(t,e,o).update(n)[r]()}},x=function(t,e,r){return function(e,n,o,i){return j["cshake"+t].update(e,n,o,i)[r]()}},A=function(t,e,r){return function(e,n,o,i){return j["kmac"+t].update(e,n,o,i)[r]()}},O=function(t,e,r,n){for(var o=0;o<w.length;++o){var i=w[o];t[i]=e(r,n,i)}return t},S=function(t,e){var r=k(t,e,"hex");return r.create=function(){return new B(t,e,t)},r.update=function(t){return r.create().update(t)},O(r,k,t,e)},P=[{name:"keccak",padding:[1,256,65536,16777216],bits:g,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:g,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:b,createMethod:function(t,e){var r=E(t,e,"hex");return r.create=function(r){return new B(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},O(r,E,t,e)}},{name:"cshake",padding:m,bits:b,createMethod:function(t,e){var r=_[t],n=x(t,0,"hex");return n.create=function(n,o,i){return o||i?new B(t,e,n).bytepad([o,i],r):j["shake"+t].create(n)},n.update=function(t,e,r,o){return n.create(e,r,o).update(t)},O(n,x,t,e)}},{name:"kmac",padding:m,bits:b,createMethod:function(t,e){var r=_[t],n=A(t,0,"hex");return n.create=function(n,o,i){return new F(t,e,o).bytepad(["KMAC",i],r).bytepad([n],r)},n.update=function(t,e,r,o){return n.create(t,r,o).update(e)},O(n,A,t,e)}}],j={},T=[],N=0;N<P.length;++N)for(var I=P[N],R=I.bits,L=0;L<R.length;++L){var C=I.name+"_"+R[L];if(T.push(C),j[C]=I.createMethod(R[L],I.padding),"sha3"!==I.name){var M=I.name+R[L];T.push(M),j[M]=j[C]}}function B(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function F(t,e,r){B.call(this,t,e,r)}B.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=a(t);if("string"!==r){if("object"!==r)throw new Error(u);if(null===t)throw new Error(u);if(p&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||p&&ArrayBuffer.isView(t)))throw new Error(u);e=!0}for(var n,o,i=this.blocks,s=this.byteCount,c=t.length,l=this.blockCount,f=0,h=this.s;f<c;){if(this.reset)for(this.reset=!1,i[0]=this.block,n=1;n<l+1;++n)i[n]=0;if(e)for(n=this.start;f<c&&n<s;++f)i[n>>2]|=t[f]<<v[3&n++];else for(n=this.start;f<c&&n<s;++f)(o=t.charCodeAt(f))<128?i[n>>2]|=o<<v[3&n++]:o<2048?(i[n>>2]|=(192|o>>6)<<v[3&n++],i[n>>2]|=(128|63&o)<<v[3&n++]):o<55296||o>=57344?(i[n>>2]|=(224|o>>12)<<v[3&n++],i[n>>2]|=(128|o>>6&63)<<v[3&n++],i[n>>2]|=(128|63&o)<<v[3&n++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++f)),i[n>>2]|=(240|o>>18)<<v[3&n++],i[n>>2]|=(128|o>>12&63)<<v[3&n++],i[n>>2]|=(128|o>>6&63)<<v[3&n++],i[n>>2]|=(128|63&o)<<v[3&n++]);if(this.lastByteIndex=n,n>=s){for(this.start=n-s,this.block=i[l],n=0;n<l;++n)h[n]^=i[n];D(h),this.reset=!0}else this.start=n}return this},B.prototype.encode=function(t,e){var r=255&t,n=1,o=[r];for(r=255&(t>>=8);r>0;)o.unshift(r),r=255&(t>>=8),++n;return e?o.push(n):o.unshift(n),this.update(o),o.length},B.prototype.encodeString=function(t){var e,r=a(t);if("string"!==r){if("object"!==r)throw new Error(u);if(null===t)throw new Error(u);if(p&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||p&&ArrayBuffer.isView(t)))throw new Error(u);e=!0}var n=0,o=t.length;if(e)n=o;else for(var i=0;i<t.length;++i){var s=t.charCodeAt(i);s<128?n+=1:s<2048?n+=2:s<55296||s>=57344?n+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++i)),n+=4)}return n+=this.encode(8*n),this.update(t),n},B.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var o=e-r%e,i=[];return i.length=o,this.update(i),this},B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];D(n)}},B.prototype.toString=B.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,u="";a<n;){for(i=0;i<e&&a<n;++i,++a)t=r[i],u+=d[t>>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];a%e==0&&(D(r),i=0)}return o&&(t=r[i],u+=d[t>>4&15]+d[15&t],o>1&&(u+=d[t>>12&15]+d[t>>8&15]),o>2&&(u+=d[t>>20&15]+d[t>>16&15])),u},B.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,u=this.outputBits>>3;t=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var s=new Uint32Array(t);a<n;){for(i=0;i<e&&a<n;++i,++a)s[a]=r[i];a%e==0&&D(r)}return o&&(s[i]=r[i],t=t.slice(0,u)),t},B.prototype.buffer=B.prototype.arrayBuffer,B.prototype.digest=B.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,a=0,u=0,s=[];u<o;){for(a=0;a<r&&u<o;++a,++u)t=u<<2,e=n[a],s[t]=255&e,s[t+1]=e>>8&255,s[t+2]=e>>16&255,s[t+3]=e>>24&255;u%r==0&&D(n)}return i&&(t=u<<2,e=n[a],s[t]=255&e,i>1&&(s[t+1]=e>>8&255),i>2&&(s[t+2]=e>>16&255)),s},F.prototype=new B,F.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var D=function(t){var e,r,n,o,i,a,u,s,c,l,f,h,p,d,m,v,g,b,w,_,k,E,x,A,O,S,P,j,T,N,I,R,L,C,M,B,F,D,U,z,G,H,q,K,W,Q,V,J,Y,Z,X,$,tt,et,rt,nt,ot,it,at,ut,st,ct,lt;for(n=0;n<48;n+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(s<<1|c>>>31),r=i^(c<<1|s>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(l<<1|f>>>31),r=u^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=s^(h<<1|p>>>31),r=c^(p<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(o<<1|i>>>31),r=f^(i<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,d=t[0],m=t[1],Q=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,j=t[20]<<3|t[21]>>>29,T=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,q=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,M=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,N=t[33]<<13|t[32]>>>19,I=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,B=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Z=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,O=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,ot=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,k=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,S=t[18]<<20|t[19]>>>12,P=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=d^~v&b,t[1]=m^~g&w,t[10]=A^~S&j,t[11]=O^~P&T,t[20]=C^~B&D,t[21]=M^~F&U,t[30]=K^~Q&J,t[31]=W^~V&Y,t[40]=et^~nt&it,t[41]=rt^~ot&at,t[2]=v^~b&_,t[3]=g^~w&k,t[12]=S^~j&N,t[13]=P^~T&I,t[22]=B^~D&z,t[23]=F^~U&G,t[32]=Q^~J&Z,t[33]=V^~Y&X,t[42]=nt^~it&ut,t[43]=ot^~at&st,t[4]=b^~_&E,t[5]=w^~k&x,t[14]=j^~N&R,t[15]=T^~I&L,t[24]=D^~z&H,t[25]=U^~G&q,t[34]=J^~Z&$,t[35]=Y^~X&tt,t[44]=it^~ut&ct,t[45]=at^~st<,t[6]=_^~E&d,t[7]=k^~x&m,t[16]=N^~R&A,t[17]=I^~L&O,t[26]=z^~H&C,t[27]=G^~q&M,t[36]=Z^~$&K,t[37]=X^~tt&W,t[46]=ut^~ct&et,t[47]=st^~lt&rt,t[8]=E^~d&v,t[9]=x^~m&g,t[18]=R^~A&S,t[19]=L^~O&P,t[28]=H^~C&B,t[29]=q^~M&F,t[38]=$^~K&Q,t[39]=tt^~W&V,t[48]=ct^~et&nt,t[49]=lt^~rt&ot,t[0]^=y[n],t[1]^=y[n+1]};if(f)o.exports=j;else{for(N=0;N<T.length;++N)c[T[N]]=j[T[N]];h&&(void 0===(i=function(){return j}.call(e,r,e,o))||(o.exports=i))}}()}).call(this,r(20),r(8),r(9)(t))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n="random/5.7.0"},function(t,e,r){var n=r(16),o=r(18),i=r(24),a=r(42),u=r(43);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=r(44),f=r(45),h=f.ValidatePresence,p=f.ValidatePermission,d=function(){"use strict";return u((function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{offline:!1};a(this,t),this.client=e,this.subjectNames={},this.drafts={},this.offline=r.offline}),[{key:"FormatDate",value:function(t){if(t){if(isNaN(new Date(t)))throw Error("Invalid start time: ".concat(t));return new Date(t).toISOString()}}},{key:"FormatProfile",value:function(t){var e=this;p(t.default_permission);var r={};return t.start&&(r.start=this.FormatDate(t.start)),t.end&&(r.end=this.FormatDate(t.end)),["assets","offerings"].forEach((function(n){var o=t[n]||{};r[n]={default_permission:o.default_permission||o.default_permissions||"no-access"},o.custom_permissions&&(r[n].custom_permissions={},Object.keys(o.custom_permissions).forEach((function(t){var i=o.custom_permissions[t],a={permission:p(i.permission)};i.start&&(a.start=e.FormatDate(i.start)),i.end&&(a.end=e.FormatDate(i.end)),r[n].custom_permissions[t]=c(c({},i),a)})))})),r}},{key:"FormatPermission",value:(k=o(n.mark((function t(e){var r,o,i,a,u,s,c,f,h,p,d,m;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.policyId,o=e.policyWriteToken,i=e.permission,a=i.subject.type.startsWith("oauth")?"oauth":"fabric",t.t0=i.subject.type,t.next="otp"===t.t0?5:"otp_subject"===t.t0?8:"group"===t.t0||"oauth_group"===t.t0?13:"user"===t.t0||"oauth_user"===t.t0?16:19;break;case 5:return u="ntp",s=i.subject.id,t.abrupt("break",20);case 8:return u="ntp_subject",s=i.subject.id,c=s,f=i.subject.otp_id,t.abrupt("break",20);case 13:return u="group",s="oauth"===a?i.subject.oauth_id:this.client.utils.HashToAddress(i.subject.id),t.abrupt("break",20);case 16:return u="user",s="oauth"===a?i.subject.oauth_id:this.client.utils.HashToAddress(i.subject.id),t.abrupt("break",20);case 19:throw Error("Unknown subject type: "+i.subject.type);case 20:if(h=i.subject.oauth_id||i.subject.id,p=this.subjectNames[h],c=c||p||i.subject.id,p||"fabric"!==a){t.next=74;break}if("group"!==u){t.next=36;break}return t.next=27,this.client.ContentSpaceId();case 27:return d=t.sent.replace("ispc","ilib"),t.next=30,this.client.ContentObjectMetadata({libraryId:d,objectId:this.client.utils.AddressToObjectId(s),metadataSubtree:l("public","name")});case 30:if(t.t1=t.sent,t.t1){t.next=33;break}t.t1=s;case 33:c=t.t1,t.next=74;break;case 36:if("user"!==u){t.next=56;break}return t.t4=this.client,t.next=40,this.client.ContentObjectLibraryId({objectId:r});case 40:return t.t5=t.sent,t.t6=r,t.t7=o,t.t8=l("auth_policy_settings","fabric_users",s),t.t9={libraryId:t.t5,objectId:t.t6,writeToken:t.t7,metadataSubtree:t.t8},t.next=47,t.t4.ContentObjectMetadata.call(t.t4,t.t9);case 47:if(t.t3=t.sent,t.t3){t.next=50;break}t.t3={};case 50:if(t.t2=t.t3.name,t.t2){t.next=53;break}t.t2=s;case 53:c=t.t2,t.next=74;break;case 56:if("ntp"!==u){t.next=74;break}return t.t12=this.client,t.next=60,this.client.ContentObjectLibraryId({objectId:r});case 60:return t.t13=t.sent,t.t14=r,t.t15=o,t.t16=l("auth_policy_settings","ntp_instances",s),t.t17={libraryId:t.t13,objectId:t.t14,writeToken:t.t15,metadataSubtree:t.t16},t.next=67,t.t12.ContentObjectMetadata.call(t.t12,t.t17);case 67:if(t.t11=t.sent,t.t11){t.next=70;break}t.t11={};case 70:if(t.t10=t.t11.name,t.t10){t.next=73;break}t.t10=s;case 73:c=t.t10;case 74:return this.subjectNames[h]=c,m={profileName:i.profile,subjectSource:a,subjectType:u,subjectId:s,subjectName:c},f&&(m.subjectNTPId=f),i.start&&(m.start=i.start),i.end&&(m.end=i.end),t.abrupt("return",m);case 80:case"end":return t.stop()}}),t,this)}))),function(t){return k.apply(this,arguments)})},{key:"OpenOfflineDraft",value:(_=o(n.mark((function t(e){var r,o,i,a;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,o=e.policyLibraryId,i=e.policyWriteToken,null!=o){t.next=5;break}return t.next=4,this.client.ContentObjectLibraryId({objectId:r});case 4:o=t.sent;case 5:return t.next=7,this.client.ContentObjectMetadata({libraryId:o,objectId:r,writeToken:i});case 7:a=t.sent,this.drafts[r]={meta:a,policyLibraryId:o,policyWriteToken:i};case 9:case"end":return t.stop()}}),t,this)}))),function(t){return _.apply(this,arguments)})},{key:"CloseOfflineDraft",value:(w=o(n.mark((function t(e){var r;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,null!=this.drafts[r]){t.next=3;break}throw Error("No draft open for policyId: "+r);case 3:return t.next=5,this.client.ReplaceMetadata({libraryId:this.drafts[r].policyLibraryId,objectId:r,writeToken:this.drafts[r].policyWriteToken,metadata:this.drafts[r].meta});case 5:this.drafts[r]=null;case 6:case"end":return t.stop()}}),t,this)}))),function(t){return w.apply(this,arguments)})},{key:"PolicyItems",value:(b=o(n.mark((function t(e){var r,o;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,t.t1=this.client,t.next=4,this.client.ContentObjectLibraryId({objectId:r});case 4:return t.t2=t.sent,t.t3=r,t.t4=o,t.t5=["*/display_title"],t.t6={libraryId:t.t2,objectId:t.t3,writeToken:t.t4,metadataSubtree:"auth_policy_spec",select:t.t5},t.next=11,t.t1.ContentObjectMetadata.call(t.t1,t.t6);case 11:if(t.t0=t.sent,t.t0){t.next=14;break}t.t0={};case 14:return t.abrupt("return",t.t0);case 15:case"end":return t.stop()}}),t,this)}))),function(t){return b.apply(this,arguments)})},{key:"ItemPolicy",value:(g=o(n.mark((function t(e){var r,o,i,a,u;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,t.next=3,this.ItemProfiles({policyId:r,policyWriteToken:o,itemId:i});case 3:return a=t.sent,t.next=6,this.ItemPermissions({policyId:r,policyWriteToken:o,itemId:i});case 6:if(u=t.sent,a&&u){t.next=9;break}return t.abrupt("return");case 9:return t.abrupt("return",{profiles:a,permissions:u});case 10:case"end":return t.stop()}}),t,this)}))),function(t){return g.apply(this,arguments)})},{key:"CreateItemPolicy",value:(y=o(n.mark((function t(e){var r,o,i,a,u,s,c,f,p,d=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profiles,u=void 0===a?{}:a,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("profiles",u),t.t1=this.client,t.next=8,this.client.ContentObjectLibraryId({objectId:i});case 8:return t.t2=t.sent,t.t3=i,t.t4=["public/name","public/asset_metadata/title","public/asset_metadata/display_title"],t.t5={libraryId:t.t2,objectId:t.t3,select:t.t4},t.next=14,t.t1.ContentObjectMetadata.call(t.t1,t.t5);case 14:if(t.t0=t.sent,t.t0){t.next=17;break}t.t0={};case 17:return s=t.t0,c=(s.public||{}).asset_metadata||{},f=c.display_title||c.title||(s.public||{}).name,p={display_title:f,permissions:[],profiles:{}},Object.keys(u).forEach((function(t){p.profiles[t]=d.FormatProfile(u[t])})),t.t6=this.client,t.next=25,this.client.ContentObjectLibraryId({objectId:r});case 25:return t.t7=t.sent,t.t8=r,t.t9=o,t.t10=l("auth_policy_spec",i),t.t11=p,t.t12={libraryId:t.t7,objectId:t.t8,writeToken:t.t9,metadataSubtree:t.t10,metadata:t.t11},t.next=33,t.t6.ReplaceMetadata.call(t.t6,t.t12);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return y.apply(this,arguments)})},{key:"RemoveItemPolicy",value:(v=o(n.mark((function t(e){var r,o,i;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,h("policyId",r),h("policyWriteToken",o),h("itemId",i),t.t0=this.client,t.next=7,this.client.ContentObjectLibraryId({objectId:r});case 7:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i),t.t5={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4},t.next=14,t.t0.DeleteMetadata.call(t.t0,t.t5);case 14:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"ItemProfiles",value:(m=o(n.mark((function t(e){var r,o,i,a;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profileName,t.t0=this.client,t.next=4,this.client.ContentObjectLibraryId({objectId:r});case 4:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i,"profiles",a||""),t.t5={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4},t.next=11,t.t0.ContentObjectMetadata.call(t.t0,t.t5);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t,this)}))),function(t){return m.apply(this,arguments)})},{key:"SetProfile",value:(d=o(n.mark((function t(e){var r,o,i,a,u;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profileName,u=e.profileSpec,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("profileName",a),h("profileSpec",u),t.t0=this.client,t.next=9,this.client.ContentObjectLibraryId({objectId:r});case 9:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i,"profiles",a),t.t5=this.FormatProfile(u),t.t6={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4,metadata:t.t5},t.next=17,t.t0.ReplaceMetadata.call(t.t0,t.t6);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)})},{key:"RemoveProfile",value:(f=o(n.mark((function t(e){var r,o,i,a;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profileName,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("profileName",a),t.t0=this.client,t.next=8,this.client.ContentObjectLibraryId({objectId:r});case 8:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i,"profiles",a),t.t5={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4},t.next=15,t.t0.DeleteMetadata.call(t.t0,t.t5);case 15:case"end":return t.stop()}}),t,this)}))),function(t){return f.apply(this,arguments)})},{key:"ItemPermissions",value:(s=o(n.mark((function t(e){var r,i,a,u,s,c=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,i=e.policyWriteToken,a=e.itemId,t.next=3,this.client.ContentObjectLibraryId({objectId:r});case 3:return u=t.sent,t.next=6,this.client.ContentObjectMetadata({libraryId:u,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec",a,"permissions")});case 6:if(t.t0=t.sent,t.t0){t.next=9;break}t.t0=[];case 9:return s=t.t0,t.next=12,Promise.all(s.map(function(){var t=o(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c.FormatPermission({policyId:r,policyWriteToken:i,permission:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 12:return t.abrupt("return",t.sent);case 13:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"SetPermission",value:(i=o(n.mark((function t(e){var r,o,i,a,u,s,c,f,p,d,m,v,y,g,b,w,_,k,E,x,A;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.subjectSource,u=void 0===a?"fabric":a,s=e.subjectType,c=void 0===s?"group":s,f=e.subjectName,p=e.subjectId,d=e.subjectNTPId,m=e.profileName,v=e.start,y=e.end,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("subjectType",c),h("subjectSource",u),h("subjectId",p),h("profileName",m),v=this.FormatDate(v),y=this.FormatDate(y),g=this.offline&&null!=this.drafts[r],b=null,g){t.next=16;break}return t.next=15,this.client.ContentObjectLibraryId({objectId:r});case 15:b=t.sent;case 16:if("fabric"===u&&("group"===c?p.startsWith("igrp")||(p="igrp".concat(this.client.utils.AddressToHash(p))):"user"===c&&(p.startsWith("iusr")||(p="iusr".concat(this.client.utils.AddressToHash(p))))),!g){t.next=21;break}w=this.drafts[r].meta.auth_policy_spec[i],t.next=24;break;case 21:return t.next=23,this.client.ContentObjectMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_spec",i)});case 23:w=t.sent;case 24:if(w){t.next=26;break}throw Error("Unable to add permissions to uninitialized item");case 26:if(w.profiles[m]){t.next=28;break}throw Error("Profile '".concat(m,"' does not exist"));case 28:if((_=w.permissions.findIndex((function(t){return"fabric"===u?t.subject.id===p:t.subject.oauth_id===p})))<0&&(_=w.permissions.length),k={profile:m},v&&(k.start=v),y&&(k.end=y),"fabric"!==u){t.next=53;break}if("group"!==c){t.next=38;break}E={id:p,type:"group"},t.next=51;break;case 38:if("user"!==c){t.next=42;break}E={id:p,type:"user"},t.next=51;break;case 42:if("ntp"!==c){t.next=46;break}E={id:p,type:"otp"},t.next=51;break;case 46:if("ntp_subject"!==c){t.next=50;break}E={id:p,otp_id:d,type:"otp_subject"},t.next=51;break;case 50:throw Error("Invalid subject type: ".concat(c));case 51:t.next=66;break;case 53:if("oauth"!==u){t.next=65;break}if("group"!==c){t.next=58;break}E={id:f,oauth_id:p,type:"oauth_group"},t.next=63;break;case 58:if("user"!==c){t.next=62;break}E={id:f,oauth_id:p,type:"oauth_user"},t.next=63;break;case 62:throw Error("Invalid subject type: ".concat(c));case 63:t.next=66;break;case 65:throw Error("Invalid subject source: ".concat(u));case 66:if(k.subject=E,w.permissions[_]=k,g){t.next=71;break}return t.next=71,this.client.ReplaceMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_spec",i,"permissions"),metadata:w.permissions});case 71:if("fabric"!==u||"user"!==c){t.next=85;break}if(x={address:this.client.utils.HashToAddress(p),name:f},!g){t.next=77;break}this.drafts[r].meta.auth_policy_settings.fabric_users[this.client.utils.HashToAddress(p)]=x,t.next=83;break;case 77:return t.next=79,this.client.ContentObjectMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","fabric_users",this.client.utils.HashToAddress(p))});case 79:if(t.sent){t.next=83;break}return t.next=83,this.client.ReplaceMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","fabric_users",this.client.utils.HashToAddress(p)),metadata:x});case 83:t.next=97;break;case 85:if("fabric"!==u||"ntp"!==c){t.next=97;break}if(A={address:p,ntpId:p,name:f,type:"ntpInstance"},!g){t.next=91;break}this.drafts[r].meta.auth_policy_settings.ntp_instances[p]=A,t.next=97;break;case 91:return t.next=93,this.client.ContentObjectMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","ntp_instances",p)});case 93:if(t.sent){t.next=97;break}return t.next=97,this.client.ReplaceMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","ntp_instances",p),metadata:A});case 97:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"RemovePermission",value:(r=o(n.mark((function t(e){var r,i,a,u,s,c,f,p=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,i=e.policyWriteToken,a=e.itemId,u=e.subjectId,h("policyId",r),h("policyWriteToken",i),h("itemId",a),h("subjectId",u),t.next=7,this.client.ContentObjectLibraryId({objectId:r});case 7:return s=t.sent,t.next=10,this.client.ContentObjectMetadata({libraryId:s,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec",a,"permissions")});case 10:if(c=t.sent){t.next=13;break}return t.abrupt("return");case 13:if(!u.startsWith("0x")){t.next=23;break}return f=this.client.utils.AddressToObjectId(u),t.next=17,this.client.AccessType({id:f});case 17:if(t.t0=t.sent,"group"!==t.t0){t.next=22;break}u="igrp".concat(this.client.utils.AddressToHash(u)),t.next=23;break;case 22:u="iusr".concat(this.client.utils.AddressToHash(u));case 23:return t.next=25,Promise.all(c.map(function(){var t=o(n.mark((function t(e,o){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.subject.id!==u&&e.subject.oauth_id!==u){t.next=3;break}return t.next=3,p.client.DeleteMetadata({libraryId:s,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec",a,"permissions",o.toString())});case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()));case 25:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"SubjectPermissions",value:(e=o(n.mark((function t(e){var r,i,a,u,s,f,p,d,m,v,y,g,b=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,i=e.policyWriteToken,a=e.subjectId,h("policyId",r),h("subjectId",a),!a.startsWith("0x")){t.next=13;break}return u=this.client.utils.AddressToObjectId(a),t.next=7,this.client.AccessType({id:u});case 7:if(t.t0=t.sent,"group"!==t.t0){t.next=12;break}a="igrp".concat(this.client.utils.AddressToHash(a)),t.next=13;break;case 12:a="iusr".concat(this.client.utils.AddressToHash(a));case 13:return t.next=15,this.client.ContentObjectLibraryId({objectId:r});case 15:return s=t.sent,t.next=18,this.client.ContentObjectMetadata({libraryId:s,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec")});case 18:f=t.sent,p={},d=0,m=Object.keys(f);case 21:if(!(d<m.length)){t.next=31;break}return v=m[d],y=f[v].permissions||[],t.next=26,Promise.all(y.filter((function(t){return(t.subject||{}).oauth_id===a||(t.subject||{}).id===a})).map(function(){var t=o(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.FormatPermission({policyId:r,policyWriteToken:i,permission:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 26:(g=t.sent).length>0&&(p[v]=c(c({},f[v]),{},{permissions:g}));case 28:d++,t.next=21;break;case 31:return t.abrupt("return",p);case 32:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"RemoveSubjectPermissions",value:(t=o(n.mark((function t(e){var r,i,a,u,s=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,i=e.policyWriteToken,a=e.subjectId,h("policyId",r),h("policyWriteToken",i),h("subjectId",a),t.next=6,this.SubjectPermissions({policyId:r,policyWriteToken:i,subjectId:a});case 6:return u=t.sent,t.next=9,this.client.utils.LimitedMap(5,Object.keys(u),function(){var t=o(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.RemovePermission({policyId:r,policyWriteToken:i,subjectId:a,itemId:e});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 9:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})}]);var t,e,r,i,s,f,d,m,v,y,g,b,w,_,k}();t.exports=d},,,function(t,e,r){var n=r(17).default;function o(){"use strict";
|
|
44
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(e){h=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),a=new I(n||[]);return u(i,"_invoke",{value:P(t,r,a)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var m="suspendedStart",v="executing",y="completed",g={};function b(){}function w(){}function _(){}var k={};h(k,c,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(R([])));x&&x!==i&&a.call(x,c)&&(k=x);var A=_.prototype=b.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,u,s){var c=d(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,u,s)}),(function(t){r("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return r("throw",t,u,s)}))}s(c.arg)}var o;u(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function P(t,r,n){var o=m;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=j(u,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=d(t,r,n);if("normal"===c.type){if(o=n.done?y:"suspendedYield",c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function j(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,j(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=_,u(A,"constructor",{value:_,configurable:!0}),u(_,"constructor",{value:w,configurable:!0}),w.displayName=h(_,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,h(t,f,"GeneratorFunction")),t.prototype=Object.create(A),t},r.awrap=function(t){return{__await:t}},O(S.prototype),h(S.prototype,l,(function(){return this})),r.AsyncIterator=S,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new S(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(A),h(A,f,"Generator"),h(A,c,(function(){return this})),h(A,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=R,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(17).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(25);function o(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}t.exports=function(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n,o,i;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=n<t.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),e.push(o))}var i=e.join("/"),a=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i=a.shift()+(a.length>0?"?":"")+a.join("&")}return function(){return t("object"===a(arguments[0])?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=i():void 0===(o="function"==typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o)},function(t,e,r){var n=r(16),o=r(18),i=r(46);e.ValidatePresence=function(t,e){if(!e)throw Error("".concat(t," not specified"))},e.ValidateLibrary=function(t){if(!t)throw Error("Library ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid library ID: ".concat(t))},e.ValidateObject=function(t){if(!t)throw Error("Object ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid object ID: ".concat(t))},e.ValidateVersion=function(t){if(!t)throw Error("Version hash not specified");if(!t.toString().startsWith("h"))throw Error("Invalid version hash: ".concat(t))},e.ValidateWriteToken=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t)throw Error("Write token not specified");var r=i.DecodeWriteToken(t);if(e&&e!==r.objectId)throw Error("Object id (".concat(e,") does not match the the id (").concat(r.objectId,") decoded from write token (").concat(t,")"))},e.ValidatePartHash=function(t){if(!t)throw Error("Part hash not specified");if(!(t.toString().startsWith("hqp_")||t.toString().startsWith("hqpe")||t.toString().startsWith("hqt_")||t.toString().startsWith("hqte")||t.toString().startsWith("hql_")||t.toString().startsWith("hqle")))throw Error("Invalid part hash: ".concat(t))},e.ValidateParameters=function(t){var r=t.libraryId,n=t.objectId,o=t.versionHash,i=t.writeToken;if(i){if(o)throw Error("Cannot specify writeToken and versionHash at same time (token:".concat(i,", hash:").concat(o,")"));e.ValidateWriteToken(i)}else o?e.ValidateVersion(o):(e.ValidateLibrary(r),e.ValidateObject(n))},e.ValidateAddress=function(t){if(!t)throw Error("Address not specified");if(!/^(0x)?[0-9a-f]{40}$/i.test(t.toLowerCase()))throw Error("Invalid address: ".concat(t));return i.FormatAddress(t)},e.ValidatePermission=function(t){if(t&&"full-access"!==t&&"no-access"!==t)throw Error("Invalid profile permission: ".concat(t));return t},e.ValidateDate=function(t){if(t){if(isNaN(new Date(t)))throw Error("Invalid date: ".concat(t));return new Date(t).getTime()}},e.ValidateUserWallet=function(){var t=o(n.mark((function t(e){var r,o;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.address,o=e.client,r){t.next=5;break}throw Error("Address not specified");case 5:if(o){t.next=7;break}throw Error("Client not specified");case 7:return t.next=9,o.userProfileClient.UserWalletAddress({address:r});case 9:if(t.sent){t.next=12;break}throw Error("User address has no wallet: ".concat(r));case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},function(t,e,r){(function(e,n){var o=r(50),i=r(16),a=r(18),u=r(24),s=r(54);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}void 0===globalThis.Buffer&&(globalThis.Buffer=r(19).Buffer);var f,h,p,d=r(58),m=r(61).default,v=r(62),y=r(66),g=r(67),b=r(78).utils,w=b.keccak256,_=b.getAddress,k={name:"Utils",nullAddress:"0x0000000000000000000000000000000000000000",weiPerEther:new m("1000000000000000000"),ToBigNumber:function(t){return new m(t)},WeiToEther:function(t){return k.ToBigNumber(t).div(k.weiPerEther)},EtherToWei:function(t){return k.ToBigNumber(t).times(k.weiPerEther)},FormatAddress:function(t){return t&&"string"==typeof t?((t=t.trim()).startsWith("0x")||(t="0x"+t),t.toLowerCase()):""},FormatSignature:function(t){return t=t.replace("0x",""),"ES256K_"+d.encode(e.from(t,"hex"))},DecodeVersionHash:function(t){if(!t.startsWith("hq__")&&!t.startsWith("tq__"))throw new Error('Invalid version hash: "'.concat(t,'"'));t=t.slice(4);var r=k.FromB58(t),n=r.slice(0,32),o=n.toString("hex");r=r.slice(32);for(var i=0;r[i]>=128;)i++;i++;var a=r.slice(0,i),u=v.decode(a);return r=r.slice(i),{digest:o,size:u,objectId:"iq__"+k.B58(r),partHash:"hqp_"+k.B58(e.concat([n,a]))}},DecodeSignedToken:function(t){var r=k.FromB58(t.slice(6)),n="0x".concat(r.slice(0,65).toString("hex")),o=JSON.parse(e.from(g.inflateRaw(r.slice(65))).toString("utf-8"));return o.adr=k.FormatAddress("0x".concat(e.from(o.adr,"base64").toString("hex"))),{payload:o,signature:n}},DecodeWriteToken:function(t){if(t.length<4)throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'));var e;if(t.startsWith("tqw__")?(e="tq__",t=t.slice(5)):(e=t.slice(0,4),t=t.slice(4)),0===t.length)throw new Error('Invalid write token: ["'.concat(t,'"] (too short)'));switch(e){case"tqw_":case"tq__":case"tqpw":case"tqp_":case"tlro":break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}var r,n,o,i,a,u=k.FromB58(t);function s(t,e){var r,n,o=v.decode(u,0),i=v.decode.bytes;return n=t?0===(r=u.slice(i+1,o+i)).length?"":e+k.B58(r):"0x"+(r=u.slice(i,o+i)).toString("hex"),u=u.slice(o+i),n}switch(e){case"tqw_":case"tqpw":r="0x"+u.toString("hex");break;case"tlro":case"tq__":n=s(!0,"iq__"),o=s(!0,"inod"),r=s(!1,"");break;case"tqp_":if(u.length<3)throw new Error('Invalid write token: ["'.concat(t,'"] (token truncated)'));i=u[0],a=u[1],u=u.slice(2),r=s(!1,"");break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}return{tokenType:e,tokenId:r,objectId:n,nodeId:o,scheme:i,flags:a}},AddressToHash:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t.replace(r?"0x04":"0x",""),d.encode(e.from(t,"hex"))},AddressToSpaceId:function(t){return"ispc"+k.AddressToHash(t)},AddressToNodeId:function(t){return"inod"+k.AddressToHash(t)},AddressToLibraryId:function(t){return"ilib"+k.AddressToHash(t)},AddressToObjectId:function(t){return"iq__"+k.AddressToHash(t)},HashToAddress:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=e?t:t.substr(4),k.FormatAddress((e?"0x04":"0x")+d.decode(t).toString("hex"))},EqualAddress:function(t,e){return!(!t||!e)&&k.FormatAddress(t)===k.FormatAddress(e)},EqualHash:function(t,e){return!(!t||!e)&&(!(t.length<=4||e.length<=4)&&k.HashToAddress(t)===k.HashToAddress(e))},ValidAddress:function(t){try{return _(t),!0}catch(t){return!1}},ValidHash:function(t){return k.ValidAddress(k.HashToAddress(t))},ToBytes32:function(t){return"0x"+t.split("").map((function(t){return t.charCodeAt(0).toString(16)})).join("").slice(0,64).padEnd(64,"0")},BufferToArrayBuffer:function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},FromHex:function(t){return t=t.replace(/^0x/,""),e.from(t,"hex").toString()},B64:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8";return e.from(t,r).toString("base64")},FromB64:function(t){return e.from(t,"base64").toString("utf-8")},FromB64URL:function(t){var e=(t=t.replace(/-/g,"+").replace(/_/g,"/")).length%4;if(e){if(1===e)throw new Error("InvalidLengthError: Input base64url string is the wrong length to determine padding");t+=new Array(5-e).join("=")}return k.FromB64(t)},B58:function(t){return d.encode(e.from(t))},FromB58:function(t){return d.decode(t)},FromB58ToStr:function(t){return(new TextDecoder).decode(k.FromB58(t))},DecodeAuthorizationToken:function(t){var e=(t=decodeURIComponent(t)).split("."),r=s(e,2),n=r[0],o=r[1];return l(l({},n=JSON.parse(k.FromB64(n))),{},{signature:o})},LimitedMap:(p=a(i.mark((function t(e,r,n){var u,s,c,l,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=0,s=!1,c=function(){var t=a(i.mark((function t(){var e;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!s){t.next=5;break}return t.next=3,new Promise((function(t){return setTimeout(t,10)}));case 3:t.next=0;break;case 5:return s=!0,e=u,u+=1,s=!1,t.abrupt("return",e);case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),l=[],f=0,t.abrupt("return",new Promise((function(t,u){o(Array(e||1)).forEach(a(i.mark((function e(){var o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f+=1,e.next=3,c();case 3:o=e.sent;case 4:if(!(o<r.length)){e.next=19;break}return e.prev=5,e.next=8,n(r[o],o);case 8:l[o]=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),u(e.t0);case 14:return e.next=16,c();case 16:o=e.sent,e.next=4;break;case 19:0==(f-=1)&&t(l);case 21:case"end":return e.stop()}}),e,null,[[5,11]])}))))})));case 6:case"end":return t.stop()}}),t)}))),function(t,e,r){return p.apply(this,arguments)}),ResponseToJson:(h=a(i.mark((function t(e){var r,n,o=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]&&o[1],n=o.length>2?o[2]:void 0,t.next=4,k.ResponseToFormat("json",e,r,n);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)}))),function(t){return h.apply(this,arguments)}),ResponseToFormat:(f=a(i.mark((function t(e,r){var n,o,a,u=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=u.length>2&&void 0!==u[2]&&u[2],o=u.length>3?u[3]:void 0,t.next=4,r;case 4:r=t.sent,t.t0=e.toLowerCase(),t.next="json"===t.t0?8:"text"===t.t0?13:"blob"===t.t0?18:"arraybuffer"===t.t0?21:"formdata"===t.t0?24:"buffer"===t.t0?27:30;break;case 8:return t.next=10,r.json();case 10:return a=t.sent,n&&o("response body: ".concat(JSON.stringify(a,null,2))),t.abrupt("return",a);case 13:return t.next=15,r.text();case 15:return a=t.sent,n&&o("response body: ".concat(a)),t.abrupt("return",a);case 18:return t.next=20,r.blob();case 20:return t.abrupt("return",t.sent);case 21:return t.next=23,r.arrayBuffer();case 23:return t.abrupt("return",t.sent);case 24:return t.next=26,r.formData();case 26:return t.abrupt("return",t.sent);case 27:return t.next=29,r.buffer();case 29:return t.abrupt("return",t.sent);case 30:return t.abrupt("return",r);case 31:case"end":return t.stop()}}),t)}))),function(t,e){return f.apply(this,arguments)}),ResizeImage:function(t){var e=t.imageUrl,r=t.height;return!e||e&&!e.startsWith("http")?e:(e=y(e).removeSearch("height").removeSearch("header-x_image_height"),r&&!isNaN(parseInt(r))&&e.addSearch("height",parseInt(r)),e.toString())},SafeTraverse:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(!t)return t;1===r.length&&Array.isArray(r[0])&&(r=r[0]);for(var o=t,i=0;i<r.length;i++)if(void 0===(o=o[r[i]]))return;return o},IsCloneable:function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return k.IsCloneable(t[e])}));case"Map":return o(t.keys()).every(k.IsCloneable)&&o(t.values()).every(k.IsCloneable);case"Set":return o(t.keys()).every(k.IsCloneable);default:return!1}},MakeClonable:function(t){if(k.IsCloneable(t))return t;if(e.isBuffer(t))return k.BufferToArrayBuffer(t);switch({}.toString.call(t).slice(8,-1)){case"Response":case"Function":return;case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return t;case"Array":return t.map((function(t){return k.MakeClonable(t)}));case"Set":return new Set(Array.from(t.keys()).map((function(t){return k.MakeClonable(t)})));case"Map":var r=new Map;return Array.from(t.keys()).forEach((function(e){var n=k.MakeClonable(t.get(e));n&&r.set(e,n)})),r;case"Error":return t.message;case"Object":var n={};return Object.keys(t).map((function(e){var r=k.MakeClonable(t[e]);r&&(n[e]=r)})),n;default:return JSON.parse(JSON.stringify(t))}},PublicKeyToAddress:function(t){var r=new Uint8Array(e.from(t.replace("0x04",""),"hex")),n="0x"+w(r).slice(26);return k.FormatAddress(n)},PLATFORM_NODE:"node",PLATFORM_WEB:"web",PLATFORM_REACT_NATIVE:"react-native",Platform:function(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product?k.PLATFORM_REACT_NATIVE:void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node?k.PLATFORM_NODE:k.PLATFORM_WEB},HLSJSSettings:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.profile,r=void 0===e?"default":e,n="undefined"!=typeof window&&void 0!==window.navigator&&/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),o={maxBufferHole:2.2,nudgeOffset:.2,nudgeMaxRetry:12,highBufferWatchdogPeriod:1};return!n&&["ull","ultraLowLatency"].includes(r)?{lowLatencyMode:!0,liveSyncDuration:4,liveMaxLatencyDuration:5,liveDurationInfinity:!1,maxBufferLength:8,backBufferLength:4,highBufferWatchdogPeriod:1}:["ll","lowLatency","ull","ultraLowLatency"].includes(r)?l({lowLatencyMode:!0,liveSyncDuration:5,liveMaxLatencyDuration:n?15:10,liveDurationInfinity:!1,maxBufferLength:5,backBufferLength:5},o):o},LiveHLSJSSettings:function(t){var e=t.lowLatency,r=void 0!==e&&e,n=t.ultraLowLatency,o=void 0!==n&&n;return k.HLSJSSettings({profile:o?"ull":r?"ll":"default"})}};t.exports=k}).call(this,r(19).Buffer,r(20))},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),a=n[0],u=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],s[l++]=e>>16&255,s[l++]=e>>8&255,s[l++]=255&e;2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,s[l++]=255&e);1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e);return s},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(l(t,a,a+16383>u?u:a+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
|
43
|
+
*/!function(){"use strict";var u="input is invalid type",s="object"===("undefined"==typeof window?"undefined":a(window)),c=s?window:{};c.JS_SHA3_NO_WINDOW&&(s=!1);var l=!s&&"object"===("undefined"==typeof self?"undefined":a(self));!c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===t?"undefined":a(t))&&t.versions&&t.versions.node?c=n:l&&(c=self);var f=!c.JS_SHA3_NO_COMMON_JS&&"object"===a(o)&&o.exports,h=r(21),p=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),v=[4,1024,262144,67108864],y=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],g=[224,256,384,512],b=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],_={128:168,256:136};!c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!p||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"===a(t)&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var k=function(t,e,r){return function(n){return new B(t,e,t).update(n)[r]()}},E=function(t,e,r){return function(n,o){return new B(t,e,o).update(n)[r]()}},x=function(t,e,r){return function(e,n,o,i){return j["cshake"+t].update(e,n,o,i)[r]()}},A=function(t,e,r){return function(e,n,o,i){return j["kmac"+t].update(e,n,o,i)[r]()}},O=function(t,e,r,n){for(var o=0;o<w.length;++o){var i=w[o];t[i]=e(r,n,i)}return t},S=function(t,e){var r=k(t,e,"hex");return r.create=function(){return new B(t,e,t)},r.update=function(t){return r.create().update(t)},O(r,k,t,e)},P=[{name:"keccak",padding:[1,256,65536,16777216],bits:g,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:g,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:b,createMethod:function(t,e){var r=E(t,e,"hex");return r.create=function(r){return new B(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},O(r,E,t,e)}},{name:"cshake",padding:v,bits:b,createMethod:function(t,e){var r=_[t],n=x(t,0,"hex");return n.create=function(n,o,i){return o||i?new B(t,e,n).bytepad([o,i],r):j["shake"+t].create(n)},n.update=function(t,e,r,o){return n.create(e,r,o).update(t)},O(n,x,t,e)}},{name:"kmac",padding:v,bits:b,createMethod:function(t,e){var r=_[t],n=A(t,0,"hex");return n.create=function(n,o,i){return new F(t,e,o).bytepad(["KMAC",i],r).bytepad([n],r)},n.update=function(t,e,r,o){return n.create(t,r,o).update(e)},O(n,A,t,e)}}],j={},T=[],R=0;R<P.length;++R)for(var N=P[R],I=N.bits,L=0;L<I.length;++L){var C=N.name+"_"+I[L];if(T.push(C),j[C]=N.createMethod(I[L],N.padding),"sha3"!==N.name){var M=N.name+I[L];T.push(M),j[M]=j[C]}}function B(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function F(t,e,r){B.call(this,t,e,r)}B.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=a(t);if("string"!==r){if("object"!==r)throw new Error(u);if(null===t)throw new Error(u);if(p&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||p&&ArrayBuffer.isView(t)))throw new Error(u);e=!0}for(var n,o,i=this.blocks,s=this.byteCount,c=t.length,l=this.blockCount,f=0,h=this.s;f<c;){if(this.reset)for(this.reset=!1,i[0]=this.block,n=1;n<l+1;++n)i[n]=0;if(e)for(n=this.start;f<c&&n<s;++f)i[n>>2]|=t[f]<<y[3&n++];else for(n=this.start;f<c&&n<s;++f)(o=t.charCodeAt(f))<128?i[n>>2]|=o<<y[3&n++]:o<2048?(i[n>>2]|=(192|o>>6)<<y[3&n++],i[n>>2]|=(128|63&o)<<y[3&n++]):o<55296||o>=57344?(i[n>>2]|=(224|o>>12)<<y[3&n++],i[n>>2]|=(128|o>>6&63)<<y[3&n++],i[n>>2]|=(128|63&o)<<y[3&n++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++f)),i[n>>2]|=(240|o>>18)<<y[3&n++],i[n>>2]|=(128|o>>12&63)<<y[3&n++],i[n>>2]|=(128|o>>6&63)<<y[3&n++],i[n>>2]|=(128|63&o)<<y[3&n++]);if(this.lastByteIndex=n,n>=s){for(this.start=n-s,this.block=i[l],n=0;n<l;++n)h[n]^=i[n];D(h),this.reset=!0}else this.start=n}return this},B.prototype.encode=function(t,e){var r=255&t,n=1,o=[r];for(r=255&(t>>=8);r>0;)o.unshift(r),r=255&(t>>=8),++n;return e?o.push(n):o.unshift(n),this.update(o),o.length},B.prototype.encodeString=function(t){var e,r=a(t);if("string"!==r){if("object"!==r)throw new Error(u);if(null===t)throw new Error(u);if(p&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||p&&ArrayBuffer.isView(t)))throw new Error(u);e=!0}var n=0,o=t.length;if(e)n=o;else for(var i=0;i<t.length;++i){var s=t.charCodeAt(i);s<128?n+=1:s<2048?n+=2:s<55296||s>=57344?n+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++i)),n+=4)}return n+=this.encode(8*n),this.update(t),n},B.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var o=e-r%e,i=[];return i.length=o,this.update(i),this},B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];D(n)}},B.prototype.toString=B.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,u="";a<n;){for(i=0;i<e&&a<n;++i,++a)t=r[i],u+=d[t>>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];a%e==0&&(D(r),i=0)}return o&&(t=r[i],u+=d[t>>4&15]+d[15&t],o>1&&(u+=d[t>>12&15]+d[t>>8&15]),o>2&&(u+=d[t>>20&15]+d[t>>16&15])),u},B.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,u=this.outputBits>>3;t=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var s=new Uint32Array(t);a<n;){for(i=0;i<e&&a<n;++i,++a)s[a]=r[i];a%e==0&&D(r)}return o&&(s[i]=r[i],t=t.slice(0,u)),t},B.prototype.buffer=B.prototype.arrayBuffer,B.prototype.digest=B.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,a=0,u=0,s=[];u<o;){for(a=0;a<r&&u<o;++a,++u)t=u<<2,e=n[a],s[t]=255&e,s[t+1]=e>>8&255,s[t+2]=e>>16&255,s[t+3]=e>>24&255;u%r==0&&D(n)}return i&&(t=u<<2,e=n[a],s[t]=255&e,i>1&&(s[t+1]=e>>8&255),i>2&&(s[t+2]=e>>16&255)),s},F.prototype=new B,F.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var D=function(t){var e,r,n,o,i,a,u,s,c,l,f,h,p,d,v,y,g,b,w,_,k,E,x,A,O,S,P,j,T,R,N,I,L,C,M,B,F,D,U,z,G,H,q,K,W,Q,V,J,Y,Z,X,$,tt,et,rt,nt,ot,it,at,ut,st,ct,lt;for(n=0;n<48;n+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(s<<1|c>>>31),r=i^(c<<1|s>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(l<<1|f>>>31),r=u^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=s^(h<<1|p>>>31),r=c^(p<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(o<<1|i>>>31),r=f^(i<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,d=t[0],v=t[1],Q=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,j=t[20]<<3|t[21]>>>29,T=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,q=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,M=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,N=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,B=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Z=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,I=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,O=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,ot=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,k=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,S=t[18]<<20|t[19]>>>12,P=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=d^~y&b,t[1]=v^~g&w,t[10]=A^~S&j,t[11]=O^~P&T,t[20]=C^~B&D,t[21]=M^~F&U,t[30]=K^~Q&J,t[31]=W^~V&Y,t[40]=et^~nt&it,t[41]=rt^~ot&at,t[2]=y^~b&_,t[3]=g^~w&k,t[12]=S^~j&R,t[13]=P^~T&N,t[22]=B^~D&z,t[23]=F^~U&G,t[32]=Q^~J&Z,t[33]=V^~Y&X,t[42]=nt^~it&ut,t[43]=ot^~at&st,t[4]=b^~_&E,t[5]=w^~k&x,t[14]=j^~R&I,t[15]=T^~N&L,t[24]=D^~z&H,t[25]=U^~G&q,t[34]=J^~Z&$,t[35]=Y^~X&tt,t[44]=it^~ut&ct,t[45]=at^~st<,t[6]=_^~E&d,t[7]=k^~x&v,t[16]=R^~I&A,t[17]=N^~L&O,t[26]=z^~H&C,t[27]=G^~q&M,t[36]=Z^~$&K,t[37]=X^~tt&W,t[46]=ut^~ct&et,t[47]=st^~lt&rt,t[8]=E^~d&y,t[9]=x^~v&g,t[18]=I^~A&S,t[19]=L^~O&P,t[28]=H^~C&B,t[29]=q^~M&F,t[38]=$^~K&Q,t[39]=tt^~W&V,t[48]=ct^~et&nt,t[49]=lt^~rt&ot,t[0]^=m[n],t[1]^=m[n+1]};if(f)o.exports=j;else{for(R=0;R<T.length;++R)c[T[R]]=j[T[R]];h&&(void 0===(i=function(){return j}.call(e,r,e,o))||(o.exports=i))}}()}).call(this,r(20),r(8),r(9)(t))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n="random/5.7.0"},function(t,e,r){var n=r(16),o=r(18),i=r(24),a=r(42),u=r(43);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=r(44),f=r(45),h=f.ValidatePresence,p=f.ValidatePermission,d=function(){"use strict";function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{offline:!1};a(this,t),this.client=e,this.subjectNames={},this.drafts={},this.offline=r.offline}var e,r,i,s,f,d,v,y,m,g,b,w,_,k,E;return u(t,[{key:"FormatDate",value:function(t){if(t){if(isNaN(new Date(t)))throw Error("Invalid start time: ".concat(t));return new Date(t).toISOString()}}},{key:"FormatProfile",value:function(t){var e=this;p(t.default_permission);var r={};return t.start&&(r.start=this.FormatDate(t.start)),t.end&&(r.end=this.FormatDate(t.end)),["assets","offerings"].forEach((function(n){var o=t[n]||{};r[n]={default_permission:o.default_permission||o.default_permissions||"no-access"},o.custom_permissions&&(r[n].custom_permissions={},Object.keys(o.custom_permissions).forEach((function(t){var i=o.custom_permissions[t],a={permission:p(i.permission)};i.start&&(a.start=e.FormatDate(i.start)),i.end&&(a.end=e.FormatDate(i.end)),r[n].custom_permissions[t]=c(c({},i),a)})))})),r}},{key:"FormatPermission",value:(E=o(n.mark((function t(e){var r,o,i,a,u,s,c,f,h,p,d,v;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.policyId,o=e.policyWriteToken,i=e.permission,a=i.subject.type.startsWith("oauth")?"oauth":"fabric",t.t0=i.subject.type,t.next="otp"===t.t0?5:"otp_subject"===t.t0?8:"group"===t.t0||"oauth_group"===t.t0?13:"user"===t.t0||"oauth_user"===t.t0?16:19;break;case 5:return u="ntp",s=i.subject.id,t.abrupt("break",20);case 8:return u="ntp_subject",s=i.subject.id,c=s,f=i.subject.otp_id,t.abrupt("break",20);case 13:return u="group",s="oauth"===a?i.subject.oauth_id:this.client.utils.HashToAddress(i.subject.id),t.abrupt("break",20);case 16:return u="user",s="oauth"===a?i.subject.oauth_id:this.client.utils.HashToAddress(i.subject.id),t.abrupt("break",20);case 19:throw Error("Unknown subject type: "+i.subject.type);case 20:if(h=i.subject.oauth_id||i.subject.id,p=this.subjectNames[h],c=c||p||i.subject.id,p||"fabric"!==a){t.next=74;break}if("group"!==u){t.next=36;break}return t.next=27,this.client.ContentSpaceId();case 27:return d=t.sent.replace("ispc","ilib"),t.next=30,this.client.ContentObjectMetadata({libraryId:d,objectId:this.client.utils.AddressToObjectId(s),metadataSubtree:l("public","name")});case 30:if(t.t1=t.sent,t.t1){t.next=33;break}t.t1=s;case 33:c=t.t1,t.next=74;break;case 36:if("user"!==u){t.next=56;break}return t.t4=this.client,t.next=40,this.client.ContentObjectLibraryId({objectId:r});case 40:return t.t5=t.sent,t.t6=r,t.t7=o,t.t8=l("auth_policy_settings","fabric_users",s),t.t9={libraryId:t.t5,objectId:t.t6,writeToken:t.t7,metadataSubtree:t.t8},t.next=47,t.t4.ContentObjectMetadata.call(t.t4,t.t9);case 47:if(t.t3=t.sent,t.t3){t.next=50;break}t.t3={};case 50:if(t.t2=t.t3.name,t.t2){t.next=53;break}t.t2=s;case 53:c=t.t2,t.next=74;break;case 56:if("ntp"!==u){t.next=74;break}return t.t12=this.client,t.next=60,this.client.ContentObjectLibraryId({objectId:r});case 60:return t.t13=t.sent,t.t14=r,t.t15=o,t.t16=l("auth_policy_settings","ntp_instances",s),t.t17={libraryId:t.t13,objectId:t.t14,writeToken:t.t15,metadataSubtree:t.t16},t.next=67,t.t12.ContentObjectMetadata.call(t.t12,t.t17);case 67:if(t.t11=t.sent,t.t11){t.next=70;break}t.t11={};case 70:if(t.t10=t.t11.name,t.t10){t.next=73;break}t.t10=s;case 73:c=t.t10;case 74:return this.subjectNames[h]=c,v={profileName:i.profile,subjectSource:a,subjectType:u,subjectId:s,subjectName:c},f&&(v.subjectNTPId=f),i.start&&(v.start=i.start),i.end&&(v.end=i.end),t.abrupt("return",v);case 80:case"end":return t.stop()}}),t,this)}))),function(t){return E.apply(this,arguments)})},{key:"OpenOfflineDraft",value:(k=o(n.mark((function t(e){var r,o,i,a;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,o=e.policyLibraryId,i=e.policyWriteToken,null!=o){t.next=5;break}return t.next=4,this.client.ContentObjectLibraryId({objectId:r});case 4:o=t.sent;case 5:return t.next=7,this.client.ContentObjectMetadata({libraryId:o,objectId:r,writeToken:i});case 7:a=t.sent,this.drafts[r]={meta:a,policyLibraryId:o,policyWriteToken:i};case 9:case"end":return t.stop()}}),t,this)}))),function(t){return k.apply(this,arguments)})},{key:"CloseOfflineDraft",value:(_=o(n.mark((function t(e){var r;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,null!=this.drafts[r]){t.next=3;break}throw Error("No draft open for policyId: "+r);case 3:return t.next=5,this.client.ReplaceMetadata({libraryId:this.drafts[r].policyLibraryId,objectId:r,writeToken:this.drafts[r].policyWriteToken,metadata:this.drafts[r].meta});case 5:this.drafts[r]=null;case 6:case"end":return t.stop()}}),t,this)}))),function(t){return _.apply(this,arguments)})},{key:"PolicyItems",value:(w=o(n.mark((function t(e){var r,o;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,t.t1=this.client,t.next=4,this.client.ContentObjectLibraryId({objectId:r});case 4:return t.t2=t.sent,t.t3=r,t.t4=o,t.t5=["*/display_title"],t.t6={libraryId:t.t2,objectId:t.t3,writeToken:t.t4,metadataSubtree:"auth_policy_spec",select:t.t5},t.next=11,t.t1.ContentObjectMetadata.call(t.t1,t.t6);case 11:if(t.t0=t.sent,t.t0){t.next=14;break}t.t0={};case 14:return t.abrupt("return",t.t0);case 15:case"end":return t.stop()}}),t,this)}))),function(t){return w.apply(this,arguments)})},{key:"ItemPolicy",value:(b=o(n.mark((function t(e){var r,o,i,a,u;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,t.next=3,this.ItemProfiles({policyId:r,policyWriteToken:o,itemId:i});case 3:return a=t.sent,t.next=6,this.ItemPermissions({policyId:r,policyWriteToken:o,itemId:i});case 6:if(u=t.sent,a&&u){t.next=9;break}return t.abrupt("return");case 9:return t.abrupt("return",{profiles:a,permissions:u});case 10:case"end":return t.stop()}}),t,this)}))),function(t){return b.apply(this,arguments)})},{key:"CreateItemPolicy",value:(g=o(n.mark((function t(e){var r,o,i,a,u,s,c,f,p,d=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profiles,u=void 0===a?{}:a,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("profiles",u),t.t1=this.client,t.next=8,this.client.ContentObjectLibraryId({objectId:i});case 8:return t.t2=t.sent,t.t3=i,t.t4=["public/name","public/asset_metadata/title","public/asset_metadata/display_title"],t.t5={libraryId:t.t2,objectId:t.t3,select:t.t4},t.next=14,t.t1.ContentObjectMetadata.call(t.t1,t.t5);case 14:if(t.t0=t.sent,t.t0){t.next=17;break}t.t0={};case 17:return s=t.t0,c=(s.public||{}).asset_metadata||{},f=c.display_title||c.title||(s.public||{}).name,p={display_title:f,permissions:[],profiles:{}},Object.keys(u).forEach((function(t){p.profiles[t]=d.FormatProfile(u[t])})),t.t6=this.client,t.next=25,this.client.ContentObjectLibraryId({objectId:r});case 25:return t.t7=t.sent,t.t8=r,t.t9=o,t.t10=l("auth_policy_spec",i),t.t11=p,t.t12={libraryId:t.t7,objectId:t.t8,writeToken:t.t9,metadataSubtree:t.t10,metadata:t.t11},t.next=33,t.t6.ReplaceMetadata.call(t.t6,t.t12);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return g.apply(this,arguments)})},{key:"RemoveItemPolicy",value:(m=o(n.mark((function t(e){var r,o,i;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,h("policyId",r),h("policyWriteToken",o),h("itemId",i),t.t0=this.client,t.next=7,this.client.ContentObjectLibraryId({objectId:r});case 7:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i),t.t5={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4},t.next=14,t.t0.DeleteMetadata.call(t.t0,t.t5);case 14:case"end":return t.stop()}}),t,this)}))),function(t){return m.apply(this,arguments)})},{key:"ItemProfiles",value:(y=o(n.mark((function t(e){var r,o,i,a;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profileName,t.t0=this.client,t.next=4,this.client.ContentObjectLibraryId({objectId:r});case 4:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i,"profiles",a||""),t.t5={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4},t.next=11,t.t0.ContentObjectMetadata.call(t.t0,t.t5);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t,this)}))),function(t){return y.apply(this,arguments)})},{key:"SetProfile",value:(v=o(n.mark((function t(e){var r,o,i,a,u;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profileName,u=e.profileSpec,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("profileName",a),h("profileSpec",u),t.t0=this.client,t.next=9,this.client.ContentObjectLibraryId({objectId:r});case 9:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i,"profiles",a),t.t5=this.FormatProfile(u),t.t6={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4,metadata:t.t5},t.next=17,t.t0.ReplaceMetadata.call(t.t0,t.t6);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"RemoveProfile",value:(d=o(n.mark((function t(e){var r,o,i,a;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profileName,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("profileName",a),t.t0=this.client,t.next=8,this.client.ContentObjectLibraryId({objectId:r});case 8:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i,"profiles",a),t.t5={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4},t.next=15,t.t0.DeleteMetadata.call(t.t0,t.t5);case 15:case"end":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)})},{key:"ItemPermissions",value:(f=o(n.mark((function t(e){var r,i,a,u,s,c=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,i=e.policyWriteToken,a=e.itemId,t.next=3,this.client.ContentObjectLibraryId({objectId:r});case 3:return u=t.sent,t.next=6,this.client.ContentObjectMetadata({libraryId:u,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec",a,"permissions")});case 6:if(t.t0=t.sent,t.t0){t.next=9;break}t.t0=[];case 9:return s=t.t0,t.next=12,Promise.all(s.map(function(){var t=o(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c.FormatPermission({policyId:r,policyWriteToken:i,permission:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 12:return t.abrupt("return",t.sent);case 13:case"end":return t.stop()}}),t,this)}))),function(t){return f.apply(this,arguments)})},{key:"SetPermission",value:(s=o(n.mark((function t(e){var r,o,i,a,u,s,c,f,p,d,v,y,m,g,b,w,_,k,E,x,A;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.subjectSource,u=void 0===a?"fabric":a,s=e.subjectType,c=void 0===s?"group":s,f=e.subjectName,p=e.subjectId,d=e.subjectNTPId,v=e.profileName,y=e.start,m=e.end,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("subjectType",c),h("subjectSource",u),h("subjectId",p),h("profileName",v),y=this.FormatDate(y),m=this.FormatDate(m),g=this.offline&&null!=this.drafts[r],b=null,g){t.next=16;break}return t.next=15,this.client.ContentObjectLibraryId({objectId:r});case 15:b=t.sent;case 16:if("fabric"===u&&("group"===c?p.startsWith("igrp")||(p="igrp".concat(this.client.utils.AddressToHash(p))):"user"===c&&(p.startsWith("iusr")||(p="iusr".concat(this.client.utils.AddressToHash(p))))),!g){t.next=21;break}w=this.drafts[r].meta.auth_policy_spec[i],t.next=24;break;case 21:return t.next=23,this.client.ContentObjectMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_spec",i)});case 23:w=t.sent;case 24:if(w){t.next=26;break}throw Error("Unable to add permissions to uninitialized item");case 26:if(w.profiles[v]){t.next=28;break}throw Error("Profile '".concat(v,"' does not exist"));case 28:if((_=w.permissions.findIndex((function(t){return"fabric"===u?t.subject.id===p:t.subject.oauth_id===p})))<0&&(_=w.permissions.length),k={profile:v},y&&(k.start=y),m&&(k.end=m),"fabric"!==u){t.next=53;break}if("group"!==c){t.next=38;break}E={id:p,type:"group"},t.next=51;break;case 38:if("user"!==c){t.next=42;break}E={id:p,type:"user"},t.next=51;break;case 42:if("ntp"!==c){t.next=46;break}E={id:p,type:"otp"},t.next=51;break;case 46:if("ntp_subject"!==c){t.next=50;break}E={id:p,otp_id:d,type:"otp_subject"},t.next=51;break;case 50:throw Error("Invalid subject type: ".concat(c));case 51:t.next=66;break;case 53:if("oauth"!==u){t.next=65;break}if("group"!==c){t.next=58;break}E={id:f,oauth_id:p,type:"oauth_group"},t.next=63;break;case 58:if("user"!==c){t.next=62;break}E={id:f,oauth_id:p,type:"oauth_user"},t.next=63;break;case 62:throw Error("Invalid subject type: ".concat(c));case 63:t.next=66;break;case 65:throw Error("Invalid subject source: ".concat(u));case 66:if(k.subject=E,w.permissions[_]=k,g){t.next=71;break}return t.next=71,this.client.ReplaceMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_spec",i,"permissions"),metadata:w.permissions});case 71:if("fabric"!==u||"user"!==c){t.next=85;break}if(x={address:this.client.utils.HashToAddress(p),name:f},!g){t.next=77;break}this.drafts[r].meta.auth_policy_settings.fabric_users[this.client.utils.HashToAddress(p)]=x,t.next=83;break;case 77:return t.next=79,this.client.ContentObjectMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","fabric_users",this.client.utils.HashToAddress(p))});case 79:if(t.sent){t.next=83;break}return t.next=83,this.client.ReplaceMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","fabric_users",this.client.utils.HashToAddress(p)),metadata:x});case 83:t.next=97;break;case 85:if("fabric"!==u||"ntp"!==c){t.next=97;break}if(A={address:p,ntpId:p,name:f,type:"ntpInstance"},!g){t.next=91;break}this.drafts[r].meta.auth_policy_settings.ntp_instances[p]=A,t.next=97;break;case 91:return t.next=93,this.client.ContentObjectMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","ntp_instances",p)});case 93:if(t.sent){t.next=97;break}return t.next=97,this.client.ReplaceMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","ntp_instances",p),metadata:A});case 97:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"RemovePermission",value:(i=o(n.mark((function t(e){var r,i,a,u,s,c,f,p=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,i=e.policyWriteToken,a=e.itemId,u=e.subjectId,h("policyId",r),h("policyWriteToken",i),h("itemId",a),h("subjectId",u),t.next=7,this.client.ContentObjectLibraryId({objectId:r});case 7:return s=t.sent,t.next=10,this.client.ContentObjectMetadata({libraryId:s,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec",a,"permissions")});case 10:if(c=t.sent){t.next=13;break}return t.abrupt("return");case 13:if(!u.startsWith("0x")){t.next=23;break}return f=this.client.utils.AddressToObjectId(u),t.next=17,this.client.AccessType({id:f});case 17:if(t.t0=t.sent,"group"!==t.t0){t.next=22;break}u="igrp".concat(this.client.utils.AddressToHash(u)),t.next=23;break;case 22:u="iusr".concat(this.client.utils.AddressToHash(u));case 23:return t.next=25,Promise.all(c.map(function(){var t=o(n.mark((function t(e,o){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.subject.id!==u&&e.subject.oauth_id!==u){t.next=3;break}return t.next=3,p.client.DeleteMetadata({libraryId:s,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec",a,"permissions",o.toString())});case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()));case 25:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"SubjectPermissions",value:(r=o(n.mark((function t(e){var r,i,a,u,s,f,p,d,v,y,m,g,b=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,i=e.policyWriteToken,a=e.subjectId,h("policyId",r),h("subjectId",a),!a.startsWith("0x")){t.next=13;break}return u=this.client.utils.AddressToObjectId(a),t.next=7,this.client.AccessType({id:u});case 7:if(t.t0=t.sent,"group"!==t.t0){t.next=12;break}a="igrp".concat(this.client.utils.AddressToHash(a)),t.next=13;break;case 12:a="iusr".concat(this.client.utils.AddressToHash(a));case 13:return t.next=15,this.client.ContentObjectLibraryId({objectId:r});case 15:return s=t.sent,t.next=18,this.client.ContentObjectMetadata({libraryId:s,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec")});case 18:f=t.sent,p={},d=0,v=Object.keys(f);case 21:if(!(d<v.length)){t.next=31;break}return y=v[d],m=f[y].permissions||[],t.next=26,Promise.all(m.filter((function(t){return(t.subject||{}).oauth_id===a||(t.subject||{}).id===a})).map(function(){var t=o(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.FormatPermission({policyId:r,policyWriteToken:i,permission:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 26:(g=t.sent).length>0&&(p[y]=c(c({},f[y]),{},{permissions:g}));case 28:d++,t.next=21;break;case 31:return t.abrupt("return",p);case 32:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"RemoveSubjectPermissions",value:(e=o(n.mark((function t(e){var r,i,a,u,s=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,i=e.policyWriteToken,a=e.subjectId,h("policyId",r),h("policyWriteToken",i),h("subjectId",a),t.next=6,this.SubjectPermissions({policyId:r,policyWriteToken:i,subjectId:a});case 6:return u=t.sent,t.next=9,this.client.utils.LimitedMap(5,Object.keys(u),function(){var t=o(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.RemovePermission({policyId:r,policyWriteToken:i,subjectId:a,itemId:e});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 9:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}();t.exports=d},,,function(t,e,r){var n=r(17).default;function o(){"use strict";
|
|
44
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),u=new P(n||[]);return a(i,"_invoke",{value:x(t,r,u)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d={};function v(){}function y(){}function m(){}var g={};f(g,s,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(j([])));w&&w!==r&&i.call(w,s)&&(g=w);var _=m.prototype=v.prototype=Object.create(g);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var r;a(this,"_invoke",{value:function(o,a){function u(){return new e((function(r,u){!function r(o,a,u,s){var c=p(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,u,s)}),(function(t){r("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return r("throw",t,u,s)}))}s(c.arg)}(o,a,r,u)}))}return r=r?r.then(u,u):u()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=A(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function A(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function j(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:T}}function T(){return{value:void 0,done:!0}}return y.prototype=m,a(_,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:y,configurable:!0}),y.displayName=f(m,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,f(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},k(E.prototype),f(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=j,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),s=i.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(17).default;t.exports=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(25);function o(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}t.exports=function(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n,o,i;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=n<t.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),e.push(o))}var i=e.join("/"),a=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i=a.shift()+(a.length>0?"?":"")+a.join("&")}return function(){return t("object"===a(arguments[0])?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=i():void 0===(o="function"==typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o)},function(t,e,r){var n=r(16),o=r(18),i=r(46);e.ValidatePresence=function(t,e){if(!e)throw Error("".concat(t," not specified"))},e.ValidateLibrary=function(t){if(!t)throw Error("Library ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid library ID: ".concat(t))},e.ValidateObject=function(t){if(!t)throw Error("Object ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid object ID: ".concat(t))},e.ValidateVersion=function(t){if(!t)throw Error("Version hash not specified");if(!t.toString().startsWith("h"))throw Error("Invalid version hash: ".concat(t))},e.ValidateWriteToken=function(t){if(!t)throw Error("Write token not specified");if(!t.toString().startsWith("t"))throw Error("Invalid write token: ".concat(t))},e.ValidatePartHash=function(t){if(!t)throw Error("Part hash not specified");if(!(t.toString().startsWith("hqp_")||t.toString().startsWith("hqpe")||t.toString().startsWith("hqt_")||t.toString().startsWith("hqte")||t.toString().startsWith("hql_")||t.toString().startsWith("hqle")))throw Error("Invalid part hash: ".concat(t))},e.ValidateParameters=function(t){var r=t.libraryId,n=t.objectId,o=t.versionHash,i=t.writeToken;if(i){if(o)throw Error("Cannot specify writeToken and versionHash at same time (token:".concat(i,", hash:").concat(o,")"));e.ValidateWriteToken(i)}else o?e.ValidateVersion(o):(e.ValidateLibrary(r),e.ValidateObject(n))},e.ValidateAddress=function(t){if(!t)throw Error("Address not specified");if(!/^(0x)?[0-9a-f]{40}$/i.test(t.toLowerCase()))throw Error("Invalid address: ".concat(t));return i.FormatAddress(t)},e.ValidatePermission=function(t){if(t&&"full-access"!==t&&"no-access"!==t)throw Error("Invalid profile permission: ".concat(t));return t},e.ValidateDate=function(t){if(t){if(isNaN(new Date(t)))throw Error("Invalid date: ".concat(t));return new Date(t).getTime()}},e.ValidateUserWallet=function(){var t=o(n.mark((function t(e){var r,o;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.address,o=e.client,r){t.next=5;break}throw Error("Address not specified");case 5:if(o){t.next=7;break}throw Error("Client not specified");case 7:return t.next=9,o.userProfileClient.UserWalletAddress({address:r});case 9:if(t.sent){t.next=12;break}throw Error("User address has no wallet: ".concat(r));case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},function(t,e,r){(function(e,n){var o=r(50),i=r(16),a=r(18),u=r(24),s=r(54);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}void 0===globalThis.Buffer&&(globalThis.Buffer=r(19).Buffer);var f,h,p,d=r(58),v=r(61).default,y=r(62),m=r(66),g=r(67),b=r(78).utils,w=b.keccak256,_=b.getAddress,k={name:"Utils",nullAddress:"0x0000000000000000000000000000000000000000",weiPerEther:new v("1000000000000000000"),ToBigNumber:function(t){return new v(t)},WeiToEther:function(t){return k.ToBigNumber(t).div(k.weiPerEther)},EtherToWei:function(t){return k.ToBigNumber(t).times(k.weiPerEther)},FormatAddress:function(t){return t&&"string"==typeof t?((t=t.trim()).startsWith("0x")||(t="0x"+t),t.toLowerCase()):""},FormatSignature:function(t){return t=t.replace("0x",""),"ES256K_"+d.encode(e.from(t,"hex"))},DecodeVersionHash:function(t){if(!t.startsWith("hq__")&&!t.startsWith("tq__"))throw new Error('Invalid version hash: "'.concat(t,'"'));t=t.slice(4);var r=k.FromB58(t),n=r.slice(0,32),o=n.toString("hex");r=r.slice(32);for(var i=0;r[i]>=128;)i++;i++;var a=r.slice(0,i),u=y.decode(a);return r=r.slice(i),{digest:o,size:u,objectId:"iq__"+k.B58(r),partHash:"hqp_"+k.B58(e.concat([n,a]))}},DecodeSignedToken:function(t){var r=k.FromB58(t.slice(6)),n="0x".concat(r.slice(0,65).toString("hex")),o=JSON.parse(e.from(g.inflateRaw(r.slice(65))).toString("utf-8"));return o.adr=k.FormatAddress("0x".concat(e.from(o.adr,"base64").toString("hex"))),{payload:o,signature:n}},DecodeWriteToken:function(t){if(t.length<4)throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'));var e;if(t.startsWith("tqw__")?(e="tq__",t=t.slice(5)):(e=t.slice(0,4),t=t.slice(4)),0===t.length)throw new Error('Invalid write token: ["'.concat(t,'"] (too short)'));switch(e){case"tqw_":case"tq__":case"tqpw":case"tqp_":case"tlro":break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}var r,n,o,i,a,u=k.FromB58(t);function s(t,e){var r,n,o=y.decode(u,0),i=y.decode.bytes;return n=t?0===(r=u.slice(i+1,o+i)).length?"":e+k.B58(r):"0x"+(r=u.slice(i,o+i)).toString("hex"),u=u.slice(o+i),n}switch(e){case"tqw_":case"tqpw":r="0x"+u.toString("hex");break;case"tlro":case"tq__":n=s(!0,"iq__"),o=s(!0,"inod"),r=s(!1,"");break;case"tqp_":if(u.length<3)throw new Error('Invalid write token: ["'.concat(t,'"] (token truncated)'));i=u[0],a=u[1],u=u.slice(2),r=s(!1,"");break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}return{tokenType:e,tokenId:r,objectId:n,nodeId:o,scheme:i,flags:a}},AddressToHash:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t.replace(r?"0x04":"0x",""),d.encode(e.from(t,"hex"))},AddressToSpaceId:function(t){return"ispc"+k.AddressToHash(t)},AddressToNodeId:function(t){return"inod"+k.AddressToHash(t)},AddressToLibraryId:function(t){return"ilib"+k.AddressToHash(t)},AddressToObjectId:function(t){return"iq__"+k.AddressToHash(t)},HashToAddress:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=e?t:t.substr(4),k.FormatAddress((e?"0x04":"0x")+d.decode(t).toString("hex"))},EqualAddress:function(t,e){return!(!t||!e)&&k.FormatAddress(t)===k.FormatAddress(e)},EqualHash:function(t,e){return!(!t||!e)&&(!(t.length<=4||e.length<=4)&&k.HashToAddress(t)===k.HashToAddress(e))},ValidAddress:function(t){try{return _(t),!0}catch(t){return!1}},ValidHash:function(t){return k.ValidAddress(k.HashToAddress(t))},ToBytes32:function(t){return"0x"+t.split("").map((function(t){return t.charCodeAt(0).toString(16)})).join("").slice(0,64).padEnd(64,"0")},BufferToArrayBuffer:function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},FromHex:function(t){return t=t.replace(/^0x/,""),e.from(t,"hex").toString()},B64:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8";return e.from(t,r).toString("base64")},FromB64:function(t){return e.from(t,"base64").toString("utf-8")},FromB64URL:function(t){var e=(t=t.replace(/-/g,"+").replace(/_/g,"/")).length%4;if(e){if(1===e)throw new Error("InvalidLengthError: Input base64url string is the wrong length to determine padding");t+=new Array(5-e).join("=")}return k.FromB64(t)},B58:function(t){return d.encode(e.from(t))},FromB58:function(t){return d.decode(t)},FromB58ToStr:function(t){return(new TextDecoder).decode(k.FromB58(t))},DecodeAuthorizationToken:function(t){var e=(t=decodeURIComponent(t)).split("."),r=s(e,2),n=r[0],o=r[1];return l(l({},n=JSON.parse(k.FromB64(n))),{},{signature:o})},LimitedMap:(p=a(i.mark((function t(e,r,n){var u,s,c,l,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=0,s=!1,c=function(){var t=a(i.mark((function t(){var e;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!s){t.next=5;break}return t.next=3,new Promise((function(t){return setTimeout(t,10)}));case 3:t.next=0;break;case 5:return s=!0,e=u,u+=1,s=!1,t.abrupt("return",e);case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),l=[],f=0,t.abrupt("return",new Promise((function(t,u){o(Array(e||1)).forEach(a(i.mark((function e(){var o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f+=1,e.next=3,c();case 3:o=e.sent;case 4:if(!(o<r.length)){e.next=19;break}return e.prev=5,e.next=8,n(r[o],o);case 8:l[o]=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),u(e.t0);case 14:return e.next=16,c();case 16:o=e.sent,e.next=4;break;case 19:0==(f-=1)&&t(l);case 21:case"end":return e.stop()}}),e,null,[[5,11]])}))))})));case 6:case"end":return t.stop()}}),t)}))),function(t,e,r){return p.apply(this,arguments)}),ResponseToJson:(h=a(i.mark((function t(e){var r,n,o=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]&&o[1],n=o.length>2?o[2]:void 0,t.next=4,k.ResponseToFormat("json",e,r,n);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)}))),function(t){return h.apply(this,arguments)}),ResponseToFormat:(f=a(i.mark((function t(e,r){var n,o,a,u=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=u.length>2&&void 0!==u[2]&&u[2],o=u.length>3?u[3]:void 0,t.next=4,r;case 4:r=t.sent,t.t0=e.toLowerCase(),t.next="json"===t.t0?8:"text"===t.t0?13:"blob"===t.t0?18:"arraybuffer"===t.t0?21:"formdata"===t.t0?24:"buffer"===t.t0?27:30;break;case 8:return t.next=10,r.json();case 10:return a=t.sent,n&&o("response body: ".concat(JSON.stringify(a,null,2))),t.abrupt("return",a);case 13:return t.next=15,r.text();case 15:return a=t.sent,n&&o("response body: ".concat(a)),t.abrupt("return",a);case 18:return t.next=20,r.blob();case 20:return t.abrupt("return",t.sent);case 21:return t.next=23,r.arrayBuffer();case 23:return t.abrupt("return",t.sent);case 24:return t.next=26,r.formData();case 26:return t.abrupt("return",t.sent);case 27:return t.next=29,r.buffer();case 29:return t.abrupt("return",t.sent);case 30:return t.abrupt("return",r);case 31:case"end":return t.stop()}}),t)}))),function(t,e){return f.apply(this,arguments)}),ResizeImage:function(t){var e=t.imageUrl,r=t.height;return!e||e&&!e.startsWith("http")?e:(e=m(e).removeSearch("height").removeSearch("header-x_image_height"),r&&!isNaN(parseInt(r))&&e.addSearch("height",parseInt(r)),e.toString())},SafeTraverse:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(!t)return t;1===r.length&&Array.isArray(r[0])&&(r=r[0]);for(var o=t,i=0;i<r.length;i++)if(void 0===(o=o[r[i]]))return;return o},IsCloneable:function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return k.IsCloneable(t[e])}));case"Map":return o(t.keys()).every(k.IsCloneable)&&o(t.values()).every(k.IsCloneable);case"Set":return o(t.keys()).every(k.IsCloneable);default:return!1}},MakeClonable:function(t){if(k.IsCloneable(t))return t;if(e.isBuffer(t))return k.BufferToArrayBuffer(t);switch({}.toString.call(t).slice(8,-1)){case"Response":case"Function":return;case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return t;case"Array":return t.map((function(t){return k.MakeClonable(t)}));case"Set":return new Set(Array.from(t.keys()).map((function(t){return k.MakeClonable(t)})));case"Map":var r=new Map;return Array.from(t.keys()).forEach((function(e){var n=k.MakeClonable(t.get(e));n&&r.set(e,n)})),r;case"Error":return t.message;case"Object":var n={};return Object.keys(t).map((function(e){var r=k.MakeClonable(t[e]);r&&(n[e]=r)})),n;default:return JSON.parse(JSON.stringify(t))}},PublicKeyToAddress:function(t){var r=new Uint8Array(e.from(t.replace("0x04",""),"hex")),n="0x"+w(r).slice(26);return k.FormatAddress(n)},PLATFORM_NODE:"node",PLATFORM_WEB:"web",PLATFORM_REACT_NATIVE:"react-native",Platform:function(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product?k.PLATFORM_REACT_NATIVE:void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node?k.PLATFORM_NODE:k.PLATFORM_WEB},HLSJSSettings:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.profile,r=void 0===e?"default":e,n="undefined"!=typeof window&&void 0!==window.navigator&&/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),o={maxBufferHole:2.2,nudgeOffset:.2,nudgeMaxRetry:12,highBufferWatchdogPeriod:1};return!n&&["ull","ultraLowLatency"].includes(r)?{lowLatencyMode:!0,liveSyncDuration:4,liveMaxLatencyDuration:5,liveDurationInfinity:!1,maxBufferLength:8,backBufferLength:4,highBufferWatchdogPeriod:1}:["ll","lowLatency","ull","ultraLowLatency"].includes(r)?l({lowLatencyMode:!0,liveSyncDuration:5,liveMaxLatencyDuration:n?15:10,liveDurationInfinity:!1,maxBufferLength:5,backBufferLength:5},o):o},LiveHLSJSSettings:function(t){var e=t.lowLatency,r=void 0!==e&&e,n=t.ultraLowLatency,o=void 0!==n&&n;return k.HLSJSSettings({profile:o?"ull":r?"ll":"default"})}};t.exports=k}).call(this,r(19).Buffer,r(20))},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),a=n[0],u=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],s[l++]=e>>16&255,s[l++]=e>>8&255,s[l++]=255&e;2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,s[l++]=255&e);1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e);return s},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(l(t,a,a+16383>u?u:a+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
|
45
45
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
46
|
-
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,c=s>>1,l=-7,f=r?o-1:0,h=r?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-l)-1,p>>=-l,l+=u;l>0;i=256*i+t[e+f],f+=h,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=h,l-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,s,c=8*i-o-1,l=(1<<c)-1,f=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,
|
|
46
|
+
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,c=s>>1,l=-7,f=r?o-1:0,h=r?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-l)-1,p>>=-l,l+=u;l>0;i=256*i+t[e+f],f+=h,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=h,l-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,s,c=8*i-o-1,l=(1<<c)-1,f=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+f>=1?h/s:h*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=l?(u=0,a=l):a+f>=1?(u=(e*s-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=255&u,p+=d,u/=256,o-=8);for(a=a<<o|u,c+=o;c>0;t[r+p]=255&a,p+=d,a/=256,c-=8);t[r+p-d]|=128*v}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n=r(51),o=r(52),i=r(27),a=r(53);t.exports=function(t){return n(t)||o(t)||i(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(26);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(55),o=r(56),i=r(27),a=r(57);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(59);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(t,e,r){"use strict";var n=r(60).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var o=0;o<t.length;o++){var i=t.charAt(o),a=i.charCodeAt(0);if(255!==e[a])throw new TypeError(i+" is ambiguous");e[a]=o}var u=t.length,s=t.charAt(0),c=Math.log(u)/Math.log(256),l=Math.log(256)/Math.log(u);function f(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,o=0,i=0;t[r]===s;)o++,r++;for(var a=(t.length-r)*c+1>>>0,l=new Uint8Array(a);t[r];){var f=e[t.charCodeAt(r)];if(255===f)return;for(var h=0,p=a-1;(0!==f||h<i)&&-1!==p;p--,h++)f+=u*l[p]>>>0,l[p]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=h,r++}for(var d=a-i;d!==a&&0===l[d];)d++;var v=n.allocUnsafe(o+(a-d));v.fill(0,0,o);for(var y=o;d!==a;)v[y++]=l[d++];return v}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,o=0,i=0,a=e.length;i!==a&&0===e[i];)i++,r++;for(var c=(a-i)*l+1>>>0,f=new Uint8Array(c);i!==a;){for(var h=e[i],p=0,d=c-1;(0!==h||p<o)&&-1!==d;d--,p++)h+=256*f[d]>>>0,f[d]=h%u>>>0,h=h/u>>>0;if(0!==h)throw new Error("Non-zero carry");o=p,i++}for(var v=c-o;v!==c&&0===f[v];)v++;for(var y=s.repeat(r);v<c;++v)y+=t.charAt(f[v]);return y},decodeUnsafe:f,decode:function(t){var e=f(t);if(e)return e;throw new Error("Non-base"+u+" character")}}}},function(t,e,r){
|
|
47
47
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
48
|
-
var n=r(19),o=n.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return o(t,e,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return o(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=o(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){var n;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(i){"use strict";var a,u=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s="function"==typeof Symbol&&"symbol"==o(Symbol.iterator),c=Math.ceil,l=Math.floor,f="[BigNumber Error] ",h=f+"Number primitive has more than 15 significant digits: ",p=1e14,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e9;function v(t){var e=0|t;return t>0||t===e?e:e-1}function y(t){for(var e,r,n=1,o=t.length,i=t[0]+"";n<o;){for(r=14-(e=t[n++]+"").length;r--;e="0"+e);i+=e}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function g(t,e){var r,n,o=t.c,i=e.c,a=t.s,u=e.s,s=t.e,c=e.e;if(!a||!u)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-u:a;if(a!=u)return a;if(r=a<0,n=s==c,!o||!i)return n?0:!o^r?1:-1;if(!n)return s>c^r?1:-1;for(u=(s=o.length)<(c=i.length)?s:c,a=0;a<u;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return s==c?0:s>c^r?1:-1}function b(t,e,r,n){if(t<e||t>r||t!==l(t))throw Error(f+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function w(t){var e=t.c.length-1;return v(t.e/14)==e&&t.c[e]%2!=0}function _(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function k(t,e,r){var n,o;if(e<0){for(o=r+".";++e;o+=r);t=o+t}else if(++e>(n=t.length)){for(o=r,e-=n;--e;o+=r);t+=o}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}(a=function t(e){var r,n,i,a,E,x,A,O,S,P=z.prototype={constructor:z,toString:null,valueOf:null},j=new z(1),T=20,N=4,I=-7,R=21,L=-1e7,C=1e7,M=!1,B=1,F=0,D={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},U="0123456789abcdefghijklmnopqrstuvwxyz";function z(t,e){var r,o,a,s,c,f,p,d,m=this;if(!(m instanceof z))return new z(t,e);if(null==e){if(t&&!0===t._isBigNumber)return m.s=t.s,void(!t.c||t.e>C?m.c=m.e=null:t.e<L?m.c=[m.e=0]:(m.e=t.e,m.c=t.c.slice()));if((f="number"==typeof t)&&0*t==0){if(m.s=1/t<0?(t=-t,-1):1,t===~~t){for(s=0,c=t;c>=10;c/=10,s++);return void(s>C?m.c=m.e=null:(m.e=s,m.c=[t]))}d=String(t)}else{if(!u.test(d=String(t)))return i(m,d,f);m.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(s=d.indexOf("."))>-1&&(d=d.replace(".","")),(c=d.search(/e/i))>0?(s<0&&(s=c),s+=+d.slice(c+1),d=d.substring(0,c)):s<0&&(s=d.length)}else{if(b(e,2,U.length,"Base"),10==e)return K(m=new z(t),T+m.e+1,N);if(d=String(t),f="number"==typeof t){if(0*t!=0)return i(m,d,f,e);if(m.s=1/t<0?(d=d.slice(1),-1):1,z.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(h+t)}else m.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(r=U.slice(0,e),s=c=0,p=d.length;c<p;c++)if(r.indexOf(o=d.charAt(c))<0){if("."==o){if(c>s){s=p;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,c=-1,s=0;continue}return i(m,String(t),f,e)}f=!1,(s=(d=n(d,e,10,m.s)).indexOf("."))>-1?d=d.replace(".",""):s=d.length}for(c=0;48===d.charCodeAt(c);c++);for(p=d.length;48===d.charCodeAt(--p););if(d=d.slice(c,++p)){if(p-=c,f&&z.DEBUG&&p>15&&(t>9007199254740991||t!==l(t)))throw Error(h+m.s*t);if((s=s-c-1)>C)m.c=m.e=null;else if(s<L)m.c=[m.e=0];else{if(m.e=s,m.c=[],c=(s+1)%14,s<0&&(c+=14),c<p){for(c&&m.c.push(+d.slice(0,c)),p-=14;c<p;)m.c.push(+d.slice(c,c+=14));c=14-(d=d.slice(c)).length}else c-=p;for(;c--;d+="0");m.c.push(+d)}}else m.c=[m.e=0]}function G(t,e,r,n){var o,i,a,u,s;if(null==r?r=N:b(r,0,8),!t.c)return t.toString();if(o=t.c[0],a=t.e,null==e)s=y(t.c),s=1==n||2==n&&(a<=I||a>=R)?_(s,a):k(s,a,"0");else if(i=(t=K(new z(t),e,r)).e,u=(s=y(t.c)).length,1==n||2==n&&(e<=i||i<=I)){for(;u<e;s+="0",u++);s=_(s,i)}else if(e-=a,s=k(s,i,"0"),i+1>u){if(--e>0)for(s+=".";e--;s+="0");}else if((e+=i-u)>0)for(i+1==u&&(s+=".");e--;s+="0");return t.s<0&&o?"-"+s:s}function H(t,e){for(var r,n=1,o=new z(t[0]);n<t.length;n++){if(!(r=new z(t[n])).s){o=r;break}e.call(o,r)&&(o=r)}return o}function q(t,e,r){for(var n=1,o=e.length;!e[--o];e.pop());for(o=e[0];o>=10;o/=10,n++);return(r=n+14*r-1)>C?t.c=t.e=null:r<L?t.c=[t.e=0]:(t.e=r,t.c=e),t}function K(t,e,r,n){var o,i,a,u,s,f,h,m=t.c,v=d;if(m){t:{for(o=1,u=m[0];u>=10;u/=10,o++);if((i=e-o)<0)i+=14,a=e,h=(s=m[f=0])/v[o-a-1]%10|0;else if((f=c((i+1)/14))>=m.length){if(!n)break t;for(;m.length<=f;m.push(0));s=h=0,o=1,a=(i%=14)-14+1}else{for(s=u=m[f],o=1;u>=10;u/=10,o++);h=(a=(i%=14)-14+o)<0?0:s/v[o-a-1]%10|0}if(n=n||e<0||null!=m[f+1]||(a<0?s:s%v[o-a-1]),n=r<4?(h||n)&&(0==r||r==(t.s<0?3:2)):h>5||5==h&&(4==r||n||6==r&&(i>0?a>0?s/v[o-a]:0:m[f-1])%10&1||r==(t.s<0?8:7)),e<1||!m[0])return m.length=0,n?(e-=t.e+1,m[0]=v[(14-e%14)%14],t.e=-e||0):m[0]=t.e=0,t;if(0==i?(m.length=f,u=1,f--):(m.length=f+1,u=v[14-i],m[f]=a>0?l(s/v[o-a]%v[a])*u:0),n)for(;;){if(0==f){for(i=1,a=m[0];a>=10;a/=10,i++);for(a=m[0]+=u,u=1;a>=10;a/=10,u++);i!=u&&(t.e++,m[0]==p&&(m[0]=1));break}if(m[f]+=u,m[f]!=p)break;m[f--]=0,u=1}for(i=m.length;0===m[--i];m.pop());}t.e>C?t.c=t.e=null:t.e<L&&(t.c=[t.e=0])}return t}function W(t){var e,r=t.e;return null===r?t.toString():(e=y(t.c),e=r<=I||r>=R?_(e,r):k(e,r,"0"),t.s<0?"-"+e:e)}return z.clone=t,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(t){var e,r;if(null!=t){if("object"!=o(t))throw Error(f+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(b(r=t[e],0,m,e),T=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(b(r=t[e],0,8,e),N=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(b(r[0],-m,0,e),b(r[1],0,m,e),I=r[0],R=r[1]):(b(r,-m,m,e),I=-(R=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)b(r[0],-m,-1,e),b(r[1],1,m,e),L=r[0],C=r[1];else{if(b(r,-m,m,e),!r)throw Error(f+e+" cannot be zero: "+r);L=-(C=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(f+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw M=!r,Error(f+"crypto unavailable");M=r}else M=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(b(r=t[e],0,9,e),B=r),t.hasOwnProperty(e="POW_PRECISION")&&(b(r=t[e],0,m,e),F=r),t.hasOwnProperty(e="FORMAT")){if("object"!=o(r=t[e]))throw Error(f+e+" not an object: "+r);D=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(f+e+" invalid: "+r);U=r}}return{DECIMAL_PLACES:T,ROUNDING_MODE:N,EXPONENTIAL_AT:[I,R],RANGE:[L,C],CRYPTO:M,MODULO_MODE:B,POW_PRECISION:F,FORMAT:D,ALPHABET:U}},z.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!z.DEBUG)return!0;var e,r,n=t.c,o=t.e,i=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-m&&o<=m&&o===l(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break t}if((e=(o+1)%14)<1&&(e+=14),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=p||r!==l(r))break t;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(f+"Invalid BigNumber: "+t)},z.maximum=z.max=function(){return H(arguments,P.lt)},z.minimum=z.min=function(){return H(arguments,P.gt)},z.random=(a=9007199254740992*Math.random()&2097151?function(){return l(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,o,i,u=0,s=[],h=new z(j);if(null==t?t=T:b(t,0,m),o=c(t/14),M)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(o*=2));u<o;)(i=131072*e[u]+(e[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[u]=r[0],e[u+1]=r[1]):(s.push(i%1e14),u+=2);u=o/2}else{if(!crypto.randomBytes)throw M=!1,Error(f+"crypto unavailable");for(e=crypto.randomBytes(o*=7);u<o;)(i=281474976710656*(31&e[u])+1099511627776*e[u+1]+4294967296*e[u+2]+16777216*e[u+3]+(e[u+4]<<16)+(e[u+5]<<8)+e[u+6])>=9e15?crypto.randomBytes(7).copy(e,u):(s.push(i%1e14),u+=7);u=o/7}if(!M)for(;u<o;)(i=a())<9e15&&(s[u++]=i%1e14);for(t%=14,(o=s[--u])&&t&&(i=d[14-t],s[u]=l(o/i)*i);0===s[u];s.pop(),u--);if(u<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=14);for(u=1,i=s[0];i>=10;i/=10,u++);u<14&&(n-=14-u)}return h.e=n,h.c=s,h}),z.sum=function(){for(var t=1,e=arguments,r=new z(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){function t(t,e,r,n){for(var o,i,a=[0],u=0,s=t.length;u<s;){for(i=a.length;i--;a[i]*=e);for(a[0]+=n.indexOf(t.charAt(u++)),o=0;o<a.length;o++)a[o]>r-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(e,n,o,i,a){var u,s,c,l,f,h,p,d,m=e.indexOf("."),v=T,g=N;for(m>=0&&(l=F,F=0,e=e.replace(".",""),h=(d=new z(n)).pow(e.length-m),F=l,d.c=t(k(y(h.c),h.e,"0"),10,o,"0123456789"),d.e=d.c.length),c=l=(p=t(e,n,o,a?(u=U,"0123456789"):(u="0123456789",U))).length;0==p[--l];p.pop());if(!p[0])return u.charAt(0);if(m<0?--c:(h.c=p,h.e=c,h.s=i,p=(h=r(h,d,v,g,o)).c,f=h.r,c=h.e),m=p[s=c+v+1],l=o/2,f=f||s<0||null!=p[s+1],f=g<4?(null!=m||f)&&(0==g||g==(h.s<0?3:2)):m>l||m==l&&(4==g||f||6==g&&1&p[s-1]||g==(h.s<0?8:7)),s<1||!p[0])e=f?k(u.charAt(1),-v,u.charAt(0)):u.charAt(0);else{if(p.length=s,f)for(--o;++p[--s]>o;)p[s]=0,s||(++c,p=[1].concat(p));for(l=p.length;!p[--l];);for(m=0,e="";m<=l;e+=u.charAt(p[m++]));e=k(e,c,u.charAt(0))}return e}}(),r=function(){function t(t,e,r){var n,o,i,a,u=0,s=t.length,c=e%1e7,l=e/1e7|0;for(t=t.slice();s--;)u=((o=c*(i=t[s]%1e7)+(n=l*i+(a=t[s]/1e7|0)*c)%1e7*1e7+u)/r|0)+(n/1e7|0)+l*a,t[s]=o%r;return u&&(t=[u].concat(t)),t}function e(t,e,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;o<r;o++)if(t[o]!=e[o]){i=t[o]>e[o]?1:-1;break}return i}function r(t,e,r,n){for(var o=0;r--;)t[r]-=o,o=t[r]<e[r]?1:0,t[r]=o*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,o,i,a,u){var s,c,f,h,d,m,y,g,b,w,_,k,E,x,A,O,S,P=n.s==o.s?1:-1,j=n.c,T=o.c;if(!(j&&j[0]&&T&&T[0]))return new z(n.s&&o.s&&(j?!T||j[0]!=T[0]:T)?j&&0==j[0]||!T?0*P:P/0:NaN);for(b=(g=new z(P)).c=[],P=i+(c=n.e-o.e)+1,u||(u=p,c=v(n.e/14)-v(o.e/14),P=P/14|0),f=0;T[f]==(j[f]||0);f++);if(T[f]>(j[f]||0)&&c--,P<0)b.push(1),h=!0;else{for(x=j.length,O=T.length,f=0,P+=2,(d=l(u/(T[0]+1)))>1&&(T=t(T,d,u),j=t(j,d,u),O=T.length,x=j.length),E=O,_=(w=j.slice(0,O)).length;_<O;w[_++]=0);S=T.slice(),S=[0].concat(S),A=T[0],T[1]>=u/2&&A++;do{if(d=0,(s=e(T,w,O,_))<0){if(k=w[0],O!=_&&(k=k*u+(w[1]||0)),(d=l(k/A))>1)for(d>=u&&(d=u-1),y=(m=t(T,d,u)).length,_=w.length;1==e(m,w,y,_);)d--,r(m,O<y?S:T,y,u),y=m.length,s=1;else 0==d&&(s=d=1),y=(m=T.slice()).length;if(y<_&&(m=[0].concat(m)),r(w,m,_,u),_=w.length,-1==s)for(;e(T,w,O,_)<1;)d++,r(w,O<_?S:T,_,u),_=w.length}else 0===s&&(d++,w=[0]);b[f++]=d,w[0]?w[_++]=j[E]||0:(w=[j[E]],_=1)}while((E++<x||null!=w[0])&&P--);h=null!=w[0],b[0]||b.splice(0,1)}if(u==p){for(f=1,P=b[0];P>=10;P/=10,f++);K(g,i+(g.e=f+14*c-1)+1,a,h)}else g.e=c,g.r=+h;return g}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,A=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,S=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,r,n){var o,i=r?e:e.replace(S,"");if(O.test(i))t.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(E,(function(t,e,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?t:e})),n&&(o=n,i=i.replace(x,"$1").replace(A,"0.$1")),e!=i))return new z(i,o);if(z.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},P.absoluteValue=P.abs=function(){var t=new z(this);return t.s<0&&(t.s=1),t},P.comparedTo=function(t,e){return g(this,new z(t,e))},P.decimalPlaces=P.dp=function(t,e){var r,n,o,i=this;if(null!=t)return b(t,0,m),null==e?e=N:b(e,0,8),K(new z(i),t+i.e+1,e);if(!(r=i.c))return null;if(n=14*((o=r.length-1)-v(this.e/14)),o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(t,e){return r(this,new z(t,e),T,N)},P.dividedToIntegerBy=P.idiv=function(t,e){return r(this,new z(t,e),0,1)},P.exponentiatedBy=P.pow=function(t,e){var r,n,o,i,a,u,s,h,p=this;if((t=new z(t)).c&&!t.isInteger())throw Error(f+"Exponent not an integer: "+W(t));if(null!=e&&(e=new z(e)),a=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return h=new z(Math.pow(+W(p),a?2-w(t):+W(t))),e?h.mod(e):h;if(u=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new z(NaN);(n=!u&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return i=p.s<0&&w(t)?-0:0,p.e>-1&&(i=1/i),new z(u?1/i:i);F&&(i=c(F/14+2))}for(a?(r=new z(.5),u&&(t.s=1),s=w(t)):s=(o=Math.abs(+W(t)))%2,h=new z(j);;){if(s){if(!(h=h.times(p)).c)break;i?h.c.length>i&&(h.c.length=i):n&&(h=h.mod(e))}if(o){if(0===(o=l(o/2)))break;s=o%2}else if(K(t=t.times(r),t.e+1,1),t.e>14)s=w(t);else{if(0===(o=+W(t)))break;s=o%2}p=p.times(p),i?p.c&&p.c.length>i&&(p.c.length=i):n&&(p=p.mod(e))}return n?h:(u&&(h=j.div(h)),e?h.mod(e):i?K(h,F,N,void 0):h)},P.integerValue=function(t){var e=new z(this);return null==t?t=N:b(t,0,8),K(e,e.e+1,t)},P.isEqualTo=P.eq=function(t,e){return 0===g(this,new z(t,e))},P.isFinite=function(){return!!this.c},P.isGreaterThan=P.gt=function(t,e){return g(this,new z(t,e))>0},P.isGreaterThanOrEqualTo=P.gte=function(t,e){return 1===(e=g(this,new z(t,e)))||0===e},P.isInteger=function(){return!!this.c&&v(this.e/14)>this.c.length-2},P.isLessThan=P.lt=function(t,e){return g(this,new z(t,e))<0},P.isLessThanOrEqualTo=P.lte=function(t,e){return-1===(e=g(this,new z(t,e)))||0===e},P.isNaN=function(){return!this.s},P.isNegative=function(){return this.s<0},P.isPositive=function(){return this.s>0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.minus=function(t,e){var r,n,o,i,a=this,u=a.s;if(e=(t=new z(t,e)).s,!u||!e)return new z(NaN);if(u!=e)return t.s=-e,a.plus(t);var s=a.e/14,c=t.e/14,l=a.c,f=t.c;if(!s||!c){if(!l||!f)return l?(t.s=-e,t):new z(f?a:NaN);if(!l[0]||!f[0])return f[0]?(t.s=-e,t):new z(l[0]?a:3==N?-0:0)}if(s=v(s),c=v(c),l=l.slice(),u=s-c){for((i=u<0)?(u=-u,o=l):(c=s,o=f),o.reverse(),e=u;e--;o.push(0));o.reverse()}else for(n=(i=(u=l.length)<(e=f.length))?u:e,u=e=0;e<n;e++)if(l[e]!=f[e]){i=l[e]<f[e];break}if(i&&(o=l,l=f,f=o,t.s=-t.s),(e=(n=f.length)-(r=l.length))>0)for(;e--;l[r++]=0);for(e=p-1;n>u;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=e);--l[r],l[n]+=p}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?q(t,l,c):(t.s=3==N?-1:1,t.c=[t.e=0],t)},P.modulo=P.mod=function(t,e){var n,o,i=this;return t=new z(t,e),!i.c||!t.s||t.c&&!t.c[0]?new z(NaN):!t.c||i.c&&!i.c[0]?new z(i):(9==B?(o=t.s,t.s=1,n=r(i,t,0,3),t.s=o,n.s*=o):n=r(i,t,0,B),(t=i.minus(n.times(t))).c[0]||1!=B||(t.s=i.s),t)},P.multipliedBy=P.times=function(t,e){var r,n,o,i,a,u,s,c,l,f,h,d,m,y,g=this,b=g.c,w=(t=new z(t,e)).c;if(!(b&&w&&b[0]&&w[0]))return!g.s||!t.s||b&&!b[0]&&!w||w&&!w[0]&&!b?t.c=t.e=t.s=null:(t.s*=g.s,b&&w?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=v(g.e/14)+v(t.e/14),t.s*=g.s,(s=b.length)<(f=w.length)&&(m=b,b=w,w=m,o=s,s=f,f=o),o=s+f,m=[];o--;m.push(0));for(y=p,1e7,o=f;--o>=0;){for(r=0,h=w[o]%1e7,d=w[o]/1e7|0,i=o+(a=s);i>o;)r=((c=h*(c=b[--a]%1e7)+(u=d*c+(l=b[a]/1e7|0)*h)%1e7*1e7+m[i]+r)/y|0)+(u/1e7|0)+d*l,m[i--]=c%y;m[i]=r}return r?++n:m.splice(0,1),q(t,m,n)},P.negated=function(){var t=new z(this);return t.s=-t.s||null,t},P.plus=function(t,e){var r,n=this,o=n.s;if(e=(t=new z(t,e)).s,!o||!e)return new z(NaN);if(o!=e)return t.s=-e,n.minus(t);var i=n.e/14,a=t.e/14,u=n.c,s=t.c;if(!i||!a){if(!u||!s)return new z(o/0);if(!u[0]||!s[0])return s[0]?t:new z(u[0]?n:0*o)}if(i=v(i),a=v(a),u=u.slice(),o=i-a){for(o>0?(a=i,r=s):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(e=s.length)<0&&(r=s,s=u,u=r,e=o),o=0;e;)o=(u[--e]=u[e]+s[e]+o)/p|0,u[e]=p===u[e]?0:u[e]%p;return o&&(u=[o].concat(u),++a),q(t,u,a)},P.precision=P.sd=function(t,e){var r,n,o,i=this;if(null!=t&&t!==!!t)return b(t,1,m),null==e?e=N:b(e,0,8),K(new z(i),t,e);if(!(r=i.c))return null;if(n=14*(o=r.length-1)+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return t&&i.e+1>n&&(n=i.e+1),n},P.shiftedBy=function(t){return b(t,-9007199254740991,9007199254740991),this.times("1e"+t)},P.squareRoot=P.sqrt=function(){var t,e,n,o,i,a=this,u=a.c,s=a.s,c=a.e,l=T+4,f=new z("0.5");if(1!==s||!u||!u[0])return new z(!s||s<0&&(!u||u[0])?NaN:u?a:1/0);if(0==(s=Math.sqrt(+W(a)))||s==1/0?(((e=y(u)).length+c)%2==0&&(e+="0"),s=Math.sqrt(+e),c=v((c+1)/2)-(c<0||c%2),n=new z(e=s==1/0?"1e"+c:(e=s.toExponential()).slice(0,e.indexOf("e")+1)+c)):n=new z(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),y(i.c).slice(0,s)===(e=y(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(e=e.slice(s-3,s+1))&&(o||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(K(n,n.e+T+2,1),t=!n.times(n).eq(a));break}if(!o&&(K(i,i.e+T+2,0),i.times(i).eq(a))){n=i;break}l+=4,s+=4,o=1}return K(n,n.e+T+1,N,t)},P.toExponential=function(t,e){return null!=t&&(b(t,0,m),t++),G(this,t,e,1)},P.toFixed=function(t,e){return null!=t&&(b(t,0,m),t=t+this.e+1),G(this,t,e)},P.toFormat=function(t,e,r){var n,i=this;if(null==r)null!=t&&e&&"object"==o(e)?(r=e,e=null):t&&"object"==o(t)?(r=t,t=e=null):r=D;else if("object"!=o(r))throw Error(f+"Argument not an object: "+r);if(n=i.toFixed(t,e),i.c){var a,u=n.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",h=u[0],p=u[1],d=i.s<0,m=d?h.slice(1):h,v=m.length;if(c&&(a=s,s=c,c=a,v-=a),s>0&&v>0){for(a=v%s||s,h=m.substr(0,a);a<v;a+=s)h+=l+m.substr(a,s);c>0&&(h+=l+m.slice(a)),d&&(h="-"+h)}n=p?h+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):h}return(r.prefix||"")+n+(r.suffix||"")},P.toFraction=function(t){var e,n,o,i,a,u,s,c,l,h,p,m,v=this,g=v.c;if(null!=t&&(!(s=new z(t)).isInteger()&&(s.c||1!==s.s)||s.lt(j)))throw Error(f+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+W(s));if(!g)return new z(v);for(e=new z(j),l=n=new z(j),o=c=new z(j),m=y(g),a=e.e=m.length-v.e-1,e.c[0]=d[(u=a%14)<0?14+u:u],t=!t||s.comparedTo(e)>0?a>0?e:l:s,u=C,C=1/0,s=new z(m),c.c[0]=0;h=r(s,e,0,1),1!=(i=n.plus(h.times(o))).comparedTo(t);)n=o,o=i,l=c.plus(h.times(i=l)),c=i,e=s.minus(h.times(i=e)),s=i;return i=r(t.minus(n),o,0,1),c=c.plus(i.times(l)),n=n.plus(i.times(o)),c.s=l.s=v.s,p=r(l,o,a*=2,N).minus(v).abs().comparedTo(r(c,n,a,N).minus(v).abs())<1?[l,o]:[c,n],C=u,p},P.toNumber=function(){return+W(this)},P.toPrecision=function(t,e){return null!=t&&b(t,1,m),G(this,t,e,2)},P.toString=function(t){var e,r=this,o=r.s,i=r.e;return null===i?o?(e="Infinity",o<0&&(e="-"+e)):e="NaN":(null==t?e=i<=I||i>=R?_(y(r.c),i):k(y(r.c),i,"0"):10===t?e=k(y((r=K(new z(r),T+i+1,N)).c),r.e,"0"):(b(t,2,U.length,"Base"),e=n(k(y(r.c),i,"0"),10,t,o,!0)),o<0&&r.c[0]&&(e="-"+e)),e},P.valueOf=P.toJSON=function(){return W(this)},P._isBigNumber=!0,s&&(P[Symbol.toStringTag]="BigNumber",P[Symbol.for("nodejs.util.inspect.custom")]=P.valueOf),null!=e&&z.set(e),z}()).default=a.BigNumber=a,void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},function(t,e,r){t.exports={encode:r(63),decode:r(64),encodingLength:r(65)}},function(t,e){t.exports=function t(e,n,o){n=n||[];var i=o=o||0;for(;e>=r;)n[o++]=255&e|128,e/=128;for(;-128&e;)n[o++]=255&e|128,e>>>=7;return n[o]=0|e,t.bytes=o-i+1,n};var r=Math.pow(2,31)},function(t,e){t.exports=function t(e,r){var n,o=0,i=0,a=r=r||0,u=e.length;do{if(a>=u)throw t.bytes=0,new RangeError("Could not decode varint");n=e[a++],o+=i<28?(127&n)<<i:(127&n)*Math.pow(2,i),i+=7}while(n>=128);return t.bytes=a-r,o}},function(t,e){var r=Math.pow(2,7),n=Math.pow(2,14),o=Math.pow(2,21),i=Math.pow(2,28),a=Math.pow(2,35),u=Math.pow(2,42),s=Math.pow(2,49),c=Math.pow(2,56),l=Math.pow(2,63);t.exports=function(t){return t<r?1:t<n?2:t<o?3:t<i?4:t<a?5:t<u?6:t<s?7:t<c?8:t<l?9:10}},function(t,e,r){(function(t){var n,o,i;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
|
|
48
|
+
var n=r(19),o=n.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return o(t,e,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return o(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=o(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){var n;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(i){"use strict";var a,u=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s="function"==typeof Symbol&&"symbol"==o(Symbol.iterator),c=Math.ceil,l=Math.floor,f="[BigNumber Error] ",h=f+"Number primitive has more than 15 significant digits: ",p=1e14,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],v=1e9;function y(t){var e=0|t;return t>0||t===e?e:e-1}function m(t){for(var e,r,n=1,o=t.length,i=t[0]+"";n<o;){for(r=14-(e=t[n++]+"").length;r--;e="0"+e);i+=e}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function g(t,e){var r,n,o=t.c,i=e.c,a=t.s,u=e.s,s=t.e,c=e.e;if(!a||!u)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-u:a;if(a!=u)return a;if(r=a<0,n=s==c,!o||!i)return n?0:!o^r?1:-1;if(!n)return s>c^r?1:-1;for(u=(s=o.length)<(c=i.length)?s:c,a=0;a<u;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return s==c?0:s>c^r?1:-1}function b(t,e,r,n){if(t<e||t>r||t!==l(t))throw Error(f+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function w(t){var e=t.c.length-1;return y(t.e/14)==e&&t.c[e]%2!=0}function _(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function k(t,e,r){var n,o;if(e<0){for(o=r+".";++e;o+=r);t=o+t}else if(++e>(n=t.length)){for(o=r,e-=n;--e;o+=r);t+=o}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}(a=function t(e){var r,n,i,a,E,x,A,O,S,P=z.prototype={constructor:z,toString:null,valueOf:null},j=new z(1),T=20,R=4,N=-7,I=21,L=-1e7,C=1e7,M=!1,B=1,F=0,D={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},U="0123456789abcdefghijklmnopqrstuvwxyz";function z(t,e){var r,o,a,s,c,f,p,d,v=this;if(!(v instanceof z))return new z(t,e);if(null==e){if(t&&!0===t._isBigNumber)return v.s=t.s,void(!t.c||t.e>C?v.c=v.e=null:t.e<L?v.c=[v.e=0]:(v.e=t.e,v.c=t.c.slice()));if((f="number"==typeof t)&&0*t==0){if(v.s=1/t<0?(t=-t,-1):1,t===~~t){for(s=0,c=t;c>=10;c/=10,s++);return void(s>C?v.c=v.e=null:(v.e=s,v.c=[t]))}d=String(t)}else{if(!u.test(d=String(t)))return i(v,d,f);v.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(s=d.indexOf("."))>-1&&(d=d.replace(".","")),(c=d.search(/e/i))>0?(s<0&&(s=c),s+=+d.slice(c+1),d=d.substring(0,c)):s<0&&(s=d.length)}else{if(b(e,2,U.length,"Base"),10==e)return K(v=new z(t),T+v.e+1,R);if(d=String(t),f="number"==typeof t){if(0*t!=0)return i(v,d,f,e);if(v.s=1/t<0?(d=d.slice(1),-1):1,z.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(h+t)}else v.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(r=U.slice(0,e),s=c=0,p=d.length;c<p;c++)if(r.indexOf(o=d.charAt(c))<0){if("."==o){if(c>s){s=p;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,c=-1,s=0;continue}return i(v,String(t),f,e)}f=!1,(s=(d=n(d,e,10,v.s)).indexOf("."))>-1?d=d.replace(".",""):s=d.length}for(c=0;48===d.charCodeAt(c);c++);for(p=d.length;48===d.charCodeAt(--p););if(d=d.slice(c,++p)){if(p-=c,f&&z.DEBUG&&p>15&&(t>9007199254740991||t!==l(t)))throw Error(h+v.s*t);if((s=s-c-1)>C)v.c=v.e=null;else if(s<L)v.c=[v.e=0];else{if(v.e=s,v.c=[],c=(s+1)%14,s<0&&(c+=14),c<p){for(c&&v.c.push(+d.slice(0,c)),p-=14;c<p;)v.c.push(+d.slice(c,c+=14));c=14-(d=d.slice(c)).length}else c-=p;for(;c--;d+="0");v.c.push(+d)}}else v.c=[v.e=0]}function G(t,e,r,n){var o,i,a,u,s;if(null==r?r=R:b(r,0,8),!t.c)return t.toString();if(o=t.c[0],a=t.e,null==e)s=m(t.c),s=1==n||2==n&&(a<=N||a>=I)?_(s,a):k(s,a,"0");else if(i=(t=K(new z(t),e,r)).e,u=(s=m(t.c)).length,1==n||2==n&&(e<=i||i<=N)){for(;u<e;s+="0",u++);s=_(s,i)}else if(e-=a,s=k(s,i,"0"),i+1>u){if(--e>0)for(s+=".";e--;s+="0");}else if((e+=i-u)>0)for(i+1==u&&(s+=".");e--;s+="0");return t.s<0&&o?"-"+s:s}function H(t,e){for(var r,n=1,o=new z(t[0]);n<t.length;n++){if(!(r=new z(t[n])).s){o=r;break}e.call(o,r)&&(o=r)}return o}function q(t,e,r){for(var n=1,o=e.length;!e[--o];e.pop());for(o=e[0];o>=10;o/=10,n++);return(r=n+14*r-1)>C?t.c=t.e=null:r<L?t.c=[t.e=0]:(t.e=r,t.c=e),t}function K(t,e,r,n){var o,i,a,u,s,f,h,v=t.c,y=d;if(v){t:{for(o=1,u=v[0];u>=10;u/=10,o++);if((i=e-o)<0)i+=14,a=e,h=(s=v[f=0])/y[o-a-1]%10|0;else if((f=c((i+1)/14))>=v.length){if(!n)break t;for(;v.length<=f;v.push(0));s=h=0,o=1,a=(i%=14)-14+1}else{for(s=u=v[f],o=1;u>=10;u/=10,o++);h=(a=(i%=14)-14+o)<0?0:s/y[o-a-1]%10|0}if(n=n||e<0||null!=v[f+1]||(a<0?s:s%y[o-a-1]),n=r<4?(h||n)&&(0==r||r==(t.s<0?3:2)):h>5||5==h&&(4==r||n||6==r&&(i>0?a>0?s/y[o-a]:0:v[f-1])%10&1||r==(t.s<0?8:7)),e<1||!v[0])return v.length=0,n?(e-=t.e+1,v[0]=y[(14-e%14)%14],t.e=-e||0):v[0]=t.e=0,t;if(0==i?(v.length=f,u=1,f--):(v.length=f+1,u=y[14-i],v[f]=a>0?l(s/y[o-a]%y[a])*u:0),n)for(;;){if(0==f){for(i=1,a=v[0];a>=10;a/=10,i++);for(a=v[0]+=u,u=1;a>=10;a/=10,u++);i!=u&&(t.e++,v[0]==p&&(v[0]=1));break}if(v[f]+=u,v[f]!=p)break;v[f--]=0,u=1}for(i=v.length;0===v[--i];v.pop());}t.e>C?t.c=t.e=null:t.e<L&&(t.c=[t.e=0])}return t}function W(t){var e,r=t.e;return null===r?t.toString():(e=m(t.c),e=r<=N||r>=I?_(e,r):k(e,r,"0"),t.s<0?"-"+e:e)}return z.clone=t,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(t){var e,r;if(null!=t){if("object"!=o(t))throw Error(f+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(b(r=t[e],0,v,e),T=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(b(r=t[e],0,8,e),R=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(b(r[0],-v,0,e),b(r[1],0,v,e),N=r[0],I=r[1]):(b(r,-v,v,e),N=-(I=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)b(r[0],-v,-1,e),b(r[1],1,v,e),L=r[0],C=r[1];else{if(b(r,-v,v,e),!r)throw Error(f+e+" cannot be zero: "+r);L=-(C=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(f+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw M=!r,Error(f+"crypto unavailable");M=r}else M=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(b(r=t[e],0,9,e),B=r),t.hasOwnProperty(e="POW_PRECISION")&&(b(r=t[e],0,v,e),F=r),t.hasOwnProperty(e="FORMAT")){if("object"!=o(r=t[e]))throw Error(f+e+" not an object: "+r);D=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(f+e+" invalid: "+r);U=r}}return{DECIMAL_PLACES:T,ROUNDING_MODE:R,EXPONENTIAL_AT:[N,I],RANGE:[L,C],CRYPTO:M,MODULO_MODE:B,POW_PRECISION:F,FORMAT:D,ALPHABET:U}},z.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!z.DEBUG)return!0;var e,r,n=t.c,o=t.e,i=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-v&&o<=v&&o===l(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break t}if((e=(o+1)%14)<1&&(e+=14),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=p||r!==l(r))break t;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(f+"Invalid BigNumber: "+t)},z.maximum=z.max=function(){return H(arguments,P.lt)},z.minimum=z.min=function(){return H(arguments,P.gt)},z.random=(a=9007199254740992*Math.random()&2097151?function(){return l(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,o,i,u=0,s=[],h=new z(j);if(null==t?t=T:b(t,0,v),o=c(t/14),M)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(o*=2));u<o;)(i=131072*e[u]+(e[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[u]=r[0],e[u+1]=r[1]):(s.push(i%1e14),u+=2);u=o/2}else{if(!crypto.randomBytes)throw M=!1,Error(f+"crypto unavailable");for(e=crypto.randomBytes(o*=7);u<o;)(i=281474976710656*(31&e[u])+1099511627776*e[u+1]+4294967296*e[u+2]+16777216*e[u+3]+(e[u+4]<<16)+(e[u+5]<<8)+e[u+6])>=9e15?crypto.randomBytes(7).copy(e,u):(s.push(i%1e14),u+=7);u=o/7}if(!M)for(;u<o;)(i=a())<9e15&&(s[u++]=i%1e14);for(t%=14,(o=s[--u])&&t&&(i=d[14-t],s[u]=l(o/i)*i);0===s[u];s.pop(),u--);if(u<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=14);for(u=1,i=s[0];i>=10;i/=10,u++);u<14&&(n-=14-u)}return h.e=n,h.c=s,h}),z.sum=function(){for(var t=1,e=arguments,r=new z(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){function t(t,e,r,n){for(var o,i,a=[0],u=0,s=t.length;u<s;){for(i=a.length;i--;a[i]*=e);for(a[0]+=n.indexOf(t.charAt(u++)),o=0;o<a.length;o++)a[o]>r-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(e,n,o,i,a){var u,s,c,l,f,h,p,d,v=e.indexOf("."),y=T,g=R;for(v>=0&&(l=F,F=0,e=e.replace(".",""),h=(d=new z(n)).pow(e.length-v),F=l,d.c=t(k(m(h.c),h.e,"0"),10,o,"0123456789"),d.e=d.c.length),c=l=(p=t(e,n,o,a?(u=U,"0123456789"):(u="0123456789",U))).length;0==p[--l];p.pop());if(!p[0])return u.charAt(0);if(v<0?--c:(h.c=p,h.e=c,h.s=i,p=(h=r(h,d,y,g,o)).c,f=h.r,c=h.e),v=p[s=c+y+1],l=o/2,f=f||s<0||null!=p[s+1],f=g<4?(null!=v||f)&&(0==g||g==(h.s<0?3:2)):v>l||v==l&&(4==g||f||6==g&&1&p[s-1]||g==(h.s<0?8:7)),s<1||!p[0])e=f?k(u.charAt(1),-y,u.charAt(0)):u.charAt(0);else{if(p.length=s,f)for(--o;++p[--s]>o;)p[s]=0,s||(++c,p=[1].concat(p));for(l=p.length;!p[--l];);for(v=0,e="";v<=l;e+=u.charAt(p[v++]));e=k(e,c,u.charAt(0))}return e}}(),r=function(){function t(t,e,r){var n,o,i,a,u=0,s=t.length,c=e%1e7,l=e/1e7|0;for(t=t.slice();s--;)u=((o=c*(i=t[s]%1e7)+(n=l*i+(a=t[s]/1e7|0)*c)%1e7*1e7+u)/r|0)+(n/1e7|0)+l*a,t[s]=o%r;return u&&(t=[u].concat(t)),t}function e(t,e,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;o<r;o++)if(t[o]!=e[o]){i=t[o]>e[o]?1:-1;break}return i}function r(t,e,r,n){for(var o=0;r--;)t[r]-=o,o=t[r]<e[r]?1:0,t[r]=o*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,o,i,a,u){var s,c,f,h,d,v,m,g,b,w,_,k,E,x,A,O,S,P=n.s==o.s?1:-1,j=n.c,T=o.c;if(!(j&&j[0]&&T&&T[0]))return new z(n.s&&o.s&&(j?!T||j[0]!=T[0]:T)?j&&0==j[0]||!T?0*P:P/0:NaN);for(b=(g=new z(P)).c=[],P=i+(c=n.e-o.e)+1,u||(u=p,c=y(n.e/14)-y(o.e/14),P=P/14|0),f=0;T[f]==(j[f]||0);f++);if(T[f]>(j[f]||0)&&c--,P<0)b.push(1),h=!0;else{for(x=j.length,O=T.length,f=0,P+=2,(d=l(u/(T[0]+1)))>1&&(T=t(T,d,u),j=t(j,d,u),O=T.length,x=j.length),E=O,_=(w=j.slice(0,O)).length;_<O;w[_++]=0);S=T.slice(),S=[0].concat(S),A=T[0],T[1]>=u/2&&A++;do{if(d=0,(s=e(T,w,O,_))<0){if(k=w[0],O!=_&&(k=k*u+(w[1]||0)),(d=l(k/A))>1)for(d>=u&&(d=u-1),m=(v=t(T,d,u)).length,_=w.length;1==e(v,w,m,_);)d--,r(v,O<m?S:T,m,u),m=v.length,s=1;else 0==d&&(s=d=1),m=(v=T.slice()).length;if(m<_&&(v=[0].concat(v)),r(w,v,_,u),_=w.length,-1==s)for(;e(T,w,O,_)<1;)d++,r(w,O<_?S:T,_,u),_=w.length}else 0===s&&(d++,w=[0]);b[f++]=d,w[0]?w[_++]=j[E]||0:(w=[j[E]],_=1)}while((E++<x||null!=w[0])&&P--);h=null!=w[0],b[0]||b.splice(0,1)}if(u==p){for(f=1,P=b[0];P>=10;P/=10,f++);K(g,i+(g.e=f+14*c-1)+1,a,h)}else g.e=c,g.r=+h;return g}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,A=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,S=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,r,n){var o,i=r?e:e.replace(S,"");if(O.test(i))t.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(E,(function(t,e,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?t:e})),n&&(o=n,i=i.replace(x,"$1").replace(A,"0.$1")),e!=i))return new z(i,o);if(z.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},P.absoluteValue=P.abs=function(){var t=new z(this);return t.s<0&&(t.s=1),t},P.comparedTo=function(t,e){return g(this,new z(t,e))},P.decimalPlaces=P.dp=function(t,e){var r,n,o,i=this;if(null!=t)return b(t,0,v),null==e?e=R:b(e,0,8),K(new z(i),t+i.e+1,e);if(!(r=i.c))return null;if(n=14*((o=r.length-1)-y(this.e/14)),o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(t,e){return r(this,new z(t,e),T,R)},P.dividedToIntegerBy=P.idiv=function(t,e){return r(this,new z(t,e),0,1)},P.exponentiatedBy=P.pow=function(t,e){var r,n,o,i,a,u,s,h,p=this;if((t=new z(t)).c&&!t.isInteger())throw Error(f+"Exponent not an integer: "+W(t));if(null!=e&&(e=new z(e)),a=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return h=new z(Math.pow(+W(p),a?2-w(t):+W(t))),e?h.mod(e):h;if(u=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new z(NaN);(n=!u&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return i=p.s<0&&w(t)?-0:0,p.e>-1&&(i=1/i),new z(u?1/i:i);F&&(i=c(F/14+2))}for(a?(r=new z(.5),u&&(t.s=1),s=w(t)):s=(o=Math.abs(+W(t)))%2,h=new z(j);;){if(s){if(!(h=h.times(p)).c)break;i?h.c.length>i&&(h.c.length=i):n&&(h=h.mod(e))}if(o){if(0===(o=l(o/2)))break;s=o%2}else if(K(t=t.times(r),t.e+1,1),t.e>14)s=w(t);else{if(0===(o=+W(t)))break;s=o%2}p=p.times(p),i?p.c&&p.c.length>i&&(p.c.length=i):n&&(p=p.mod(e))}return n?h:(u&&(h=j.div(h)),e?h.mod(e):i?K(h,F,R,void 0):h)},P.integerValue=function(t){var e=new z(this);return null==t?t=R:b(t,0,8),K(e,e.e+1,t)},P.isEqualTo=P.eq=function(t,e){return 0===g(this,new z(t,e))},P.isFinite=function(){return!!this.c},P.isGreaterThan=P.gt=function(t,e){return g(this,new z(t,e))>0},P.isGreaterThanOrEqualTo=P.gte=function(t,e){return 1===(e=g(this,new z(t,e)))||0===e},P.isInteger=function(){return!!this.c&&y(this.e/14)>this.c.length-2},P.isLessThan=P.lt=function(t,e){return g(this,new z(t,e))<0},P.isLessThanOrEqualTo=P.lte=function(t,e){return-1===(e=g(this,new z(t,e)))||0===e},P.isNaN=function(){return!this.s},P.isNegative=function(){return this.s<0},P.isPositive=function(){return this.s>0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.minus=function(t,e){var r,n,o,i,a=this,u=a.s;if(e=(t=new z(t,e)).s,!u||!e)return new z(NaN);if(u!=e)return t.s=-e,a.plus(t);var s=a.e/14,c=t.e/14,l=a.c,f=t.c;if(!s||!c){if(!l||!f)return l?(t.s=-e,t):new z(f?a:NaN);if(!l[0]||!f[0])return f[0]?(t.s=-e,t):new z(l[0]?a:3==R?-0:0)}if(s=y(s),c=y(c),l=l.slice(),u=s-c){for((i=u<0)?(u=-u,o=l):(c=s,o=f),o.reverse(),e=u;e--;o.push(0));o.reverse()}else for(n=(i=(u=l.length)<(e=f.length))?u:e,u=e=0;e<n;e++)if(l[e]!=f[e]){i=l[e]<f[e];break}if(i&&(o=l,l=f,f=o,t.s=-t.s),(e=(n=f.length)-(r=l.length))>0)for(;e--;l[r++]=0);for(e=p-1;n>u;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=e);--l[r],l[n]+=p}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?q(t,l,c):(t.s=3==R?-1:1,t.c=[t.e=0],t)},P.modulo=P.mod=function(t,e){var n,o,i=this;return t=new z(t,e),!i.c||!t.s||t.c&&!t.c[0]?new z(NaN):!t.c||i.c&&!i.c[0]?new z(i):(9==B?(o=t.s,t.s=1,n=r(i,t,0,3),t.s=o,n.s*=o):n=r(i,t,0,B),(t=i.minus(n.times(t))).c[0]||1!=B||(t.s=i.s),t)},P.multipliedBy=P.times=function(t,e){var r,n,o,i,a,u,s,c,l,f,h,d,v,m,g=this,b=g.c,w=(t=new z(t,e)).c;if(!(b&&w&&b[0]&&w[0]))return!g.s||!t.s||b&&!b[0]&&!w||w&&!w[0]&&!b?t.c=t.e=t.s=null:(t.s*=g.s,b&&w?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=y(g.e/14)+y(t.e/14),t.s*=g.s,(s=b.length)<(f=w.length)&&(v=b,b=w,w=v,o=s,s=f,f=o),o=s+f,v=[];o--;v.push(0));for(m=p,1e7,o=f;--o>=0;){for(r=0,h=w[o]%1e7,d=w[o]/1e7|0,i=o+(a=s);i>o;)r=((c=h*(c=b[--a]%1e7)+(u=d*c+(l=b[a]/1e7|0)*h)%1e7*1e7+v[i]+r)/m|0)+(u/1e7|0)+d*l,v[i--]=c%m;v[i]=r}return r?++n:v.splice(0,1),q(t,v,n)},P.negated=function(){var t=new z(this);return t.s=-t.s||null,t},P.plus=function(t,e){var r,n=this,o=n.s;if(e=(t=new z(t,e)).s,!o||!e)return new z(NaN);if(o!=e)return t.s=-e,n.minus(t);var i=n.e/14,a=t.e/14,u=n.c,s=t.c;if(!i||!a){if(!u||!s)return new z(o/0);if(!u[0]||!s[0])return s[0]?t:new z(u[0]?n:0*o)}if(i=y(i),a=y(a),u=u.slice(),o=i-a){for(o>0?(a=i,r=s):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(e=s.length)<0&&(r=s,s=u,u=r,e=o),o=0;e;)o=(u[--e]=u[e]+s[e]+o)/p|0,u[e]=p===u[e]?0:u[e]%p;return o&&(u=[o].concat(u),++a),q(t,u,a)},P.precision=P.sd=function(t,e){var r,n,o,i=this;if(null!=t&&t!==!!t)return b(t,1,v),null==e?e=R:b(e,0,8),K(new z(i),t,e);if(!(r=i.c))return null;if(n=14*(o=r.length-1)+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return t&&i.e+1>n&&(n=i.e+1),n},P.shiftedBy=function(t){return b(t,-9007199254740991,9007199254740991),this.times("1e"+t)},P.squareRoot=P.sqrt=function(){var t,e,n,o,i,a=this,u=a.c,s=a.s,c=a.e,l=T+4,f=new z("0.5");if(1!==s||!u||!u[0])return new z(!s||s<0&&(!u||u[0])?NaN:u?a:1/0);if(0==(s=Math.sqrt(+W(a)))||s==1/0?(((e=m(u)).length+c)%2==0&&(e+="0"),s=Math.sqrt(+e),c=y((c+1)/2)-(c<0||c%2),n=new z(e=s==1/0?"1e"+c:(e=s.toExponential()).slice(0,e.indexOf("e")+1)+c)):n=new z(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),m(i.c).slice(0,s)===(e=m(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(e=e.slice(s-3,s+1))&&(o||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(K(n,n.e+T+2,1),t=!n.times(n).eq(a));break}if(!o&&(K(i,i.e+T+2,0),i.times(i).eq(a))){n=i;break}l+=4,s+=4,o=1}return K(n,n.e+T+1,R,t)},P.toExponential=function(t,e){return null!=t&&(b(t,0,v),t++),G(this,t,e,1)},P.toFixed=function(t,e){return null!=t&&(b(t,0,v),t=t+this.e+1),G(this,t,e)},P.toFormat=function(t,e,r){var n,i=this;if(null==r)null!=t&&e&&"object"==o(e)?(r=e,e=null):t&&"object"==o(t)?(r=t,t=e=null):r=D;else if("object"!=o(r))throw Error(f+"Argument not an object: "+r);if(n=i.toFixed(t,e),i.c){var a,u=n.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",h=u[0],p=u[1],d=i.s<0,v=d?h.slice(1):h,y=v.length;if(c&&(a=s,s=c,c=a,y-=a),s>0&&y>0){for(a=y%s||s,h=v.substr(0,a);a<y;a+=s)h+=l+v.substr(a,s);c>0&&(h+=l+v.slice(a)),d&&(h="-"+h)}n=p?h+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):h}return(r.prefix||"")+n+(r.suffix||"")},P.toFraction=function(t){var e,n,o,i,a,u,s,c,l,h,p,v,y=this,g=y.c;if(null!=t&&(!(s=new z(t)).isInteger()&&(s.c||1!==s.s)||s.lt(j)))throw Error(f+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+W(s));if(!g)return new z(y);for(e=new z(j),l=n=new z(j),o=c=new z(j),v=m(g),a=e.e=v.length-y.e-1,e.c[0]=d[(u=a%14)<0?14+u:u],t=!t||s.comparedTo(e)>0?a>0?e:l:s,u=C,C=1/0,s=new z(v),c.c[0]=0;h=r(s,e,0,1),1!=(i=n.plus(h.times(o))).comparedTo(t);)n=o,o=i,l=c.plus(h.times(i=l)),c=i,e=s.minus(h.times(i=e)),s=i;return i=r(t.minus(n),o,0,1),c=c.plus(i.times(l)),n=n.plus(i.times(o)),c.s=l.s=y.s,p=r(l,o,a*=2,R).minus(y).abs().comparedTo(r(c,n,a,R).minus(y).abs())<1?[l,o]:[c,n],C=u,p},P.toNumber=function(){return+W(this)},P.toPrecision=function(t,e){return null!=t&&b(t,1,v),G(this,t,e,2)},P.toString=function(t){var e,r=this,o=r.s,i=r.e;return null===i?o?(e="Infinity",o<0&&(e="-"+e)):e="NaN":(null==t?e=i<=N||i>=I?_(m(r.c),i):k(m(r.c),i,"0"):10===t?e=k(m((r=K(new z(r),T+i+1,R)).c),r.e,"0"):(b(t,2,U.length,"Base"),e=n(k(m(r.c),i,"0"),10,t,o,!0)),o<0&&r.c[0]&&(e="-"+e)),e},P.valueOf=P.toJSON=function(){return W(this)},P._isBigNumber=!0,s&&(P[Symbol.toStringTag]="BigNumber",P[Symbol.for("nodejs.util.inspect.custom")]=P.valueOf),null!=e&&z.set(e),z}()).default=a.BigNumber=a,void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},function(t,e,r){t.exports={encode:r(63),decode:r(64),encodingLength:r(65)}},function(t,e){t.exports=function t(e,n,o){n=n||[];var i=o=o||0;for(;e>=r;)n[o++]=255&e|128,e/=128;for(;-128&e;)n[o++]=255&e|128,e>>>=7;return n[o]=0|e,t.bytes=o-i+1,n};var r=Math.pow(2,31)},function(t,e){t.exports=function t(e,r){var n,o=0,i=0,a=r=r||0,u=e.length;do{if(a>=u)throw t.bytes=0,new RangeError("Could not decode varint");n=e[a++],o+=i<28?(127&n)<<i:(127&n)*Math.pow(2,i),i+=7}while(n>=128);return t.bytes=a-r,o}},function(t,e){var r=Math.pow(2,7),n=Math.pow(2,14),o=Math.pow(2,21),i=Math.pow(2,28),a=Math.pow(2,35),u=Math.pow(2,42),s=Math.pow(2,49),c=Math.pow(2,56),l=Math.pow(2,63);t.exports=function(t){return t<r?1:t<n?2:t<o?3:t<i?4:t<a?5:t<u?6:t<s?7:t<c?8:t<l?9:10}},function(t,e,r){(function(t){var n,o,i;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
|
|
49
49
|
/*!
|
|
50
50
|
* URI.js - Mutating URLs
|
|
51
51
|
*
|
|
@@ -57,4 +57,4 @@ var n=r(19),o=n.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r
|
|
|
57
57
|
* Licensed under
|
|
58
58
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
59
59
|
*
|
|
60
|
-
*/!function(u,s){"use strict";"object"===a(t)&&t.exports?t.exports=s(r(28),r(29),r(30)):(o=[r(28),r(29),r(30)],void 0===(i="function"==typeof(n=s)?n.apply(e,o):n)||(t.exports=i))}(0,(function(t,e,r,n){"use strict";var o=n&&n.URI;function i(t,e){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof i))return r?n?new i(t,e):new i(t):new i;if(void 0===t){if(r)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&r)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}i.version="1.19.11";var u=i.prototype,s=Object.prototype.hasOwnProperty;function c(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function f(t){return"Array"===l(t)}function h(t,e){var r,n,o={};if("RegExp"===l(e))o=null;else if(f(e))for(r=0,n=e.length;r<n;r++)o[e[r]]=!0;else o[e]=!0;for(r=0,n=t.length;r<n;r++){(o&&void 0!==o[t[r]]||!o&&e.test(t[r]))&&(t.splice(r,1),n--,r--)}return t}function p(t,e){var r,n;if(f(e)){for(r=0,n=e.length;r<n;r++)if(!p(t,e[r]))return!1;return!0}var o=l(e);for(r=0,n=t.length;r<n;r++)if("RegExp"===o){if("string"==typeof t[r]&&t[r].match(e))return!0}else if(t[r]===e)return!0;return!1}function d(t,e){if(!f(t)||!f(e))return!1;if(t.length!==e.length)return!1;t.sort(),e.sort();for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0}function m(t){return t.replace(/^\/+|\/+$/g,"")}function v(t){return escape(t)}function y(t){return encodeURIComponent(t).replace(/[!'()*]/g,v).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return i.domAttributes[e]}},i.encode=y,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=y,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(t,e){var r=i.encode(t+"");return void 0===e&&(e=i.escapeQuerySpace),e?r.replace(/%20/g,"+"):r},i.decodeQuery=function(t,e){t+="",void 0===e&&(e=i.escapeQuerySpace);try{return i.decode(e?t.replace(/\+/g,"%20"):t)}catch(e){return t}};var g,b={encode:"encode",decode:"decode"},w=function(t,e){return function(r){try{return i[e](r+"").replace(i.characters[t][e].expression,(function(r){return i.characters[t][e].map[r]}))}catch(t){return r}}};for(g in b)i[g+"PathSegment"]=w("pathname",b[g]),i[g+"UrnPathSegment"]=w("urnpath",b[g]);var _=function(t,e,r){return function(n){var o;o=r?function(t){return i[e](i[r](t))}:i[e];for(var a=(n+"").split(t),u=0,s=a.length;u<s;u++)a[u]=o(a[u]);return a.join(t)}};function k(t){return function(e,r){return void 0===e?this._parts[t]||"":(this._parts[t]=e||null,this.build(!r),this)}}function E(t,e){return function(r,n){return void 0===r?this._parts[t]||"":(null!==r&&(r+="").charAt(0)===e&&(r=r.substring(1)),this._parts[t]=r,this.build(!n),this)}}i.decodePath=_("/","decodePathSegment"),i.decodeUrnPath=_(":","decodeUrnPathSegment"),i.recodePath=_("/","encodePathSegment","decode"),i.recodeUrnPath=_(":","encodeUrnPathSegment","decode"),i.encodeReserved=w("reserved","encode"),i.parse=function(t,e){var r;return e||(e={preventInvalidHostname:i.preventInvalidHostname}),(r=(t=(t=t.replace(i.leading_whitespace_expression,"")).replace(i.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(e.fragment=t.substring(r+1)||null,t=t.substring(0,r)),(r=t.indexOf("?"))>-1&&(e.query=t.substring(r+1)||null,t=t.substring(0,r)),"//"===(t=(t=t.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=i.parseAuthority(t,e)):(r=t.indexOf(":"))>-1&&(e.protocol=t.substring(0,r)||null,e.protocol&&!e.protocol.match(i.protocol_expression)?e.protocol=void 0:"//"===t.substring(r+1,r+3).replace(/\\/g,"/")?(t=t.substring(r+3),t=i.parseAuthority(t,e)):(t=t.substring(r+1),e.urn=!0)),e.path=t,e},i.parseHost=function(t,e){t||(t="");var r,n,o=(t=t.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=t.length),"["===t.charAt(0))r=t.indexOf("]"),e.hostname=t.substring(1,r)||null,e.port=t.substring(r+2,o)||null,"/"===e.port&&(e.port=null);else{var a=t.indexOf(":"),u=t.indexOf("/"),s=t.indexOf(":",a+1);-1!==s&&(-1===u||s<u)?(e.hostname=t.substring(0,o)||null,e.port=null):(n=t.substring(0,o).split(":"),e.hostname=n[0]||null,e.port=n[1]||null)}return e.hostname&&"/"!==t.substring(o).charAt(0)&&(o++,t="/"+t),e.preventInvalidHostname&&i.ensureValidHostname(e.hostname,e.protocol),e.port&&i.ensureValidPort(e.port),t.substring(o)||"/"},i.parseAuthority=function(t,e){return t=i.parseUserinfo(t,e),i.parseHost(t,e)},i.parseUserinfo=function(t,e){var r=t;-1!==t.indexOf("\\")&&(t=t.replace(/\\/g,"/"));var n,o=t.indexOf("/"),a=t.lastIndexOf("@",o>-1?o:t.length-1);return a>-1&&(-1===o||a<o)?(n=t.substring(0,a).split(":"),e.username=n[0]?i.decode(n[0]):null,n.shift(),e.password=n[0]?i.decode(n.join(":")):null,t=r.substring(a+1)):(e.username=null,e.password=null),t},i.parseQuery=function(t,e){if(!t)return{};if(!(t=t.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,o,a={},u=t.split("&"),c=u.length,l=0;l<c;l++)r=u[l].split("="),n=i.decodeQuery(r.shift(),e),o=r.length?i.decodeQuery(r.join("="),e):null,"__proto__"!==n&&(s.call(a,n)?("string"!=typeof a[n]&&null!==a[n]||(a[n]=[a[n]]),a[n].push(o)):a[n]=o);return a},i.build=function(t){var e="",r=!1;return t.protocol&&(e+=t.protocol+":"),t.urn||!e&&!t.hostname||(e+="//",r=!0),e+=i.buildAuthority(t)||"","string"==typeof t.path&&("/"!==t.path.charAt(0)&&r&&(e+="/"),e+=t.path),"string"==typeof t.query&&t.query&&(e+="?"+t.query),"string"==typeof t.fragment&&t.fragment&&(e+="#"+t.fragment),e},i.buildHost=function(t){var e="";return t.hostname?(i.ip6_expression.test(t.hostname)?e+="["+t.hostname+"]":e+=t.hostname,t.port&&(e+=":"+t.port),e):""},i.buildAuthority=function(t){return i.buildUserinfo(t)+i.buildHost(t)},i.buildUserinfo=function(t){var e="";return t.username&&(e+=i.encode(t.username)),t.password&&(e+=":"+i.encode(t.password)),e&&(e+="@"),e},i.buildQuery=function(t,e,r){var n,o,a,u,c="";for(o in t)if("__proto__"!==o&&s.call(t,o))if(f(t[o]))for(n={},a=0,u=t[o].length;a<u;a++)void 0!==t[o][a]&&void 0===n[t[o][a]+""]&&(c+="&"+i.buildQueryParameter(o,t[o][a],r),!0!==e&&(n[t[o][a]+""]=!0));else void 0!==t[o]&&(c+="&"+i.buildQueryParameter(o,t[o],r));return c.substring(1)},i.buildQueryParameter=function(t,e,r){return i.encodeQuery(t,r)+(null!==e?"="+i.encodeQuery(e,r):"")},i.addQuery=function(t,e,r){if("object"===a(e))for(var n in e)s.call(e,n)&&i.addQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===t[e])return void(t[e]=r);"string"==typeof t[e]&&(t[e]=[t[e]]),f(r)||(r=[r]),t[e]=(t[e]||[]).concat(r)}},i.setQuery=function(t,e,r){if("object"===a(e))for(var n in e)s.call(e,n)&&i.setQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");t[e]=void 0===r?null:r}},i.removeQuery=function(t,e,r){var n,o,u;if(f(e))for(n=0,o=e.length;n<o;n++)t[e[n]]=void 0;else if("RegExp"===l(e))for(u in t)e.test(u)&&(t[u]=void 0);else if("object"===a(e))for(u in e)s.call(e,u)&&i.removeQuery(t,u,e[u]);else{if("string"!=typeof e)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===l(r)?!f(t[e])&&r.test(t[e])?t[e]=void 0:t[e]=h(t[e],r):t[e]!==String(r)||f(r)&&1!==r.length?f(t[e])&&(t[e]=h(t[e],r)):t[e]=void 0:t[e]=void 0}},i.hasQuery=function(t,e,r,n){switch(l(e)){case"String":break;case"RegExp":for(var o in t)if(s.call(t,o)&&e.test(o)&&(void 0===r||i.hasQuery(t,o,r)))return!0;return!1;case"Object":for(var a in e)if(s.call(e,a)&&!i.hasQuery(t,a,e[a]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(r)){case"Undefined":return e in t;case"Boolean":return r===Boolean(f(t[e])?t[e].length:t[e]);case"Function":return!!r(t[e],e,t);case"Array":return!!f(t[e])&&(n?p:d)(t[e],r);case"RegExp":return f(t[e])?!!n&&p(t[e],r):Boolean(t[e]&&t[e].match(r));case"Number":r=String(r);case"String":return f(t[e])?!!n&&p(t[e],r):t[e]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var t=[],e=[],r=0,n=0;n<arguments.length;n++){var o=new i(arguments[n]);t.push(o);for(var a=o.segment(),u=0;u<a.length;u++)"string"==typeof a[u]&&e.push(a[u]),a[u]&&r++}if(!e.length||!r)return new i("");var s=new i("").segment(e);return""!==t[0].path()&&"/"!==t[0].path().slice(0,1)||s.path("/"+s.path()),s.normalize()},i.commonPath=function(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r<n;r++)if(t.charAt(r)!==e.charAt(r)){r--;break}return r<1?t.charAt(0)===e.charAt(0)&&"/"===t.charAt(0)?"/":"":("/"===t.charAt(r)&&"/"===e.charAt(r)||(r=t.substring(0,r).lastIndexOf("/")),t.substring(0,r+1))},i.withinString=function(t,e,r){r||(r={});var n=r.start||i.findUri.start,o=r.end||i.findUri.end,a=r.trim||i.findUri.trim,u=r.parens||i.findUri.parens,s=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var c=n.exec(t);if(!c)break;var l=c.index;if(r.ignoreHtml){var f=t.slice(Math.max(l-3,0),l);if(f&&s.test(f))continue}for(var h=l+t.slice(l).search(o),p=t.slice(l,h),d=-1;;){var m=u.exec(p);if(!m)break;var v=m.index+m[0].length;d=Math.max(d,v)}if(!((p=d>-1?p.slice(0,d)+p.slice(d).replace(a,""):p.replace(a,"")).length<=c[0].length||r.ignore&&r.ignore.test(p))){var y=e(p,l,h=l+p.length,t);void 0!==y?(y=String(y),t=t.slice(0,l)+y+t.slice(h),n.lastIndex=l+y.length):n.lastIndex=h}}return n.lastIndex=0,t},i.ensureValidHostname=function(e,r){var n=!!e,o=!1;if(!!r&&(o=p(i.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(e&&e.match(i.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(e).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&e>0&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},i.noConflict=function(t){if(t){var e={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(e.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(e.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(e.SecondLevelDomains=n.SecondLevelDomains.noConflict()),e}return n.URI===this&&(n.URI=o),this},u.build=function(t){return!0===t?this._deferred_build=!0:(void 0===t||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new i(this)},u.valueOf=u.toString=function(){return this.build(!1)._string},u.protocol=k("protocol"),u.username=k("username"),u.password=k("password"),u.hostname=k("hostname"),u.port=k("port"),u.query=E("query","?"),u.fragment=E("fragment","#"),u.search=function(t,e){var r=this.query(t,e);return"string"==typeof r&&r.length?"?"+r:r},u.hash=function(t,e){var r=this.fragment(t,e);return"string"==typeof r&&r.length?"#"+r:r},u.pathname=function(t,e){if(void 0===t||!0===t){var r=this._parts.path||(this._parts.hostname?"/":"");return t?(this._parts.urn?i.decodeUrnPath:i.decodePath)(r):r}return this._parts.urn?this._parts.path=t?i.recodeUrnPath(t):"":this._parts.path=t?i.recodePath(t):"/",this.build(!e),this},u.path=u.pathname,u.href=function(t,e){var r;if(void 0===t)return this.toString();this._string="",this._parts=i._parts();var n=t instanceof i,o="object"===a(t)&&(t.hostname||t.path||t.pathname);t.nodeName&&(t=t[i.getDomAttribute(t)]||"",o=!1);if(!n&&o&&void 0!==t.pathname&&(t=t.toString()),"string"==typeof t||t instanceof String)this._parts=i.parse(String(t),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var u=n?t._parts:t;for(r in u)"query"!==r&&s.call(this._parts,r)&&(this._parts[r]=u[r]);u.query&&this.query(u.query,!1)}return this.build(!e),this},u.is=function(t){var e=!1,n=!1,o=!1,a=!1,u=!1,s=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,n=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),u=(a=!(e=n||o))&&r&&r.has(this._parts.hostname),s=a&&i.idn_expression.test(this._parts.hostname),c=a&&i.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return a;case"sld":return u;case"ip":return e;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return o;case"idn":return s;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var x=u.protocol,A=u.port,O=u.hostname;u.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,t,e)},u.scheme=u.protocol,u.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(0===t&&(t=null),t&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),i.ensureValidPort(t))),A.call(this,t,e))},u.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(t,r))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=r.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(t,this._parts.protocol)}return O.call(this,t,e)},u.origin=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=i(t);return this.protocol(n.protocol()).authority(n.authority()).build(!e),this},u.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},u.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},u.userinfo=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=i.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==t[t.length-1]&&(t+="@"),i.parseUserinfo(t,this._parts),this.build(!e),this},u.resource=function(t,e){var r;return void 0===t?this.path()+this.search()+this.hash():(r=i.parse(t),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!e),this)},u.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,n),a=new RegExp("^"+c(o));if(t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&i.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,t),this.build(!e),this},u.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(e).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=t;else{var o=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,t)}return this.build(!e),this},u.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(n+1);return!0!==e&&r&&r.list[o.toLowerCase()]&&r.get(this._parts.hostname)||o}var i;if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]');i=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,t)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,t)}return this.build(!e),this},u.directory=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return t?i.decodePath(n):n}var o=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,o),u=new RegExp("^"+c(a));return this.is("relative")||(t||(t="/"),"/"!==t.charAt(0)&&(t="/"+t)),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=i.recodePath(t),this._parts.path=this._parts.path.replace(u,t),this.build(!e),this},u.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("string"!=typeof t){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return t?i.decodePathSegment(n):n}var o=!1;"/"===t.charAt(0)&&(t=t.substring(1)),t.match(/\.?\//)&&(o=!0);var a=new RegExp(c(this.filename())+"$");return t=i.recodePath(t),this._parts.path=this._parts.path.replace(a,t),o?this.normalizePath(e):this.build(!e),this},u.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,o=this.filename(),a=o.lastIndexOf(".");return-1===a?"":(r=o.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",t?i.decodePathSegment(n):n)}"."===t.charAt(0)&&(t=t.substring(1));var u,s=this.suffix();if(s)u=t?new RegExp(c(s)+"$"):new RegExp(c("."+s)+"$");else{if(!t)return this;this._parts.path+="."+i.recodePath(t)}return u&&(t=i.recodePath(t),this._parts.path=this._parts.path.replace(u,t)),this.build(!e),this},u.segment=function(t,e,r){var n=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),a=o.split(n);if(void 0!==t&&"number"!=typeof t&&(r=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw new Error('Bad segment "'+t+'", must be 0-based integer');if(i&&a.shift(),t<0&&(t=Math.max(a.length+t,0)),void 0===e)return void 0===t?a:a[t];if(null===t||void 0===a[t])if(f(e)){a=[];for(var u=0,s=e.length;u<s;u++)(e[u].length||a.length&&a[a.length-1].length)&&(a.length&&!a[a.length-1].length&&a.pop(),a.push(m(e[u])))}else(e||"string"==typeof e)&&(e=m(e),""===a[a.length-1]?a[a.length-1]=e:a.push(e));else e?a[t]=m(e):a.splice(t,1);return i&&a.unshift(""),this.path(a.join(n),r)},u.segmentCoded=function(t,e,r){var n,o,a;if("number"!=typeof t&&(r=e,e=t,t=void 0),void 0===e){if(f(n=this.segment(t,e,r)))for(o=0,a=n.length;o<a;o++)n[o]=i.decode(n[o]);else n=void 0!==n?i.decode(n):void 0;return n}if(f(e))for(o=0,a=e.length;o<a;o++)e[o]=i.encode(e[o]);else e="string"==typeof e||e instanceof String?i.encode(e):e;return this.segment(t,e,r)};var S=u.query;return u.query=function(t,e){if(!0===t)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof t){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=t.call(this,r);return this._parts.query=i.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this}return void 0!==t&&"string"!=typeof t?(this._parts.query=i.buildQuery(t,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this):S.call(this,t,e)},u.setQuery=function(t,e,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof t||t instanceof String)n[t]=void 0!==e?e:null;else{if("object"!==a(t))throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in t)s.call(t,o)&&(n[o]=t[o])}return this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof t&&(r=e),this.build(!r),this},u.addQuery=function(t,e,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(n,t,void 0===e?null:e),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof t&&(r=e),this.build(!r),this},u.removeQuery=function(t,e,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(n,t,e),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof t&&(r=e),this.build(!r),this},u.hasQuery=function(t,e,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(n,t,e,r)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},u.normalizeProtocol=function(t){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!t)),this},u.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},u.normalizePort=function(t){return"string"==typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!t)),this},u.normalizePath=function(t){var e,r=this._parts.path;if(!r)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!t),this;if("/"===this._parts.path)return this;var n,o,a="";for("/"!==(r=i.recodePath(r)).charAt(0)&&(e=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(a=r.substring(1).match(/^(\.\.\/)+/)||"")&&(a=a[0]);-1!==(n=r.search(/\/\.\.(\/|$)/));)0!==n?(-1===(o=r.substring(0,n).lastIndexOf("/"))&&(o=n),r=r.substring(0,o)+r.substring(n+3)):r=r.substring(3);return e&&this.is("relative")&&(r=a+r.substring(1)),this._parts.path=r,this.build(!t),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(t){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!t)),this},u.normalizeFragment=function(t){return this._parts.fragment||(this._parts.fragment=null,this.build(!t)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var t=i.encode,e=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=t,i.decode=e}return this},u.unicode=function(){var t=i.encode,e=i.decode;i.encode=y,i.decode=unescape;try{this.normalize()}finally{i.encode=t,i.decode=e}return this},u.readable=function(){var e=this.clone();e.username("").password("").normalize();var r="";if(e._parts.protocol&&(r+=e._parts.protocol+"://"),e._parts.hostname&&(e.is("punycode")&&t?(r+=t.toUnicode(e._parts.hostname),e._parts.port&&(r+=":"+e._parts.port)):r+=e.host()),e._parts.hostname&&e._parts.path&&"/"!==e._parts.path.charAt(0)&&(r+="/"),r+=e.path(!0),e._parts.query){for(var n="",o=0,a=e._parts.query.split("&"),u=a.length;o<u;o++){var s=(a[o]||"").split("=");n+="&"+i.decodeQuery(s[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==s[1]&&(n+="="+i.decodeQuery(s[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}r+="?"+n.substring(1)}return r+=i.decodeQuery(e.hash(),!0)},u.absoluteTo=function(t){var e,r,n,o=this.clone(),a=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(t instanceof i||(t=new i(t)),o._parts.protocol)return o;if(o._parts.protocol=t._parts.protocol,this._parts.hostname)return o;for(r=0;n=a[r];r++)o._parts[n]=t._parts[n];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(e=(e=t.directory())||(0===t.path().indexOf("/")?"/":""),o._parts.path=(e?e+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=t._parts.path,o._parts.query||(o._parts.query=t._parts.query)),o.build(),o},u.relativeTo=function(t){var e,r,n,o,a,u=this.clone().normalize();if(u._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(t=new i(t).normalize(),e=u._parts,r=t._parts,o=u.path(),a=t.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==a.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(e.protocol===r.protocol&&(e.protocol=null),e.username!==r.username||e.password!==r.password)return u.build();if(null!==e.protocol||null!==e.username||null!==e.password)return u.build();if(e.hostname!==r.hostname||e.port!==r.port)return u.build();if(e.hostname=null,e.port=null,o===a)return e.path="",u.build();if(!(n=i.commonPath(o,a)))return u.build();var s=r.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return e.path=s+e.path.substring(n.length)||"./",u.build()},u.equals=function(t){var e,r,n,o,a,u=this.clone(),c=new i(t),l={};if(u.normalize(),c.normalize(),u.toString()===c.toString())return!0;if(n=u.query(),o=c.query(),u.query(""),c.query(""),u.toString()!==c.toString())return!1;if(n.length!==o.length)return!1;for(a in e=i.parseQuery(n,this._parts.escapeQuerySpace),r=i.parseQuery(o,this._parts.escapeQuerySpace),e)if(s.call(e,a)){if(f(e[a])){if(!d(e[a],r[a]))return!1}else if(e[a]!==r[a])return!1;l[a]=!0}for(a in r)if(s.call(r,a)&&!l[a])return!1;return!0},u.preventInvalidHostname=function(t){return this._parts.preventInvalidHostname=!!t,this},u.duplicateQueryParameters=function(t){return this._parts.duplicateQueryParameters=!!t,this},u.escapeQuerySpace=function(t){return this._parts.escapeQuerySpace=!!t,this},i}))}).call(this,r(9)(t))},function(t,e,r){"use strict";r.r(e),r.d(e,"Deflate",(function(){return $e})),r.d(e,"Inflate",(function(){return nr})),r.d(e,"constants",(function(){return ur})),r.d(e,"default",(function(){return sr})),r.d(e,"deflate",(function(){return tr})),r.d(e,"deflateRaw",(function(){return er})),r.d(e,"gzip",(function(){return rr})),r.d(e,"inflate",(function(){return or})),r.d(e,"inflateRaw",(function(){return ir})),r.d(e,"ungzip",(function(){return ar}));function n(t){let e=t.length;for(;--e>=0;)t[e]=0}const o=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),i=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),u=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);n(s);const c=new Array(60);n(c);const l=new Array(512);n(l);const f=new Array(256);n(f);const h=new Array(29);n(h);const p=new Array(30);function d(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}let m,v,y;function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}n(p);const b=t=>t<256?l[t]:l[256+(t>>>7)],w=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},_=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},k=(t,e,r)=>{_(t,r[2*e],r[2*e+1])},E=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},x=(t,e,r)=>{const n=new Array(16);let o,i,a=0;for(o=1;o<=15;o++)a=a+r[o-1]<<1,n[o]=a;for(i=0;i<=e;i++){let e=t[2*i+1];0!==e&&(t[2*i]=E(n[e]++,e))}},A=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},O=t=>{t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=(t,e,r,n)=>{const o=2*e,i=2*r;return t[o]<t[i]||t[o]===t[i]&&n[e]<=n[r]},P=(t,e,r)=>{const n=t.heap[r];let o=r<<1;for(;o<=t.heap_len&&(o<t.heap_len&&S(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!S(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n},j=(t,e,r)=>{let n,a,u,s,c=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+c++],n+=(255&t.pending_buf[t.sym_buf+c++])<<8,a=t.pending_buf[t.sym_buf+c++],0===n?k(t,a,e):(u=f[a],k(t,u+256+1,e),s=o[u],0!==s&&(a-=h[u],_(t,a,s)),n--,u=b(n),k(t,u,r),s=i[u],0!==s&&(n-=p[u],_(t,n,s)))}while(c<t.sym_next);k(t,256,e)},T=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,i=e.stat_desc.elems;let a,u,s,c=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<i;a++)0!==r[2*a]?(t.heap[++t.heap_len]=c=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)s=t.heap[++t.heap_len]=c<2?++c:0,r[2*s]=1,t.depth[s]=0,t.opt_len--,o&&(t.static_len-=n[2*s+1]);for(e.max_code=c,a=t.heap_len>>1;a>=1;a--)P(t,r,a);s=i;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],P(t,r,1),u=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=u,r[2*s]=r[2*a]+r[2*u],t.depth[s]=(t.depth[a]>=t.depth[u]?t.depth[a]:t.depth[u])+1,r[2*a+1]=r[2*u+1]=s,t.heap[1]=s++,P(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,s=e.stat_desc.max_length;let c,l,f,h,p,d,m=0;for(h=0;h<=15;h++)t.bl_count[h]=0;for(r[2*t.heap[t.heap_max]+1]=0,c=t.heap_max+1;c<573;c++)l=t.heap[c],h=r[2*r[2*l+1]+1]+1,h>s&&(h=s,m++),r[2*l+1]=h,l>n||(t.bl_count[h]++,p=0,l>=u&&(p=a[l-u]),d=r[2*l],t.opt_len+=d*(h+p),i&&(t.static_len+=d*(o[2*l+1]+p)));if(0!==m){do{for(h=s-1;0===t.bl_count[h];)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[s]--,m-=2}while(m>0);for(h=s;0!==h;h--)for(l=t.bl_count[h];0!==l;)f=t.heap[--c],f>n||(r[2*f+1]!==h&&(t.opt_len+=(h-r[2*f+1])*r[2*f],r[2*f+1]=h),l--)}})(t,e),x(r,c,t.bl_count)},N=(t,e,r)=>{let n,o,i=-1,a=e[1],u=0,s=7,c=4;for(0===a&&(s=138,c=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)o=a,a=e[2*(n+1)+1],++u<s&&o===a||(u<c?t.bl_tree[2*o]+=u:0!==o?(o!==i&&t.bl_tree[2*o]++,t.bl_tree[32]++):u<=10?t.bl_tree[34]++:t.bl_tree[36]++,u=0,i=o,0===a?(s=138,c=3):o===a?(s=6,c=3):(s=7,c=4))},I=(t,e,r)=>{let n,o,i=-1,a=e[1],u=0,s=7,c=4;for(0===a&&(s=138,c=3),n=0;n<=r;n++)if(o=a,a=e[2*(n+1)+1],!(++u<s&&o===a)){if(u<c)do{k(t,o,t.bl_tree)}while(0!=--u);else 0!==o?(o!==i&&(k(t,o,t.bl_tree),u--),k(t,16,t.bl_tree),_(t,u-3,2)):u<=10?(k(t,17,t.bl_tree),_(t,u-3,3)):(k(t,18,t.bl_tree),_(t,u-11,7));u=0,i=o,0===a?(s=138,c=3):o===a?(s=6,c=3):(s=7,c=4)}};let R=!1;const L=(t,e,r,n)=>{_(t,0+(n?1:0),3),O(t),w(t,r),w(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r};var C={_tr_init:t=>{R||((()=>{let t,e,r,n,u;const g=new Array(16);for(r=0,n=0;n<28;n++)for(h[n]=r,t=0;t<1<<o[n];t++)f[r++]=n;for(f[r-1]=n,u=0,n=0;n<16;n++)for(p[n]=u,t=0;t<1<<i[n];t++)l[u++]=n;for(u>>=7;n<30;n++)for(p[n]=u<<7,t=0;t<1<<i[n]-7;t++)l[256+u++]=n;for(e=0;e<=15;e++)g[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,g[8]++;for(;t<=255;)s[2*t+1]=9,t++,g[9]++;for(;t<=279;)s[2*t+1]=7,t++,g[7]++;for(;t<=287;)s[2*t+1]=8,t++,g[8]++;for(x(s,287,g),t=0;t<30;t++)c[2*t+1]=5,c[2*t]=E(t,5);m=new d(s,o,257,286,15),v=new d(c,i,0,30,15),y=new d(new Array(0),a,0,19,7)})(),R=!0),t.l_desc=new g(t.dyn_ltree,m),t.d_desc=new g(t.dyn_dtree,v),t.bl_desc=new g(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,A(t)},_tr_stored_block:L,_tr_flush_block:(t,e,r,n)=>{let o,i,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),T(t,t.l_desc),T(t,t.d_desc),a=(t=>{let e;for(N(t,t.dyn_ltree,t.l_desc.max_code),N(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*u[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,i=t.static_len+3+7>>>3,i<=o&&(o=i)):o=i=r+5,r+4<=o&&-1!==e?L(t,e,r,n):4===t.strategy||i===o?(_(t,2+(n?1:0),3),j(t,s,c)):(_(t,4+(n?1:0),3),((t,e,r,n)=>{let o;for(_(t,e-257,5),_(t,r-1,5),_(t,n-4,4),o=0;o<n;o++)_(t,t.bl_tree[2*u[o]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),j(t,t.dyn_ltree,t.dyn_dtree)),A(t),n&&O(t)},_tr_tally:(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(f[r]+256+1)]++,t.dyn_dtree[2*b(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{_(t,2,3),k(t,256,s),(t=>{16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var M=(t,e,r,n)=>{let o=65535&t|0,i=t>>>16&65535|0,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{o=o+e[n++]|0,i=i+o|0}while(--a);o%=65521,i%=65521}return o|i<<16|0};const B=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());var F=(t,e,r,n)=>{const o=B,i=n+r;t^=-1;for(let r=n;r<i;r++)t=t>>>8^o[255&(t^e[r])];return-1^t},D={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},U={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:z,_tr_stored_block:G,_tr_flush_block:H,_tr_tally:q,_tr_align:K}=C,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:Q,Z_FULL_FLUSH:V,Z_FINISH:J,Z_BLOCK:Y,Z_OK:Z,Z_STREAM_END:X,Z_STREAM_ERROR:$,Z_DATA_ERROR:tt,Z_BUF_ERROR:et,Z_DEFAULT_COMPRESSION:rt,Z_FILTERED:nt,Z_HUFFMAN_ONLY:ot,Z_RLE:it,Z_FIXED:at,Z_DEFAULT_STRATEGY:ut,Z_UNKNOWN:st,Z_DEFLATED:ct}=U,lt=(t,e)=>(t.msg=D[e],e),ft=t=>2*t-(t>4?9:0),ht=t=>{let e=t.length;for(;--e>=0;)t[e]=0},pt=t=>{let e,r,n,o=t.w_size;e=t.hash_size,n=e;do{r=t.head[--n],t.head[n]=r>=o?r-o:0}while(--e);e=o,n=e;do{r=t.prev[--n],t.prev[n]=r>=o?r-o:0}while(--e)};let dt=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const mt=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},vt=(t,e)=>{H(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mt(t.strm)},yt=(t,e)=>{t.pending_buf[t.pending++]=e},gt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,r,n)=>{let o=t.avail_in;return o>n&&(o=n),0===o?0:(t.avail_in-=o,e.set(t.input.subarray(t.next_in,t.next_in+o),r),1===t.state.wrap?t.adler=M(t.adler,e,o,r):2===t.state.wrap&&(t.adler=F(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)},wt=(t,e)=>{let r,n,o=t.max_chain_length,i=t.strstart,a=t.prev_length,u=t.nice_match;const s=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,c=t.window,l=t.w_mask,f=t.prev,h=t.strstart+258;let p=c[i+a-1],d=c[i+a];t.prev_length>=t.good_match&&(o>>=2),u>t.lookahead&&(u=t.lookahead);do{if(r=e,c[r+a]===d&&c[r+a-1]===p&&c[r]===c[i]&&c[++r]===c[i+1]){i+=2,r++;do{}while(c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&i<h);if(n=258-(h-i),i=h-258,n>a){if(t.match_start=e,a=n,n>=u)break;p=c[i+a-1],d=c[i+a]}}}while((e=f[e&l])>s&&0!=--o);return a<=t.lookahead?a:t.lookahead},_t=t=>{const e=t.w_size;let r,n,o;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),pt(t),n+=e),0===t.strm.avail_in)break;if(r=bt(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=dt(t,t.ins_h,t.window[o+1]);t.insert&&(t.ins_h=dt(t,t.ins_h,t.window[o+3-1]),t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let r,n,o,i=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,a=0,u=t.strm.avail_in;do{if(r=65535,o=t.bi_valid+42>>3,t.strm.avail_out<o)break;if(o=t.strm.avail_out-o,n=t.strstart-t.block_start,r>n+t.strm.avail_in&&(r=n+t.strm.avail_in),r>o&&(r=o),r<i&&(0===r&&e!==J||e===W||r!==n+t.strm.avail_in))break;a=e===J&&r===n+t.strm.avail_in?1:0,G(t,0,0,a),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,mt(t.strm),n&&(n>r&&(n=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,r-=n),r&&(bt(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===a);return u-=t.strm.avail_in,u&&(u>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=u&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-u,t.strm.next_in),t.strstart),t.strstart+=u,t.insert+=u>t.w_size-t.insert?t.w_size-t.insert:u),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),a?4:e!==W&&e!==J&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(o=t.window_size-t.strstart,t.strm.avail_in>o&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,o+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),o>t.strm.avail_in&&(o=t.strm.avail_in),o&&(bt(t.strm,t.window,t.strstart,o),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.high_water<t.strstart&&(t.high_water=t.strstart),o=t.bi_valid+42>>3,o=t.pending_buf_size-o>65535?65535:t.pending_buf_size-o,i=o>t.w_size?t.w_size:o,n=t.strstart-t.block_start,(n>=i||(n||e===J)&&e!==W&&0===t.strm.avail_in&&n<=o)&&(r=n>o?o:n,a=e===J&&0===t.strm.avail_in&&r===n?1:0,G(t,t.block_start,r,a),t.block_start+=r,mt(t.strm)),a?3:1)},Et=(t,e)=>{let r,n;for(;;){if(t.lookahead<262){if(_t(t),t.lookahead<262&&e===W)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-262&&(t.match_length=wt(t,r)),t.match_length>=3)if(n=q(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=dt(t,t.ins_h,t.window[t.strstart+1]);else n=q(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===J?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2},xt=(t,e)=>{let r,n,o;for(;;){if(t.lookahead<262){if(_t(t),t.lookahead<262&&e===W)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-262&&(t.match_length=wt(t,r),t.match_length<=5&&(t.strategy===nt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-3,n=q(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=o&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(vt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=q(t,0,t.window[t.strstart-1]),n&&vt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=q(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===J?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2};function At(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}const Ot=[new At(0,0,0,0,kt),new At(4,4,8,4,Et),new At(4,5,16,8,Et),new At(4,6,32,32,Et),new At(4,4,16,16,xt),new At(8,16,32,32,xt),new At(8,16,128,128,xt),new At(8,32,128,256,xt),new At(32,128,258,1024,xt),new At(32,258,258,4096,xt)];function St(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ct,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ht(this.dyn_ltree),ht(this.dyn_dtree),ht(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ht(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ht(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Pt=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},jt=t=>{if(Pt(t))return lt(t,$);t.total_in=t.total_out=0,t.data_type=st;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,z(e),Z},Tt=t=>{const e=jt(t);var r;return e===Z&&((r=t.state).window_size=2*r.w_size,ht(r.head),r.max_lazy_match=Ot[r.level].max_lazy,r.good_match=Ot[r.level].good_length,r.nice_match=Ot[r.level].nice_length,r.max_chain_length=Ot[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},Nt=(t,e,r,n,o,i)=>{if(!t)return $;let a=1;if(e===rt&&(e=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>9||r!==ct||n<8||n>15||e<0||e>9||i<0||i>at||8===n&&1!==a)return lt(t,$);8===n&&(n=9);const u=new St;return t.state=u,u.strm=t,u.status=42,u.wrap=a,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new Uint8Array(2*u.w_size),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=3*(u.lit_bufsize-1),u.level=e,u.strategy=i,u.method=r,Tt(t)};var It={deflateInit:(t,e)=>Nt(t,e,ct,15,8,ut),deflateInit2:Nt,deflateReset:Tt,deflateResetKeep:jt,deflateSetHeader:(t,e)=>Pt(t)||2!==t.state.wrap?$:(t.state.gzhead=e,Z),deflate:(t,e)=>{if(Pt(t)||e>Y||e<0)return t?lt(t,$):$;const r=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===r.status&&e!==J)return lt(t,0===t.avail_out?et:$);const n=r.last_flush;if(r.last_flush=e,0!==r.pending){if(mt(t),0===t.avail_out)return r.last_flush=-1,Z}else if(0===t.avail_in&&ft(e)<=ft(n)&&e!==J)return lt(t,et);if(666===r.status&&0!==t.avail_in)return lt(t,et);if(42===r.status&&0===r.wrap&&(r.status=113),42===r.status){let e=ct+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=ot||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,gt(r,e),0!==r.strstart&&(gt(r,t.adler>>>16),gt(r,65535&t.adler)),t.adler=1,r.status=113,mt(t),0!==r.pending)return r.last_flush=-1,Z}if(57===r.status)if(t.adler=0,yt(r,31),yt(r,139),yt(r,8),r.gzhead)yt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),yt(r,255&r.gzhead.time),yt(r,r.gzhead.time>>8&255),yt(r,r.gzhead.time>>16&255),yt(r,r.gzhead.time>>24&255),yt(r,9===r.level?2:r.strategy>=ot||r.level<2?4:0),yt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(yt(r,255&r.gzhead.extra.length),yt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=F(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,9===r.level?2:r.strategy>=ot||r.level<2?4:0),yt(r,3),r.status=113,mt(t),0!==r.pending)return r.last_flush=-1,Z;if(69===r.status){if(r.gzhead.extra){let e=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let o=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+o),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>e&&(t.adler=F(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex+=o,mt(t),0!==r.pending)return r.last_flush=-1,Z;e=0,n-=o}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>e&&(t.adler=F(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=F(t.adler,r.pending_buf,r.pending-n,n)),mt(t),0!==r.pending)return r.last_flush=-1,Z;n=0}e=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,yt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=F(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=F(t.adler,r.pending_buf,r.pending-n,n)),mt(t),0!==r.pending)return r.last_flush=-1,Z;n=0}e=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,yt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=F(t.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(mt(t),0!==r.pending))return r.last_flush=-1,Z;yt(r,255&t.adler),yt(r,t.adler>>8&255),t.adler=0}if(r.status=113,mt(t),0!==r.pending)return r.last_flush=-1,Z}if(0!==t.avail_in||0!==r.lookahead||e!==W&&666!==r.status){let n=0===r.level?kt(r,e):r.strategy===ot?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(_t(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,r=q(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===J?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===it?((t,e)=>{let r,n,o,i;const a=t.window;for(;;){if(t.lookahead<=258){if(_t(t),t.lookahead<=258&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(o=t.strstart-1,n=a[o],n===a[++o]&&n===a[++o]&&n===a[++o])){i=t.strstart+258;do{}while(n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&o<i);t.match_length=258-(i-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=q(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=q(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===J?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2})(r,e):Ot[r.level].func(r,e);if(3!==n&&4!==n||(r.status=666),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),Z;if(2===n&&(e===Q?K(r):e!==Y&&(G(r,0,0,!1),e===V&&(ht(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),mt(t),0===t.avail_out))return r.last_flush=-1,Z}return e!==J?Z:r.wrap<=0?X:(2===r.wrap?(yt(r,255&t.adler),yt(r,t.adler>>8&255),yt(r,t.adler>>16&255),yt(r,t.adler>>24&255),yt(r,255&t.total_in),yt(r,t.total_in>>8&255),yt(r,t.total_in>>16&255),yt(r,t.total_in>>24&255)):(gt(r,t.adler>>>16),gt(r,65535&t.adler)),mt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Z:X)},deflateEnd:t=>{if(Pt(t))return $;const e=t.state.status;return t.state=null,113===e?lt(t,tt):Z},deflateSetDictionary:(t,e)=>{let r=e.length;if(Pt(t))return $;const n=t.state,o=n.wrap;if(2===o||1===o&&42!==n.status||n.lookahead)return $;if(1===o&&(t.adler=M(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===o&&(ht(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const i=t.avail_in,a=t.next_in,u=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,_t(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=dt(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,_t(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=a,t.input=u,t.avail_in=i,n.wrap=o,Z},deflateInfo:"pako deflate (from Nodeca project)"};const Rt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Lt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const e in r)Rt(r,e)&&(t[e]=r[e])}}return t},Ct=t=>{let e=0;for(let r=0,n=t.length;r<n;r++)e+=t[r].length;const r=new Uint8Array(e);for(let e=0,n=0,o=t.length;e<o;e++){let o=t[e];r.set(o,n),n+=o.length}return r};let Mt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Mt=!1}const Bt=new Uint8Array(256);for(let t=0;t<256;t++)Bt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Bt[254]=Bt[254]=1;var Ft=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,o,i,a=t.length,u=0;for(o=0;o<a;o++)r=t.charCodeAt(o),55296==(64512&r)&&o+1<a&&(n=t.charCodeAt(o+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),o++)),u+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(u),i=0,o=0;i<u;o++)r=t.charCodeAt(o),55296==(64512&r)&&o+1<a&&(n=t.charCodeAt(o+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[i++]=r:r<2048?(e[i++]=192|r>>>6,e[i++]=128|63&r):r<65536?(e[i++]=224|r>>>12,e[i++]=128|r>>>6&63,e[i++]=128|63&r):(e[i++]=240|r>>>18,e[i++]=128|r>>>12&63,e[i++]=128|r>>>6&63,e[i++]=128|63&r);return e},Dt=(t,e)=>{const r=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,o;const i=new Array(2*r);for(o=0,n=0;n<r;){let e=t[n++];if(e<128){i[o++]=e;continue}let a=Bt[e];if(a>4)i[o++]=65533,n+=a-1;else{for(e&=2===a?31:3===a?15:7;a>1&&n<r;)e=e<<6|63&t[n++],a--;a>1?i[o++]=65533:e<65536?i[o++]=e:(e-=65536,i[o++]=55296|e>>10&1023,i[o++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r})(i,o)},Ut=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let r=e-1;for(;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+Bt[t[r]]>e?r:e};var zt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Ht,Z_SYNC_FLUSH:qt,Z_FULL_FLUSH:Kt,Z_FINISH:Wt,Z_OK:Qt,Z_STREAM_END:Vt,Z_DEFAULT_COMPRESSION:Jt,Z_DEFAULT_STRATEGY:Yt,Z_DEFLATED:Zt}=U;function Xt(t){this.options=Lt({level:Jt,method:Zt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Yt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zt,this.strm.avail_out=0;let r=It.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Qt)throw new Error(D[r]);if(e.header&&It.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Ft(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=It.deflateSetDictionary(this.strm,t),r!==Qt)throw new Error(D[r]);this._dict_set=!0}}function $t(t,e){const r=new Xt(e);if(r.push(t,!0),r.err)throw r.msg||D[r.err];return r.result}Xt.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let o,i;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Wt:Ht,"string"==typeof t?r.input=Ft(t):"[object ArrayBuffer]"===Gt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(i===qt||i===Kt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(o=It.deflate(r,i),o===Vt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),o=It.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Qt;if(0!==r.avail_out){if(i>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Xt.prototype.onData=function(t){this.chunks.push(t)},Xt.prototype.onEnd=function(t){t===Qt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var te={Deflate:Xt,deflate:$t,deflateRaw:function(t,e){return(e=e||{}).raw=!0,$t(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,$t(t,e)},constants:U};var ee=function(t,e){let r,n,o,i,a,u,s,c,l,f,h,p,d,m,v,y,g,b,w,_,k,E,x,A;const O=t.state;r=t.next_in,x=t.input,n=r+(t.avail_in-5),o=t.next_out,A=t.output,i=o-(e-t.avail_out),a=o+(t.avail_out-257),u=O.dmax,s=O.wsize,c=O.whave,l=O.wnext,f=O.window,h=O.hold,p=O.bits,d=O.lencode,m=O.distcode,v=(1<<O.lenbits)-1,y=(1<<O.distbits)-1;t:do{p<15&&(h+=x[r++]<<p,p+=8,h+=x[r++]<<p,p+=8),g=d[h&v];e:for(;;){if(b=g>>>24,h>>>=b,p-=b,b=g>>>16&255,0===b)A[o++]=65535&g;else{if(!(16&b)){if(0==(64&b)){g=d[(65535&g)+(h&(1<<b)-1)];continue e}if(32&b){O.mode=16191;break t}t.msg="invalid literal/length code",O.mode=16209;break t}w=65535&g,b&=15,b&&(p<b&&(h+=x[r++]<<p,p+=8),w+=h&(1<<b)-1,h>>>=b,p-=b),p<15&&(h+=x[r++]<<p,p+=8,h+=x[r++]<<p,p+=8),g=m[h&y];r:for(;;){if(b=g>>>24,h>>>=b,p-=b,b=g>>>16&255,!(16&b)){if(0==(64&b)){g=m[(65535&g)+(h&(1<<b)-1)];continue r}t.msg="invalid distance code",O.mode=16209;break t}if(_=65535&g,b&=15,p<b&&(h+=x[r++]<<p,p+=8,p<b&&(h+=x[r++]<<p,p+=8)),_+=h&(1<<b)-1,_>u){t.msg="invalid distance too far back",O.mode=16209;break t}if(h>>>=b,p-=b,b=o-i,_>b){if(b=_-b,b>c&&O.sane){t.msg="invalid distance too far back",O.mode=16209;break t}if(k=0,E=f,0===l){if(k+=s-b,b<w){w-=b;do{A[o++]=f[k++]}while(--b);k=o-_,E=A}}else if(l<b){if(k+=s+l-b,b-=l,b<w){w-=b;do{A[o++]=f[k++]}while(--b);if(k=0,l<w){b=l,w-=b;do{A[o++]=f[k++]}while(--b);k=o-_,E=A}}}else if(k+=l-b,b<w){w-=b;do{A[o++]=f[k++]}while(--b);k=o-_,E=A}for(;w>2;)A[o++]=E[k++],A[o++]=E[k++],A[o++]=E[k++],w-=3;w&&(A[o++]=E[k++],w>1&&(A[o++]=E[k++]))}else{k=o-_;do{A[o++]=A[k++],A[o++]=A[k++],A[o++]=A[k++],w-=3}while(w>2);w&&(A[o++]=A[k++],w>1&&(A[o++]=A[k++]))}break}}break}}while(r<n&&o<a);w=p>>3,r-=w,p-=w<<3,h&=(1<<p)-1,t.next_in=r,t.next_out=o,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=o<a?a-o+257:257-(o-a),O.hold=h,O.bits=p};const re=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ne=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),oe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ie=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ae=(t,e,r,n,o,i,a,u)=>{const s=u.bits;let c,l,f,h,p,d,m=0,v=0,y=0,g=0,b=0,w=0,_=0,k=0,E=0,x=0,A=null;const O=new Uint16Array(16),S=new Uint16Array(16);let P,j,T,N=null;for(m=0;m<=15;m++)O[m]=0;for(v=0;v<n;v++)O[e[r+v]]++;for(b=s,g=15;g>=1&&0===O[g];g--);if(b>g&&(b=g),0===g)return o[i++]=20971520,o[i++]=20971520,u.bits=1,0;for(y=1;y<g&&0===O[y];y++);for(b<y&&(b=y),k=1,m=1;m<=15;m++)if(k<<=1,k-=O[m],k<0)return-1;if(k>0&&(0===t||1!==g))return-1;for(S[1]=0,m=1;m<15;m++)S[m+1]=S[m]+O[m];for(v=0;v<n;v++)0!==e[r+v]&&(a[S[e[r+v]]++]=v);if(0===t?(A=N=a,d=20):1===t?(A=re,N=ne,d=257):(A=oe,N=ie,d=0),x=0,v=0,m=y,p=i,w=b,_=0,f=-1,E=1<<b,h=E-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){P=m-_,a[v]+1<d?(j=0,T=a[v]):a[v]>=d?(j=N[a[v]-d],T=A[a[v]-d]):(j=96,T=0),c=1<<m-_,l=1<<w,y=l;do{l-=c,o[p+(x>>_)+l]=P<<24|j<<16|T|0}while(0!==l);for(c=1<<m-1;x&c;)c>>=1;if(0!==c?(x&=c-1,x+=c):x=0,v++,0==--O[m]){if(m===g)break;m=e[r+a[v]]}if(m>b&&(x&h)!==f){for(0===_&&(_=b),p+=y,w=m-_,k=1<<w;w+_<g&&(k-=O[w+_],!(k<=0));)w++,k<<=1;if(E+=1<<w,1===t&&E>852||2===t&&E>592)return 1;f=x&h,o[f]=b<<24|w<<16|p-i|0}}return 0!==x&&(o[p+x]=m-_<<24|64<<16|0),u.bits=b,0};const{Z_FINISH:ue,Z_BLOCK:se,Z_TREES:ce,Z_OK:le,Z_STREAM_END:fe,Z_NEED_DICT:he,Z_STREAM_ERROR:pe,Z_DATA_ERROR:de,Z_MEM_ERROR:me,Z_BUF_ERROR:ve,Z_DEFLATED:ye}=U,ge=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function we(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _e=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(_e(t))return pe;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},Ee=t=>{if(_e(t))return pe;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},xe=(t,e)=>{let r;if(_e(t))return pe;const n=t.state;return e<0?(r=0,e=-e):(r=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?pe:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Ee(t))},Ae=(t,e)=>{if(!t)return pe;const r=new we;t.state=r,r.strm=t,r.window=null,r.mode=16180;const n=xe(t,e);return n!==le&&(t.state=null),n};let Oe,Se,Pe=!0;const je=t=>{if(Pe){Oe=new Int32Array(512),Se=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ae(1,t.lens,0,288,Oe,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ae(2,t.lens,0,32,Se,0,t.work,{bits:5}),Pe=!1}t.lencode=Oe,t.lenbits=9,t.distcode=Se,t.distbits=5},Te=(t,e,r,n)=>{let o;const i=t.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),n>=i.wsize?(i.window.set(e.subarray(r-i.wsize,r),0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>n&&(o=n),i.window.set(e.subarray(r-n,r-n+o),i.wnext),(n-=o)?(i.window.set(e.subarray(r-n,r),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0};var Ne={inflateReset:Ee,inflateReset2:xe,inflateResetKeep:ke,inflateInit:t=>Ae(t,15),inflateInit2:Ae,inflate:(t,e)=>{let r,n,o,i,a,u,s,c,l,f,h,p,d,m,v,y,g,b,w,_,k,E,x=0;const A=new Uint8Array(4);let O,S;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_e(t)||!t.output||!t.input&&0!==t.avail_in)return pe;r=t.state,16191===r.mode&&(r.mode=16192),a=t.next_out,o=t.output,s=t.avail_out,i=t.next_in,n=t.input,u=t.avail_in,c=r.hold,l=r.bits,f=u,h=s,E=le;t:for(;;)switch(r.mode){case 16180:if(0===r.wrap){r.mode=16192;break}for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(2&r.wrap&&35615===c){0===r.wbits&&(r.wbits=15),r.check=0,A[0]=255&c,A[1]=c>>>8&255,r.check=F(r.check,A,2,0),c=0,l=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=ge;break}if((15&c)!==ye){t.msg="unknown compression method",r.mode=ge;break}if(c>>>=4,l-=4,k=8+(15&c),0===r.wbits&&(r.wbits=k),k>15||k>r.wbits){t.msg="invalid window size",r.mode=ge;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=512&c?16189:16191,c=0,l=0;break;case 16181:for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(r.flags=c,(255&r.flags)!==ye){t.msg="unknown compression method",r.mode=ge;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=ge;break}r.head&&(r.head.text=c>>8&1),512&r.flags&&4&r.wrap&&(A[0]=255&c,A[1]=c>>>8&255,r.check=F(r.check,A,2,0)),c=0,l=0,r.mode=16182;case 16182:for(;l<32;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.head&&(r.head.time=c),512&r.flags&&4&r.wrap&&(A[0]=255&c,A[1]=c>>>8&255,A[2]=c>>>16&255,A[3]=c>>>24&255,r.check=F(r.check,A,4,0)),c=0,l=0,r.mode=16183;case 16183:for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.head&&(r.head.xflags=255&c,r.head.os=c>>8),512&r.flags&&4&r.wrap&&(A[0]=255&c,A[1]=c>>>8&255,r.check=F(r.check,A,2,0)),c=0,l=0,r.mode=16184;case 16184:if(1024&r.flags){for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),512&r.flags&&4&r.wrap&&(A[0]=255&c,A[1]=c>>>8&255,r.check=F(r.check,A,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(p=r.length,p>u&&(p=u),p&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(i,i+p),k)),512&r.flags&&4&r.wrap&&(r.check=F(r.check,n,p,i)),u-=p,i+=p,r.length-=p),r.length))break t;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===u)break t;p=0;do{k=n[i+p++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&p<u);if(512&r.flags&&4&r.wrap&&(r.check=F(r.check,n,p,i)),u-=p,i+=p,k)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===u)break t;p=0;do{k=n[i+p++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k))}while(k&&p<u);if(512&r.flags&&4&r.wrap&&(r.check=F(r.check,n,p,i)),u-=p,i+=p,k)break t}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(4&r.wrap&&c!==(65535&r.check)){t.msg="header crc mismatch",r.mode=ge;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=16191;break;case 16189:for(;l<32;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}t.adler=r.check=be(c),c=0,l=0,r.mode=16190;case 16190:if(0===r.havedict)return t.next_out=a,t.avail_out=s,t.next_in=i,t.avail_in=u,r.hold=c,r.bits=l,he;t.adler=r.check=1,r.mode=16191;case 16191:if(e===se||e===ce)break t;case 16192:if(r.last){c>>>=7&l,l-=7&l,r.mode=16206;break}for(;l<3;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}switch(r.last=1&c,c>>>=1,l-=1,3&c){case 0:r.mode=16193;break;case 1:if(je(r),r.mode=16199,e===ce){c>>>=2,l-=2;break t}break;case 2:r.mode=16196;break;case 3:t.msg="invalid block type",r.mode=ge}c>>>=2,l-=2;break;case 16193:for(c>>>=7&l,l-=7&l;l<32;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=ge;break}if(r.length=65535&c,c=0,l=0,r.mode=16194,e===ce)break t;case 16194:r.mode=16195;case 16195:if(p=r.length,p){if(p>u&&(p=u),p>s&&(p=s),0===p)break t;o.set(n.subarray(i,i+p),a),u-=p,i+=p,s-=p,a+=p,r.length-=p;break}r.mode=16191;break;case 16196:for(;l<14;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(r.nlen=257+(31&c),c>>>=5,l-=5,r.ndist=1+(31&c),c>>>=5,l-=5,r.ncode=4+(15&c),c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=ge;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;l<3;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.lens[P[r.have++]]=7&c,c>>>=3,l-=3}for(;r.have<19;)r.lens[P[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},E=ae(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,E){t.msg="invalid code lengths set",r.mode=ge;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;x=r.lencode[c&(1<<r.lenbits)-1],v=x>>>24,y=x>>>16&255,g=65535&x,!(v<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(g<16)c>>>=v,l-=v,r.lens[r.have++]=g;else{if(16===g){for(S=v+2;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(c>>>=v,l-=v,0===r.have){t.msg="invalid bit length repeat",r.mode=ge;break}k=r.lens[r.have-1],p=3+(3&c),c>>>=2,l-=2}else if(17===g){for(S=v+3;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}c>>>=v,l-=v,k=0,p=3+(7&c),c>>>=3,l-=3}else{for(S=v+7;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}c>>>=v,l-=v,k=0,p=11+(127&c),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=ge;break}for(;p--;)r.lens[r.have++]=k}}if(r.mode===ge)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=ge;break}if(r.lenbits=9,O={bits:r.lenbits},E=ae(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,E){t.msg="invalid literal/lengths set",r.mode=ge;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},E=ae(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,E){t.msg="invalid distances set",r.mode=ge;break}if(r.mode=16199,e===ce)break t;case 16199:r.mode=16200;case 16200:if(u>=6&&s>=258){t.next_out=a,t.avail_out=s,t.next_in=i,t.avail_in=u,r.hold=c,r.bits=l,ee(t,h),a=t.next_out,o=t.output,s=t.avail_out,i=t.next_in,n=t.input,u=t.avail_in,c=r.hold,l=r.bits,16191===r.mode&&(r.back=-1);break}for(r.back=0;x=r.lencode[c&(1<<r.lenbits)-1],v=x>>>24,y=x>>>16&255,g=65535&x,!(v<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(y&&0==(240&y)){for(b=v,w=y,_=g;x=r.lencode[_+((c&(1<<b+w)-1)>>b)],v=x>>>24,y=x>>>16&255,g=65535&x,!(b+v<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=v,l-=v,r.back+=v,r.length=g,0===y){r.mode=16205;break}if(32&y){r.back=-1,r.mode=16191;break}if(64&y){t.msg="invalid literal/length code",r.mode=ge;break}r.extra=15&y,r.mode=16201;case 16201:if(r.extra){for(S=r.extra;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;x=r.distcode[c&(1<<r.distbits)-1],v=x>>>24,y=x>>>16&255,g=65535&x,!(v<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(0==(240&y)){for(b=v,w=y,_=g;x=r.distcode[_+((c&(1<<b+w)-1)>>b)],v=x>>>24,y=x>>>16&255,g=65535&x,!(b+v<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=v,l-=v,r.back+=v,64&y){t.msg="invalid distance code",r.mode=ge;break}r.offset=g,r.extra=15&y,r.mode=16203;case 16203:if(r.extra){for(S=r.extra;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=ge;break}r.mode=16204;case 16204:if(0===s)break t;if(p=h-s,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=ge;break}p>r.wnext?(p-=r.wnext,d=r.wsize-p):d=r.wnext-p,p>r.length&&(p=r.length),m=r.window}else m=o,d=a-r.offset,p=r.length;p>s&&(p=s),s-=p,r.length-=p;do{o[a++]=m[d++]}while(--p);0===r.length&&(r.mode=16200);break;case 16205:if(0===s)break t;o[a++]=r.length,s--,r.mode=16200;break;case 16206:if(r.wrap){for(;l<32;){if(0===u)break t;u--,c|=n[i++]<<l,l+=8}if(h-=s,t.total_out+=h,r.total+=h,4&r.wrap&&h&&(t.adler=r.check=r.flags?F(r.check,o,h,a-h):M(r.check,o,h,a-h)),h=s,4&r.wrap&&(r.flags?c:be(c))!==r.check){t.msg="incorrect data check",r.mode=ge;break}c=0,l=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;l<32;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(4&r.wrap&&c!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=ge;break}c=0,l=0}r.mode=16208;case 16208:E=fe;break t;case ge:E=de;break t;case 16210:return me;case 16211:default:return pe}return t.next_out=a,t.avail_out=s,t.next_in=i,t.avail_in=u,r.hold=c,r.bits=l,(r.wsize||h!==t.avail_out&&r.mode<ge&&(r.mode<16206||e!==ue))&&Te(t,t.output,t.next_out,h-t.avail_out),f-=t.avail_in,h-=t.avail_out,t.total_in+=f,t.total_out+=h,r.total+=h,4&r.wrap&&h&&(t.adler=r.check=r.flags?F(r.check,o,h,t.next_out-h):M(r.check,o,h,t.next_out-h)),t.data_type=r.bits+(r.last?64:0)+(16191===r.mode?128:0)+(16199===r.mode||16194===r.mode?256:0),(0===f&&0===h||e===ue)&&E===le&&(E=ve),E},inflateEnd:t=>{if(_e(t))return pe;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(_e(t))return pe;const r=t.state;return 0==(2&r.wrap)?pe:(r.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const r=e.length;let n,o,i;return _e(t)?pe:(n=t.state,0!==n.wrap&&16190!==n.mode?pe:16190===n.mode&&(o=1,o=M(o,e,r,0),o!==n.check)?de:(i=Te(t,e,r,r),i?(n.mode=16210,me):(n.havedict=1,le)))},inflateInfo:"pako inflate (from Nodeca project)"};var Ie=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Re=Object.prototype.toString,{Z_NO_FLUSH:Le,Z_FINISH:Ce,Z_OK:Me,Z_STREAM_END:Be,Z_NEED_DICT:Fe,Z_STREAM_ERROR:De,Z_DATA_ERROR:Ue,Z_MEM_ERROR:ze}=U;function Ge(t){this.options=Lt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zt,this.strm.avail_out=0;let r=Ne.inflateInit2(this.strm,e.windowBits);if(r!==Me)throw new Error(D[r]);if(this.header=new Ie,Ne.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Ft(e.dictionary):"[object ArrayBuffer]"===Re.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Ne.inflateSetDictionary(this.strm,e.dictionary),r!==Me)))throw new Error(D[r])}function He(t,e){const r=new Ge(e);if(r.push(t),r.err)throw r.msg||D[r.err];return r.result}Ge.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,o=this.options.dictionary;let i,a,u;if(this.ended)return!1;for(a=e===~~e?e:!0===e?Ce:Le,"[object ArrayBuffer]"===Re.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),i=Ne.inflate(r,a),i===Fe&&o&&(i=Ne.inflateSetDictionary(r,o),i===Me?i=Ne.inflate(r,a):i===Ue&&(i=Fe));r.avail_in>0&&i===Be&&r.state.wrap>0&&0!==t[r.next_in];)Ne.inflateReset(r),i=Ne.inflate(r,a);switch(i){case De:case Ue:case Fe:case ze:return this.onEnd(i),this.ended=!0,!1}if(u=r.avail_out,r.next_out&&(0===r.avail_out||i===Be))if("string"===this.options.to){let t=Ut(r.output,r.next_out),e=r.next_out-t,o=Dt(r.output,t);r.next_out=e,r.avail_out=n-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(o)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(i!==Me||0!==u){if(i===Be)return i=Ne.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ge.prototype.onData=function(t){this.chunks.push(t)},Ge.prototype.onEnd=function(t){t===Me&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qe={Inflate:Ge,inflate:He,inflateRaw:function(t,e){return(e=e||{}).raw=!0,He(t,e)},ungzip:He,constants:U};const{Deflate:Ke,deflate:We,deflateRaw:Qe,gzip:Ve}=te,{Inflate:Je,inflate:Ye,inflateRaw:Ze,ungzip:Xe}=qe;var $e=Ke,tr=We,er=Qe,rr=Ve,nr=Je,or=Ye,ir=Ze,ar=Xe,ur=U,sr={Deflate:Ke,deflate:We,deflateRaw:Qe,gzip:Ve,Inflate:Je,inflate:Ye,inflateRaw:Ze,ungzip:Xe,constants:U}},function(t,e){},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";e.sha1=r(71),e.sha224=r(72),e.sha256=r(32),e.sha384=r(73),e.sha512=r(33)},function(t,e,r){"use strict";var n=r(7),o=r(13),i=r(31),a=n.rotl32,u=n.sum32,s=n.sum32_5,c=i.ft_1,l=o.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,l),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],l=this.h[2],h=this.h[3],p=this.h[4];for(n=0;n<r.length;n++){var d=~~(n/20),m=s(a(o,5),c(d,i,l,h),p,r[n],f[d]);p=h,h=l,l=a(i,30),i=o,o=m}this.h[0]=u(this.h[0],o),this.h[1]=u(this.h[1],i),this.h[2]=u(this.h[2],l),this.h[3]=u(this.h[3],h),this.h[4]=u(this.h[4],p)},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(7),o=r(32);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(i,o),t.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var n=r(7),o=r(33);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(i,o),t.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var n=r(7),o=r(13),i=n.rotl32,a=n.sum32,u=n.sum32_3,s=n.sum32_4,c=o.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function p(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(l,c),e.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],o=this.h[2],c=this.h[3],l=this.h[4],g=r,b=n,w=o,_=c,k=l,E=0;E<80;E++){var x=a(i(s(r,f(E,n,o,c),t[d[E]+e],h(E)),v[E]),l);r=l,l=c,c=i(o,10),o=n,n=x,x=a(i(s(g,f(79-E,b,w,_),t[m[E]+e],p(E)),y[E]),k),g=k,k=_,_=i(w,10),w=b,b=x}x=u(this.h[1],o,_),this.h[1]=u(this.h[2],c,k),this.h[2]=u(this.h[3],l,g),this.h[3]=u(this.h[4],r,b),this.h[4]=u(this.h[0],n,w),this.h[0]=x},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],v=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var n=r(7),o=r(12);function i(t,e,r){if(!(this instanceof i))return new i(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=i,i.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),o(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},i.prototype.update=function(t,e){return this.inner.update(t,e),this},i.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(o.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new i(o.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(77),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(8))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,o,i,a,u,s=1,c={},l=!1,f=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){d(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){d(t.data)},n=function(t){i.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,n=function(t){var e=f.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):n=function(t){setTimeout(d,0,t)}:(a="setImmediate$"+Math.random()+"$",u=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&d(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",u,!1):t.attachEvent("onmessage",u),n=function(e){t.postMessage(a+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var o={callback:t,args:e};return c[s]=o,n(s),s++},h.clearImmediate=p}function p(t){delete c[t]}function d(t){if(l)setTimeout(d,0,t);else{var e=c[t];if(e){l=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{p(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(8),r(20))},function(t,e,r){"use strict";r.r(e),r.d(e,"ethers",(function(){return s})),r.d(e,"Signer",(function(){return Kn})),r.d(e,"Wallet",(function(){return Ou})),r.d(e,"VoidSigner",(function(){return Wn})),r.d(e,"getDefaultProvider",(function(){return Wh})),r.d(e,"providers",(function(){return i})),r.d(e,"BaseContract",(function(){return Jo})),r.d(e,"Contract",(function(){return Yo})),r.d(e,"ContractFactory",(function(){return Zo})),r.d(e,"BigNumber",(function(){return w})),r.d(e,"FixedNumber",(function(){return pi})),r.d(e,"constants",(function(){return o})),r.d(e,"errors",(function(){return h.a})),r.d(e,"logger",(function(){return _p})),r.d(e,"utils",(function(){return u})),r.d(e,"wordlists",(function(){return fa})),r.d(e,"version",(function(){return wp})),r.d(e,"Wordlist",(function(){return ea}));var n={};r.r(n),r.d(n,"encode",(function(){return nt})),r.d(n,"decode",(function(){return at}));var o={};r.r(o),r.d(o,"AddressZero",(function(){return ju})),r.d(o,"NegativeOne",(function(){return Be})),r.d(o,"Zero",(function(){return Fe})),r.d(o,"One",(function(){return De})),r.d(o,"Two",(function(){return Ue})),r.d(o,"WeiPerEther",(function(){return ze})),r.d(o,"MaxUint256",(function(){return Ge})),r.d(o,"MinInt256",(function(){return He})),r.d(o,"MaxInt256",(function(){return qe})),r.d(o,"HashZero",(function(){return Tu})),r.d(o,"EtherSymbol",(function(){return Nu}));var i={};r.r(i),r.d(i,"Provider",(function(){return Nn})),r.d(i,"BaseProvider",(function(){return _c})),r.d(i,"Resolver",(function(){return gc})),r.d(i,"UrlJsonRpcProvider",(function(){return xl})),r.d(i,"FallbackProvider",(function(){return Vf})),r.d(i,"AlchemyProvider",(function(){return Bl})),r.d(i,"AlchemyWebSocketProvider",(function(){return Ml})),r.d(i,"AnkrProvider",(function(){return Vl})),r.d(i,"CloudflareProvider",(function(){return sf})),r.d(i,"EtherscanProvider",(function(){return Af})),r.d(i,"InfuraProvider",(function(){return sh})),r.d(i,"InfuraWebSocketProvider",(function(){return uh})),r.d(i,"JsonRpcProvider",(function(){return Wc})),r.d(i,"JsonRpcBatchProvider",(function(){return vh})),r.d(i,"NodesmithProvider",(function(){return Ah})),r.d(i,"PocketProvider",(function(){return Lh})),r.d(i,"StaticJsonRpcProvider",(function(){return El})),r.d(i,"Web3Provider",(function(){return qh})),r.d(i,"WebSocketProvider",(function(){return sl})),r.d(i,"IpcProvider",(function(){return Jf})),r.d(i,"JsonRpcSigner",(function(){return Hc})),r.d(i,"getDefaultProvider",(function(){return Wh})),r.d(i,"getNetwork",(function(){return Du})),r.d(i,"isCommunityResource",(function(){return Us})),r.d(i,"isCommunityResourcable",(function(){return Ds})),r.d(i,"showThrottleMessage",(function(){return Gs})),r.d(i,"Formatter",(function(){return Fs}));var a={};r.r(a),r.d(a,"decode",(function(){return Uu})),r.d(a,"encode",(function(){return zu}));var u={};r.r(u),r.d(u,"AbiCoder",(function(){return Xr})),r.d(u,"defaultAbiCoder",(function(){return $r})),r.d(u,"Fragment",(function(){return Rr})),r.d(u,"ConstructorFragment",(function(){return Fr})),r.d(u,"ErrorFragment",(function(){return zr})),r.d(u,"EventFragment",(function(){return Lr})),r.d(u,"FunctionFragment",(function(){return Dr})),r.d(u,"ParamType",(function(){return Nr})),r.d(u,"FormatTypes",(function(){return jr})),r.d(u,"checkResultErrors",(function(){return Q})),r.d(u,"Logger",(function(){return h.b})),r.d(u,"RLP",(function(){return n})),r.d(u,"_fetchData",(function(){return js})),r.d(u,"fetchJson",(function(){return Ts})),r.d(u,"poll",(function(){return Ns})),r.d(u,"checkProperties",(function(){return C})),r.d(u,"deepCopy",(function(){return D})),r.d(u,"defineReadOnly",(function(){return I})),r.d(u,"getStatic",(function(){return R})),r.d(u,"resolveProperties",(function(){return L})),r.d(u,"shallowCopy",(function(){return M})),r.d(u,"arrayify",(function(){return c.a})),r.d(u,"concat",(function(){return c.b})),r.d(u,"stripZeros",(function(){return c.o})),r.d(u,"zeroPad",(function(){return c.p})),r.d(u,"isBytes",(function(){return c.j})),r.d(u,"isBytesLike",(function(){return c.k})),r.d(u,"defaultPath",(function(){return Ea})),r.d(u,"HDNode",(function(){return xa})),r.d(u,"SigningKey",(function(){return to})),r.d(u,"Interface",(function(){return yn})),r.d(u,"LogDescription",(function(){return fn})),r.d(u,"TransactionDescription",(function(){return hn})),r.d(u,"base58",(function(){return Gi})),r.d(u,"base64",(function(){return a})),r.d(u,"hexlify",(function(){return c.i})),r.d(u,"isHexString",(function(){return c.l})),r.d(u,"hexConcat",(function(){return c.c})),r.d(u,"hexStripZeros",(function(){return c.f})),r.d(u,"hexValue",(function(){return c.g})),r.d(u,"hexZeroPad",(function(){return c.h})),r.d(u,"hexDataLength",(function(){return c.d})),r.d(u,"hexDataSlice",(function(){return c.e})),r.d(u,"nameprep",(function(){return lp})),r.d(u,"_toEscapedUtf8String",(function(){return Pt})),r.d(u,"toUtf8Bytes",(function(){return Ot})),r.d(u,"toUtf8CodePoints",(function(){return Nt})),r.d(u,"toUtf8String",(function(){return Tt})),r.d(u,"Utf8ErrorFuncs",(function(){return xt})),r.d(u,"formatBytes32String",(function(){return fp})),r.d(u,"parseBytes32String",(function(){return hp})),r.d(u,"dnsEncode",(function(){return gs})),r.d(u,"hashMessage",(function(){return vi})),r.d(u,"namehash",(function(){return ys})),r.d(u,"isValidName",(function(){return vs})),r.d(u,"id",(function(){return It})),r.d(u,"_TypedDataEncoder",(function(){return Mi})),r.d(u,"getAddress",(function(){return mt})),r.d(u,"getIcapAddress",(function(){return yt})),r.d(u,"getContractAddress",(function(){return gt})),r.d(u,"getCreate2Address",(function(){return bt})),r.d(u,"isAddress",(function(){return vt})),r.d(u,"formatEther",(function(){return gp})),r.d(u,"parseEther",(function(){return bp})),r.d(u,"formatUnits",(function(){return vp})),r.d(u,"parseUnits",(function(){return yp})),r.d(u,"commify",(function(){return mp})),r.d(u,"computeHmac",(function(){return Ji})),r.d(u,"keccak256",(function(){return $})),r.d(u,"ripemd160",(function(){return Wi})),r.d(u,"sha256",(function(){return Qi})),r.d(u,"sha512",(function(){return Vi})),r.d(u,"randomBytes",(function(){return Ta.a})),r.d(u,"shuffled",(function(){return Of})),r.d(u,"solidityPack",(function(){return Zh})),r.d(u,"solidityKeccak256",(function(){return Xh})),r.d(u,"soliditySha256",(function(){return $h})),r.d(u,"splitSignature",(function(){return c.n})),r.d(u,"joinSignature",(function(){return c.m})),r.d(u,"accessListify",(function(){return po})),r.d(u,"parseTransaction",(function(){return wo})),r.d(u,"serializeTransaction",(function(){return go})),r.d(u,"TransactionTypes",(function(){return no})),r.d(u,"getJsonWalletAddress",(function(){return du})),r.d(u,"computeAddress",(function(){return co})),r.d(u,"recoverAddress",(function(){return lo})),r.d(u,"computePublicKey",(function(){return ro})),r.d(u,"recoverPublicKey",(function(){return eo})),r.d(u,"verifyMessage",(function(){return Su})),r.d(u,"verifyTypedData",(function(){return Pu})),r.d(u,"getAccountPath",(function(){return ja})),r.d(u,"mnemonicToEntropy",(function(){return Oa})),r.d(u,"entropyToMnemonic",(function(){return Sa})),r.d(u,"isValidMnemonic",(function(){return Pa})),r.d(u,"mnemonicToSeed",(function(){return Aa})),r.d(u,"SupportedAlgorithm",(function(){return Ui})),r.d(u,"UnicodeNormalizationForm",(function(){return wt})),r.d(u,"Utf8ErrorReason",(function(){return _t})),r.d(u,"Indexed",(function(){return dn}));var s={};r.r(s),r.d(s,"Signer",(function(){return Kn})),r.d(s,"Wallet",(function(){return Ou})),r.d(s,"VoidSigner",(function(){return Wn})),r.d(s,"getDefaultProvider",(function(){return Wh})),r.d(s,"providers",(function(){return i})),r.d(s,"BaseContract",(function(){return Jo})),r.d(s,"Contract",(function(){return Yo})),r.d(s,"ContractFactory",(function(){return Zo})),r.d(s,"BigNumber",(function(){return w})),r.d(s,"FixedNumber",(function(){return pi})),r.d(s,"constants",(function(){return o})),r.d(s,"errors",(function(){return h.a})),r.d(s,"logger",(function(){return _p})),r.d(s,"utils",(function(){return u})),r.d(s,"wordlists",(function(){return fa})),r.d(s,"version",(function(){return wp})),r.d(s,"Wordlist",(function(){return ea}));var c=r(0),l=r(2),f=r.n(l),h=r(1);function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m(n.key),n)}}function m(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==p(e)?e:e+""}var v=f.a.BN,y=new h.b("bignumber/5.7.0"),g={};var b=!1,w=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e!==g&&y.throwError("cannot call constructor directly; use BigNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}return e=t,n=[{key:"from",value:function(e){if(e instanceof t)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new t(g,_(e)):e.match(/^-?[0-9]+$/)?new t(g,_(new v(e))):y.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&x("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&x("overflow","BigNumber.from",e),t.from(String(e));var r=e;if("bigint"==typeof r)return t.from(r.toString());if(Object(c.j)(r))return t.from(Object(c.i)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return t.from(n)}else{var o=r._hex;if(null==o&&"BigNumber"===r.type&&(o=r.hex),"string"==typeof o&&(Object(c.l)(o)||"-"===o[0]&&Object(c.l)(o.substring(1))))return t.from(o)}return y.throwArgumentError("invalid BigNumber value","value",e)}},{key:"isBigNumber",value:function(t){return!(!t||!t._isBigNumber)}}],(r=[{key:"fromTwos",value:function(t){return k(E(this).fromTwos(t))}},{key:"toTwos",value:function(t){return k(E(this).toTwos(t))}},{key:"abs",value:function(){return"-"===this._hex[0]?t.from(this._hex.substring(1)):this}},{key:"add",value:function(t){return k(E(this).add(E(t)))}},{key:"sub",value:function(t){return k(E(this).sub(E(t)))}},{key:"div",value:function(e){return t.from(e).isZero()&&x("division-by-zero","div"),k(E(this).div(E(e)))}},{key:"mul",value:function(t){return k(E(this).mul(E(t)))}},{key:"mod",value:function(t){var e=E(t);return e.isNeg()&&x("division-by-zero","mod"),k(E(this).umod(e))}},{key:"pow",value:function(t){var e=E(t);return e.isNeg()&&x("negative-power","pow"),k(E(this).pow(e))}},{key:"and",value:function(t){var e=E(t);return(this.isNegative()||e.isNeg())&&x("unbound-bitwise-result","and"),k(E(this).and(e))}},{key:"or",value:function(t){var e=E(t);return(this.isNegative()||e.isNeg())&&x("unbound-bitwise-result","or"),k(E(this).or(e))}},{key:"xor",value:function(t){var e=E(t);return(this.isNegative()||e.isNeg())&&x("unbound-bitwise-result","xor"),k(E(this).xor(e))}},{key:"mask",value:function(t){return(this.isNegative()||t<0)&&x("negative-width","mask"),k(E(this).maskn(t))}},{key:"shl",value:function(t){return(this.isNegative()||t<0)&&x("negative-width","shl"),k(E(this).shln(t))}},{key:"shr",value:function(t){return(this.isNegative()||t<0)&&x("negative-width","shr"),k(E(this).shrn(t))}},{key:"eq",value:function(t){return E(this).eq(E(t))}},{key:"lt",value:function(t){return E(this).lt(E(t))}},{key:"lte",value:function(t){return E(this).lte(E(t))}},{key:"gt",value:function(t){return E(this).gt(E(t))}},{key:"gte",value:function(t){return E(this).gte(E(t))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return E(this).isZero()}},{key:"toNumber",value:function(){try{return E(this).toNumber()}catch(t){x("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(t){}return y.throwError("this platform does not support BigInt",h.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?b||(b=!0,y.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?y.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",h.b.errors.UNEXPECTED_ARGUMENT,{}):y.throwError("BigNumber.toString does not accept parameters",h.b.errors.UNEXPECTED_ARGUMENT,{})),E(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(t){return{type:"BigNumber",hex:this.toHexString()}}}])&&d(e.prototype,r),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function _(t){if("string"!=typeof t)return _(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&y.throwArgumentError("invalid hex","value",t),"0x00"===(t=_(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function k(t){return w.from(_(t))}function E(t){var e=w.from(t).toHexString();return"-"===e[0]?new v("-"+e.substring(3),16):new v(e.substring(2),16)}function x(t,e,r){var n={fault:t,operation:e};return null!=r&&(n.value=r),y.throwError(t,h.b.errors.NUMERIC_FAULT,n)}function A(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,S(n.key),n)}}function O(t,e,r){return e&&A(t.prototype,e),r&&A(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function S(t){var e=function(t,e){if("object"!=j(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==j(e)?e:e+""}function P(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */P=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new N(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(I([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==j(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(j(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var T=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},N=new h.b("properties/5.7.0");function I(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function R(t,e){for(var r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!==j(t.prototype))break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function L(t){return T(this,void 0,void 0,P().mark((function e(){var r,n;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.keys(t).map((function(e){var r=t[e];return Promise.resolve(r).then((function(t){return{key:e,value:t}}))})),e.next=3,Promise.all(r);case 3:return n=e.sent,e.abrupt("return",n.reduce((function(t,e){return t[e.key]=e.value,t}),{}));case 5:case"end":return e.stop()}}),e)})))}function C(t,e){t&&"object"===j(t)||N.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((function(r){e[r]||N.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}function M(t){var e={};for(var r in t)e[r]=t[r];return e}var B={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function F(t){if(function t(e){if(null==e||B[j(e)])return!0;if(Array.isArray(e)||"object"===j(e)){if(!Object.isFrozen(e))return!1;for(var r=Object.keys(e),n=0;n<r.length;n++){var o=null;try{o=e[r[n]]}catch(t){continue}if(!t(o))return!1}return!0}return N.throwArgumentError("Cannot deepCopy ".concat(j(e)),"object",e)}(t))return t;if(Array.isArray(t))return Object.freeze(t.map((function(t){return D(t)})));if("object"===j(t)){var e={};for(var r in t){var n=t[r];void 0!==n&&I(e,r,D(n))}return e}return N.throwArgumentError("Cannot deepCopy ".concat(j(t)),"object",t)}function D(t){return F(t)}var U=O((function t(e){for(var r in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e)this[r]=D(e[r])}));function z(t){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function G(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,K(n.key),n)}}function q(t,e,r){return e&&H(t.prototype,e),r&&H(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function K(t){var e=function(t,e){if("object"!=z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==z(e)?e:e+""}var W=new h.b("abi/5.7.0");function Q(t){var e=[];return function t(r,n){if(Array.isArray(n))for(var o in n){var i=r.slice();i.push(o);try{t(i,n[o])}catch(t){e.push({path:i,error:t})}}}([],t),e}var V=function(){return q((function t(e,r,n,o){G(this,t),this.name=e,this.type=r,this.localName=n,this.dynamic=o}),[{key:"_throwError",value:function(t,e){W.throwArgumentError(t,this.localName,e)}}])}(),J=function(){return q((function t(e){G(this,t),I(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}),[{key:"data",get:function(){return Object(c.c)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(t){return this._data.push(t),this._dataLength+=t.length,t.length}},{key:"appendWriter",value:function(t){return this._writeData(Object(c.b)(t._data))}},{key:"writeBytes",value:function(t){var e=Object(c.a)(t),r=e.length%this.wordSize;return r&&(e=Object(c.b)([e,this._padding.slice(r)])),this._writeData(e)}},{key:"_getValue",value:function(t){var e=Object(c.a)(w.from(t));return e.length>this.wordSize&&W.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=Object(c.b)([this._padding.slice(e.length%this.wordSize),e])),e}},{key:"writeValue",value:function(t){return this._writeData(this._getValue(t))}},{key:"writeUpdatableValue",value:function(){var t=this,e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){t._data[e]=t._getValue(r)}}}])}(),Y=function(){function t(e,r,n,o){G(this,t),I(this,"_data",Object(c.a)(e)),I(this,"wordSize",r||32),I(this,"_coerceFunc",n),I(this,"allowLoose",o),this._offset=0}return q(t,[{key:"data",get:function(){return Object(c.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(e,r){return this._coerceFunc?this._coerceFunc(e,r):t.coerce(e,r)}},{key:"_peekBytes",value:function(t,e,r){var n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:W.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(e){return new t(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(t,e){var r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}},{key:"readValue",value:function(){return w.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(t,e){var r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}}])}(),Z=r(35),X=r.n(Z);function $(t){return"0x"+X.a.keccak_256(Object(c.a)(t))}var tt=new h.b("rlp/5.7.0");function et(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function rt(t,e,r){for(var n=0,o=0;o<r;o++)n=256*n+t[e+o];return n}function nt(t){return Object(c.i)(function t(e){if(Array.isArray(e)){var r=[];if(e.forEach((function(e){r=r.concat(t(e))})),r.length<=55)return r.unshift(192+r.length),r;var n=et(r.length);return n.unshift(247+n.length),n.concat(r)}Object(c.k)(e)||tt.throwArgumentError("RLP object must be BytesLike","object",e);var o=Array.prototype.slice.call(Object(c.a)(e));if(1===o.length&&o[0]<=127)return o;if(o.length<=55)return o.unshift(128+o.length),o;var i=et(o.length);return i.unshift(183+i.length),i.concat(o)}(t))}function ot(t,e,r,n){for(var o=[];r<e+1+n;){var i=it(t,r);o.push(i.result),(r+=i.consumed)>e+1+n&&tt.throwError("child data too short",h.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function it(t,e){if(0===t.length&&tt.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),t[e]>=248){var r=t[e]-247;e+1+r>t.length&&tt.throwError("data short segment too short",h.b.errors.BUFFER_OVERRUN,{});var n=rt(t,e+1,r);return e+1+r+n>t.length&&tt.throwError("data long segment too short",h.b.errors.BUFFER_OVERRUN,{}),ot(t,e,e+1+r,r+n)}if(t[e]>=192){var o=t[e]-192;return e+1+o>t.length&&tt.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),ot(t,e,e+1,o)}if(t[e]>=184){var i=t[e]-183;e+1+i>t.length&&tt.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{});var a=rt(t,e+1,i);return e+1+i+a>t.length&&tt.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+i+a,result:Object(c.i)(t.slice(e+1+i,e+1+i+a))}}if(t[e]>=128){var u=t[e]-128;return e+1+u>t.length&&tt.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+u,result:Object(c.i)(t.slice(e+1,e+1+u))}}return{consumed:1,result:Object(c.i)(t[e])}}function at(t){var e=Object(c.a)(t),r=it(e,0);return r.consumed!==e.length&&tt.throwArgumentError("invalid rlp data","data",t),r.result}var ut=new h.b("address/5.7.0");function st(t){Object(c.l)(t,20)||ut.throwArgumentError("invalid address","address",t);for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);for(var o=Object(c.a)($(r)),i=0;i<40;i+=2)o[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&o[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var ct={},lt=0;lt<10;lt++)ct[String(lt)]=String(lt);for(var ft=0;ft<26;ft++)ct[String.fromCharCode(65+ft)]=String(10+ft);var ht,pt=Math.floor((ht=9007199254740991,Math.log10?Math.log10(ht):Math.log(ht)/Math.LN10));function dt(t){for(var e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((function(t){return ct[t]})).join("");e.length>=pt;){var r=e.substring(0,pt);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function mt(t){var e,r=null;if("string"!=typeof t&&ut.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),r=st(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==t&&ut.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==dt(t)&&ut.throwArgumentError("bad icap checksum","address",t),e=t.substring(4),r=new v(e,36).toString(16);r.length<40;)r="0"+r;r=st("0x"+r)}else ut.throwArgumentError("invalid address","address",t);return r}function vt(t){try{return mt(t),!0}catch(t){}return!1}function yt(t){for(var e,r=(e=mt(t).substring(2),new v(e,16).toString(36)).toUpperCase();r.length<30;)r="0"+r;return"XE"+dt("XE00"+r)+r}function gt(t){var e=null;try{e=mt(t.from)}catch(e){ut.throwArgumentError("missing from address","transaction",t)}var r=Object(c.o)(Object(c.a)(w.from(t.nonce).toHexString()));return mt(Object(c.e)($(nt([e,r])),12))}function bt(t,e,r){return 32!==Object(c.d)(e)&&ut.throwArgumentError("salt must be 32 bytes","salt",e),32!==Object(c.d)(r)&&ut.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),mt(Object(c.e)($(Object(c.b)(["0xff",mt(t),e,r])),12))}var wt,_t,kt=new h.b("strings/5.7.0");function Et(t,e,r,n,o){if(t===_t.BAD_PREFIX||t===_t.UNEXPECTED_CONTINUE){for(var i=0,a=e+1;a<r.length&&r[a]>>6==2;a++)i++;return i}return t===_t.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(wt||(wt={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(_t||(_t={}));var xt=Object.freeze({error:function(t,e,r,n,o){return kt.throwArgumentError("invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",r)},ignore:Et,replace:function(t,e,r,n,o){return t===_t.OVERLONG?(n.push(o),0):(n.push(65533),Et(t,e,r))}});function At(t,e){null==e&&(e=xt.error),t=Object(c.a)(t);for(var r=[],n=0;n<t.length;){var o=t[n++];if(o>>7!=0){var i=null,a=null;if(192==(224&o))i=1,a=127;else if(224==(240&o))i=2,a=2047;else{if(240!=(248&o)){n+=e(128==(192&o)?_t.UNEXPECTED_CONTINUE:_t.BAD_PREFIX,n-1,t,r);continue}i=3,a=65535}if(n-1+i>=t.length)n+=e(_t.OVERRUN,n-1,t,r);else{for(var u=o&(1<<8-i-1)-1,s=0;s<i;s++){var l=t[n];if(128!=(192&l)){n+=e(_t.MISSING_CONTINUE,n,t,r),u=null;break}u=u<<6|63&l,n++}null!==u&&(u>1114111?n+=e(_t.OUT_OF_RANGE,n-1-i,t,r,u):u>=55296&&u<=57343?n+=e(_t.UTF16_SURROGATE,n-1-i,t,r,u):u<=a?n+=e(_t.OVERLONG,n-1-i,t,r,u):r.push(u))}}else r.push(o)}return r}function Ot(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wt.current;e!=wt.current&&(kt.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n<t.length;n++){var o=t.charCodeAt(n);if(o<128)r.push(o);else if(o<2048)r.push(o>>6|192),r.push(63&o|128);else if(55296==(64512&o)){n++;var i=t.charCodeAt(n);if(n>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");var a=65536+((1023&o)<<10)+(1023&i);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(o>>12|224),r.push(o>>6&63|128),r.push(63&o|128)}return Object(c.a)(r)}function St(t){var e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function Pt(t,e){return'"'+At(t,e).map((function(t){if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?St(t):St(55296+((t-=65536)>>10&1023))+St(56320+(1023&t))})).join("")+'"'}function jt(t){return t.map((function(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t)))})).join("")}function Tt(t,e){return jt(At(t,e))}function Nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wt.current;return At(Ot(t,e))}function It(t){return $(Ot(t))}function Rt(t){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ct(n.key),n)}}function Ct(t){var e=function(t,e){if("object"!=Rt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Rt(e)?e:e+""}function Mt(t,e,r){return e=Bt(e),function(t,e){if(e&&("object"==Rt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Bt(t).constructor):e.apply(t,r))}function Bt(t){return(Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ft(t,e){return(Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Dt=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Mt(this,e,["address","address",t,!1])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ft(t,e)}(e,t),r=e,(n=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(t,e){try{e=mt(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}},{key:"decode",value:function(t){return mt(Object(c.h)(t.readValue().toHexString(),20))}}])&&Lt(r.prototype,n),o&&Lt(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(V);function Ut(t){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gt(n.key),n)}}function Gt(t){var e=function(t,e){if("object"!=Ut(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ut(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ut(e)?e:e+""}function Ht(t,e,r){return e=qt(e),function(t,e){if(e&&("object"==Ut(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],qt(t).constructor):e.apply(t,r))}function qt(t){return(qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Kt(t,e){return(Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Wt=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Ht(this,e,[t.name,t.type,void 0,t.dynamic])).coder=t,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kt(t,e)}(e,t),r=e,(n=[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(t,e){return this.coder.encode(t,e)}},{key:"decode",value:function(t){return this.coder.decode(t)}}])&&zt(r.prototype,n),o&&zt(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(V);function Qt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vt(n.key),n)}}function Vt(t){var e=function(t,e){if("object"!=Xt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Xt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Xt(e)?e:e+""}function Jt(t,e,r){return e=Yt(e),function(t,e){if(e&&("object"==Xt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Yt(t).constructor):e.apply(t,r))}function Yt(t){return(Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zt(t,e){return(Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xt(t){return(Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var $t=new h.b("abi/5.7.0");function te(t,e,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===Xt(r)){var o={};n=e.map((function(t){var e=t.localName;return e||$t.throwError("cannot encode object for signature with missing names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),o[e]&&$t.throwError("cannot encode object for signature with duplicate names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),o[e]=!0,r[e]}))}else $t.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&$t.throwArgumentError("types/value length mismatch","tuple",r);var i=new J(t.wordSize),a=new J(t.wordSize),u=[];e.forEach((function(t,e){var r=n[e];if(t.dynamic){var o=a.length;t.encode(a,r);var s=i.writeUpdatableValue();u.push((function(t){s(t+o)}))}else t.encode(i,r)})),u.forEach((function(t){t(i.length)}));var s=t.appendWriter(i);return s+=t.appendWriter(a)}function ee(t,e){var r=[],n=t.subReader(0);e.forEach((function(e){var o=null;if(e.dynamic){var i=t.readValue(),a=n.subReader(i.toNumber());try{o=e.decode(a)}catch(t){if(t.code===h.b.errors.BUFFER_OVERRUN)throw t;(o=t).baseType=e.name,o.name=e.localName,o.type=e.type}}else try{o=e.decode(t)}catch(t){if(t.code===h.b.errors.BUFFER_OVERRUN)throw t;(o=t).baseType=e.name,o.name=e.localName,o.type=e.type}null!=o&&r.push(o)}));var o=e.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach((function(t,e){var n=t.localName;if(n&&1===o[n]&&("length"===n&&(n="_length"),null==r[n])){var i=r[e];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw i}}):r[n]=i}}));for(var i=function(){var t=r[a];t instanceof Error&&Object.defineProperty(r,a,{enumerable:!0,get:function(){throw t}})},a=0;a<r.length;a++)i();return Object.freeze(r)}var re=function(t){function e(t,r,n){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=Jt(this,e,["array",t.type+"["+(r>=0?r:"")+"]",n,-1===r||t.dynamic])).coder=t,o.length=r,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zt(t,e)}(e,t),r=e,(n=[{key:"defaultValue",value:function(){for(var t=this.coder.defaultValue(),e=[],r=0;r<this.length;r++)e.push(t);return e}},{key:"encode",value:function(t,e){Array.isArray(e)||this._throwError("expected array value",e);var r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),$t.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],o=0;o<e.length;o++)n.push(this.coder);return te(t,n,e)}},{key:"decode",value:function(t){var e=this.length;-1===e&&32*(e=t.readValue().toNumber())>t._data.length&&$t.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:t._data.length,count:e});for(var r=[],n=0;n<e;n++)r.push(new Wt(this.coder));return t.coerce(this.name,ee(t,r))}}])&&Qt(r.prototype,n),o&&Qt(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(V);function ne(t){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ie(n.key),n)}}function ie(t){var e=function(t,e){if("object"!=ne(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ne(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ne(e)?e:e+""}function ae(t,e,r){return e=ue(e),function(t,e){if(e&&("object"==ne(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ue(t).constructor):e.apply(t,r))}function ue(t){return(ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function se(t,e){return(se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var ce=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),ae(this,e,["bool","bool",t,!1])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&se(t,e)}(e,t),r=e,(n=[{key:"defaultValue",value:function(){return!1}},{key:"encode",value:function(t,e){return t.writeValue(e?1:0)}},{key:"decode",value:function(t){return t.coerce(this.type,!t.readValue().isZero())}}])&&oe(r.prototype,n),o&&oe(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(V);function le(t){return(le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fe(){return(fe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=he(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function he(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ge(t)););return t}function pe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function de(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ve(n.key),n)}}function me(t,e,r){return e&&de(t.prototype,e),r&&de(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ve(t){var e=function(t,e){if("object"!=le(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==le(e)?e:e+""}function ye(t,e,r){return e=ge(e),function(t,e){if(e&&("object"==le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ge(t).constructor):e.apply(t,r))}function ge(t){return(ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function be(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&we(t,e)}function we(t,e){return(we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var _e=function(t){function e(t,r){return pe(this,e),ye(this,e,[t,t,r,!0])}return be(e,t),me(e,[{key:"defaultValue",value:function(){return"0x"}},{key:"encode",value:function(t,e){e=Object(c.a)(e);var r=t.writeValue(e.length);return r+=t.writeBytes(e)}},{key:"decode",value:function(t){return t.readBytes(t.readValue().toNumber(),!0)}}])}(V),ke=function(t){function e(t){return pe(this,e),ye(this,e,["bytes",t])}return be(e,t),me(e,[{key:"decode",value:function(t){return t.coerce(this.name,Object(c.i)(fe(ge(e.prototype),"decode",this).call(this,t)))}}])}(_e);function Ee(t){return(Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ae(n.key),n)}}function Ae(t){var e=function(t,e){if("object"!=Ee(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ee(e)?e:e+""}function Oe(t,e,r){return e=Se(e),function(t,e){if(e&&("object"==Ee(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Se(t).constructor):e.apply(t,r))}function Se(t){return(Se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pe(t,e){return(Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var je=function(t){function e(t,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o="bytes"+String(t);return(n=Oe(this,e,[o,o,r,!1])).size=t,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pe(t,e)}(e,t),r=e,(n=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}},{key:"encode",value:function(t,e){var r=Object(c.a)(e);return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}},{key:"decode",value:function(t){return t.coerce(this.name,Object(c.i)(t.readBytes(this.size)))}}])&&xe(r.prototype,n),o&&xe(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(V);function Te(t){return(Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ie(n.key),n)}}function Ie(t){var e=function(t,e){if("object"!=Te(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Te(e)?e:e+""}function Re(t,e,r){return e=Le(e),function(t,e){if(e&&("object"==Te(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Le(t).constructor):e.apply(t,r))}function Le(t){return(Le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ce(t,e){return(Ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Me=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Re(this,e,["null","",t,!1])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ce(t,e)}(e,t),r=e,(n=[{key:"defaultValue",value:function(){return null}},{key:"encode",value:function(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}},{key:"decode",value:function(t){return t.readBytes(0),t.coerce(this.name,null)}}])&&Ne(r.prototype,n),o&&Ne(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(V),Be=w.from(-1),Fe=w.from(0),De=w.from(1),Ue=w.from(2),ze=w.from("1000000000000000000"),Ge=w.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),He=w.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),qe=w.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Ke(t){return(Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function We(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qe(n.key),n)}}function Qe(t){var e=function(t,e){if("object"!=Ke(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ke(e)?e:e+""}function Ve(t,e,r){return e=Je(e),function(t,e){if(e&&("object"==Ke(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Je(t).constructor):e.apply(t,r))}function Je(t){return(Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ye(t,e){return(Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Ze=function(t){function e(t,r,n){var o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=(r?"int":"uint")+8*t;return(o=Ve(this,e,[i,i,n,!1])).size=t,o.signed=r,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ye(t,e)}(e,t),r=e,(n=[{key:"defaultValue",value:function(){return 0}},{key:"encode",value:function(t,e){var r=w.from(e),n=Ge.mask(8*t.wordSize);if(this.signed){var o=n.mask(8*this.size-1);(r.gt(o)||r.lt(o.add(De).mul(Be)))&&this._throwError("value out-of-bounds",e)}else(r.lt(Fe)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(r)}},{key:"decode",value:function(t){var e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}])&&We(r.prototype,n),o&&We(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(V);function Xe(t){return(Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tr(n.key),n)}}function tr(t){var e=function(t,e){if("object"!=Xe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Xe(e)?e:e+""}function er(t,e,r){return e=or(e),function(t,e){if(e&&("object"==Xe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],or(t).constructor):e.apply(t,r))}function rr(){return(rr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=nr(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function nr(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=or(t)););return t}function or(t){return(or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ir(t,e){return(ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var ar=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),er(this,e,["string",t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ir(t,e)}(e,t),r=e,(n=[{key:"defaultValue",value:function(){return""}},{key:"encode",value:function(t,r){return rr(or(e.prototype),"encode",this).call(this,t,Ot(r))}},{key:"decode",value:function(t){return Tt(rr(or(e.prototype),"decode",this).call(this,t))}}])&&$e(r.prototype,n),o&&$e(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(_e);function ur(t){return(ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,cr(n.key),n)}}function cr(t){var e=function(t,e){if("object"!=ur(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ur(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ur(e)?e:e+""}function lr(t,e,r){return e=fr(e),function(t,e){if(e&&("object"==ur(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],fr(t).constructor):e.apply(t,r))}function fr(t){return(fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hr(t,e){return(hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var pr=function(t){function e(t,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=!1,i=[];return t.forEach((function(t){t.dynamic&&(o=!0),i.push(t.type)})),(n=lr(this,e,["tuple","tuple("+i.join(",")+")",r,o])).coders=t,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hr(t,e)}(e,t),r=e,(n=[{key:"defaultValue",value:function(){var t=[];this.coders.forEach((function(e){t.push(e.defaultValue())}));var e=this.coders.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach((function(r,n){var o=r.localName;o&&1===e[o]&&("length"===o&&(o="_length"),null==t[o]&&(t[o]=t[n]))})),Object.freeze(t)}},{key:"encode",value:function(t,e){return te(t,this.coders,e)}},{key:"decode",value:function(t){return t.coerce(this.name,ee(t,this.coders))}}])&&sr(r.prototype,n),o&&sr(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(V);function dr(t){return(dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mr(t,e,r){return e=vr(e),function(t,e){if(e&&("object"==dr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],vr(t).constructor):e.apply(t,r))}function vr(t){return(vr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yr(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gr(t,e)}function gr(t,e){return(gr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,kr(n.key),n)}}function _r(t,e,r){return e&&wr(t.prototype,e),r&&wr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function kr(t){var e=function(t,e){if("object"!=dr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dr(e)?e:e+""}var Er=new h.b("abi/5.7.0"),xr={},Ar={calldata:!0,memory:!0,storage:!0},Or={calldata:!0,memory:!0};function Sr(t,e){if("bytes"===t||"string"===t){if(Ar[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&Or[e])return!0;return(Ar[e]||"payable"===e)&&Er.throwArgumentError("invalid modifier","name",e),!1}function Pr(t,e){for(var r in e)I(t,r,e[r])}var jr=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Tr=new RegExp(/^(.*)\[([0-9]*)\]$/),Nr=function(){function t(e,r){br(this,t),e!==xr&&Er.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Pr(this,r);var n=this.type.match(Tr);Pr(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:t.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return _r(t,[{key:"format",value:function(t){if(t||(t=jr.sighash),jr[t]||Er.throwArgumentError("invalid format type","format",t),t===jr.json){var e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((function(e){return JSON.parse(e.format(t))}))),JSON.stringify(e)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(t),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==jr.sighash&&(r+=this.type),r+="("+this.components.map((function(e){return e.format(t)})).join(t===jr.full?", ":",")+")"):r+=this.type,t!==jr.sighash&&(!0===this.indexed&&(r+=" indexed"),t===jr.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(e,r){return"string"==typeof e?t.fromString(e,r):t.fromObject(e)}},{key:"fromObject",value:function(e){return t.isParamType(e)?e:new t(xr,{name:e.name||null,type:Gr(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(t.fromObject):null})}},{key:"fromString",value:function(e,r){return function(e){return t.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}(function(t,e){var r=t;function n(e){Er.throwArgumentError("unexpected character at position ".concat(e),"param",t)}function o(t){var r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},a=i,u=0;u<t.length;u++){var s=t[u];switch(s){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(u),a.state.allowType=!1,a.type=Gr(a.type),a.components=[o(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(e||n(u),a.indexed=!0,a.name=""),Sr(a.type,a.name)&&(a.name=""),a.type=Gr(a.type);var c=a;(a=a.parent)||n(u),delete c.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(e||n(u),a.indexed=!0,a.name=""),Sr(a.type,a.name)&&(a.name=""),a.type=Gr(a.type);var l=o(a.parent);a.parent.components.push(l),delete a.parent,a=l;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Gr(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(e||n(u),a.indexed&&n(u),a.indexed=!0,a.name=""):Sr(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(u),a.type+=s,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(u),a.type+=s,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=s,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=s,delete a.state.allowArray):a.state.readArray?a.type+=s:n(u)}}return a.parent&&Er.throwArgumentError("unexpected eof","param",t),delete i.state,"indexed"===a.name?(e||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):Sr(a.type,a.name)&&(a.name=""),i.type=Gr(i.type),i}(e,!!r))}},{key:"isParamType",value:function(t){return!(null==t||!t._isParamType)}}])}();function Ir(t,e){return function(t){t=t.trim();for(var e=[],r="",n=0,o=0;o<t.length;o++){var i=t[o];","===i&&0===n?(e.push(r),r=""):(r+=i,"("===i?n++:")"===i&&-1===--n&&Er.throwArgumentError("unbalanced parenthesis","value",t))}r&&e.push(r);return e}(t).map((function(t){return Nr.fromString(t,e)}))}var Rr=function(){function t(e,r){br(this,t),e!==xr&&Er.throwError("use a static from method",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Pr(this,r),this._isFragment=!0,Object.freeze(this)}return _r(t,null,[{key:"from",value:function(e){return t.isFragment(e)?e:"string"==typeof e?t.fromString(e):t.fromObject(e)}},{key:"fromObject",value:function(e){if(t.isFragment(e))return e;switch(e.type){case"function":return Dr.fromObject(e);case"event":return Lr.fromObject(e);case"constructor":return Fr.fromObject(e);case"error":return zr.fromObject(e);case"fallback":case"receive":return null}return Er.throwArgumentError("invalid fragment object","value",e)}},{key:"fromString",value:function(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Lr.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?Dr.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?Fr.fromString(t.trim()):"error"===t.split(" ")[0]?zr.fromString(t.substring(5).trim()):Er.throwArgumentError("unsupported fragment","value",t)}},{key:"isFragment",value:function(t){return!(!t||!t._isFragment)}}])}(),Lr=function(t){function e(){return br(this,e),mr(this,e,arguments)}return yr(e,t),_r(e,[{key:"format",value:function(t){if(t||(t=jr.sighash),jr[t]||Er.throwArgumentError("invalid format type","format",t),t===jr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==jr.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===jr.full?", ":",")+") ",t!==jr.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}},{key:"fromObject",value:function(t){if(e.isEventFragment(t))return t;"event"!==t.type&&Er.throwArgumentError("invalid event object","value",t);var r={name:qr(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Nr.fromObject):[],type:"event"};return new e(xr,r)}},{key:"fromString",value:function(t){var r=t.match(Kr);r||Er.throwArgumentError("invalid event string","value",t);var n=!1;return r[3].split(" ").forEach((function(t){switch(t.trim()){case"anonymous":n=!0;break;case"":break;default:Er.warn("unknown modifier: "+t)}})),e.fromObject({name:r[1].trim(),anonymous:n,inputs:Ir(r[2],!0),type:"event"})}},{key:"isEventFragment",value:function(t){return t&&t._isFragment&&"event"===t.type}}])}(Rr);function Cr(t,e){e.gas=null;var r=t.split("@");return 1!==r.length?(r.length>2&&Er.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Er.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=w.from(r[1]),r[0]):t}function Mr(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((function(t){switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function Br(t){var e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&Er.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&Er.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||Er.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Er.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&Er.throwArgumentError("unable to determine stateMutability","value",t),e}var Fr=function(t){function e(){return br(this,e),mr(this,e,arguments)}return yr(e,t),_r(e,[{key:"format",value:function(t){if(t||(t=jr.sighash),jr[t]||Er.throwArgumentError("invalid format type","format",t),t===jr.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((function(e){return JSON.parse(e.format(t))}))});t===jr.sighash&&Er.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var e="constructor("+this.inputs.map((function(e){return e.format(t)})).join(t===jr.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}},{key:"fromObject",value:function(t){if(e.isConstructorFragment(t))return t;"constructor"!==t.type&&Er.throwArgumentError("invalid constructor object","value",t);var r=Br(t);r.constant&&Er.throwArgumentError("constructor cannot be constant","value",t);var n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Nr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?w.from(t.gas):null};return new e(xr,n)}},{key:"fromString",value:function(t){var r={type:"constructor"},n=(t=Cr(t,r)).match(Kr);return n&&"constructor"===n[1].trim()||Er.throwArgumentError("invalid constructor string","value",t),r.inputs=Ir(n[2].trim(),!1),Mr(n[3].trim(),r),e.fromObject(r)}},{key:"isConstructorFragment",value:function(t){return t&&t._isFragment&&"constructor"===t.type}}])}(Rr),Dr=function(t){function e(){return br(this,e),mr(this,e,arguments)}return yr(e,t),_r(e,[{key:"format",value:function(t){if(t||(t=jr.sighash),jr[t]||Er.throwArgumentError("invalid format type","format",t),t===jr.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((function(e){return JSON.parse(e.format(t))})),outputs:this.outputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==jr.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===jr.full?", ":",")+") ",t!==jr.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((function(e){return e.format(t)})).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}},{key:"fromObject",value:function(t){if(e.isFunctionFragment(t))return t;"function"!==t.type&&Er.throwArgumentError("invalid function object","value",t);var r=Br(t),n={type:t.type,name:qr(t.name),constant:r.constant,inputs:t.inputs?t.inputs.map(Nr.fromObject):[],outputs:t.outputs?t.outputs.map(Nr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?w.from(t.gas):null};return new e(xr,n)}},{key:"fromString",value:function(t){var r={type:"function"},n=(t=Cr(t,r)).split(" returns ");n.length>2&&Er.throwArgumentError("invalid function string","value",t);var o=n[0].match(Kr);if(o||Er.throwArgumentError("invalid function signature","value",t),r.name=o[1].trim(),r.name&&qr(r.name),r.inputs=Ir(o[2],!1),Mr(o[3].trim(),r),n.length>1){var i=n[1].match(Kr);""==i[1].trim()&&""==i[3].trim()||Er.throwArgumentError("unexpected tokens","value",t),r.outputs=Ir(i[2],!1)}else r.outputs=[];return e.fromObject(r)}},{key:"isFunctionFragment",value:function(t){return t&&t._isFragment&&"function"===t.type}}])}(Fr);function Ur(t){var e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||Er.throwArgumentError("cannot specify user defined ".concat(e," error"),"fragment",t),t}var zr=function(t){function e(){return br(this,e),mr(this,e,arguments)}return yr(e,t),_r(e,[{key:"format",value:function(t){if(t||(t=jr.sighash),jr[t]||Er.throwArgumentError("invalid format type","format",t),t===jr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==jr.sighash&&(e+="error "),(e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===jr.full?", ":",")+") ").trim()}}],[{key:"from",value:function(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}},{key:"fromObject",value:function(t){if(e.isErrorFragment(t))return t;"error"!==t.type&&Er.throwArgumentError("invalid error object","value",t);var r={type:t.type,name:qr(t.name),inputs:t.inputs?t.inputs.map(Nr.fromObject):[]};return Ur(new e(xr,r))}},{key:"fromString",value:function(t){var r={type:"error"},n=t.match(Kr);return n||Er.throwArgumentError("invalid error signature","value",t),r.name=n[1].trim(),r.name&&qr(r.name),r.inputs=Ir(n[2],!1),Ur(e.fromObject(r))}},{key:"isErrorFragment",value:function(t){return t&&t._isFragment&&"error"===t.type}}])}(Rr);function Gr(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}var Hr=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function qr(t){return t&&t.match(Hr)||Er.throwArgumentError('invalid identifier "'.concat(t,'"'),"value",t),t}var Kr=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Wr(t){return(Wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vr(n.key),n)}}function Vr(t){var e=function(t,e){if("object"!=Wr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Wr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Wr(e)?e:e+""}var Jr=new h.b("abi/5.7.0"),Yr=new RegExp(/^bytes([0-9]*)$/),Zr=new RegExp(/^(u?int)([0-9]*)$/),Xr=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),I(this,"coerceFunc",e||null)},(e=[{key:"_getCoder",value:function(t){var e=this;switch(t.baseType){case"address":return new Dt(t.name);case"bool":return new ce(t.name);case"string":return new ar(t.name);case"bytes":return new ke(t.name);case"array":return new re(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new pr((t.components||[]).map((function(t){return e._getCoder(t)})),t.name);case"":return new Me(t.name)}var r=t.type.match(Zr);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&Jr.throwArgumentError("invalid "+r[1]+" bit length","param",t),new Ze(n/8,"int"===r[1],t.name)}if(r=t.type.match(Yr)){var o=parseInt(r[1]);return(0===o||o>32)&&Jr.throwArgumentError("invalid bytes length","param",t),new je(o,t.name)}return Jr.throwArgumentError("invalid type","type",t.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(t,e){return new Y(t,this._getWordSize(),this.coerceFunc,e)}},{key:"_getWriter",value:function(){return new J(this._getWordSize())}},{key:"getDefaultValue",value:function(t){var e=this,r=t.map((function(t){return e._getCoder(Nr.from(t))}));return new pr(r,"_").defaultValue()}},{key:"encode",value:function(t,e){var r=this;t.length!==e.length&&Jr.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var n=t.map((function(t){return r._getCoder(Nr.from(t))})),o=new pr(n,"_"),i=this._getWriter();return o.encode(i,e),i.data}},{key:"decode",value:function(t,e,r){var n=this,o=t.map((function(t){return n._getCoder(Nr.from(t))}));return new pr(o,"_").decode(this._getReader(Object(c.a)(e),r))}}])&&Qr(t.prototype,e),r&&Qr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),$r=new Xr;function tn(t){return(tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function en(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nn(n.key),n)}}function rn(t,e,r){return e&&en(t.prototype,e),r&&en(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nn(t){var e=function(t,e){if("object"!=tn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==tn(e)?e:e+""}function on(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function an(t,e,r){return e=un(e),function(t,e){if(e&&("object"==tn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],un(t).constructor):e.apply(t,r))}function un(t){return(un=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function sn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cn(t,e)}function cn(t,e){return(cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var ln=new h.b("abi/5.7.0"),fn=function(t){function e(){return on(this,e),an(this,e,arguments)}return sn(e,t),rn(e)}(U),hn=function(t){function e(){return on(this,e),an(this,e,arguments)}return sn(e,t),rn(e)}(U),pn=function(t){function e(){return on(this,e),an(this,e,arguments)}return sn(e,t),rn(e)}(U),dn=function(t){function e(){return on(this,e),an(this,e,arguments)}return sn(e,t),rn(e,null,[{key:"isIndexed",value:function(t){return!(!t||!t._isIndexed)}}])}(U),mn={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function vn(t,e){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(t));return r.error=e,r}var yn=function(){return rn((function t(e){var r=this;on(this,t),I(this,"fragments",("string"==typeof e?JSON.parse(e):e).map((function(t){return Rr.from(t)})).filter((function(t){return null!=t}))),I(this,"_abiCoder",R(this instanceof t?this.constructor:void 0,"getAbiCoder")()),I(this,"functions",{}),I(this,"errors",{}),I(this,"events",{}),I(this,"structs",{}),this.fragments.forEach((function(t){var e=null;switch(t.type){case"constructor":return r.deploy?void ln.warn("duplicate definition - constructor"):void I(r,"deploy",t);case"function":e=r.functions;break;case"event":e=r.events;break;case"error":e=r.errors;break;default:return}var n=t.format();e[n]?ln.warn("duplicate definition - "+n):e[n]=t})),this.deploy||I(this,"deploy",Fr.from({payable:!1,type:"constructor"})),I(this,"_isInterface",!0)}),[{key:"format",value:function(t){t||(t=jr.full),t===jr.sighash&&ln.throwArgumentError("interface does not support formatting sighash","format",t);var e=this.fragments.map((function(e){return e.format(t)}));return t===jr.json?JSON.stringify(e.map((function(t){return JSON.parse(t)}))):e}},{key:"getFunction",value:function(t){if(Object(c.l)(t)){for(var e in this.functions)if(t===this.getSighash(e))return this.functions[e];ln.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){var r=t.trim(),n=Object.keys(this.functions).filter((function(t){return t.split("(")[0]===r}));return 0===n.length?ln.throwArgumentError("no matching function","name",r):n.length>1&&ln.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var o=this.functions[Dr.fromString(t).format()];return o||ln.throwArgumentError("no matching function","signature",t),o}},{key:"getEvent",value:function(t){if(Object(c.l)(t)){var e=t.toLowerCase();for(var r in this.events)if(e===this.getEventTopic(r))return this.events[r];ln.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){var n=t.trim(),o=Object.keys(this.events).filter((function(t){return t.split("(")[0]===n}));return 0===o.length?ln.throwArgumentError("no matching event","name",n):o.length>1&&ln.throwArgumentError("multiple matching events","name",n),this.events[o[0]]}var i=this.events[Lr.fromString(t).format()];return i||ln.throwArgumentError("no matching event","signature",t),i}},{key:"getError",value:function(t){if(Object(c.l)(t)){var e=R(this.constructor,"getSighash");for(var r in this.errors){if(t===e(this.errors[r]))return this.errors[r]}ln.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){var n=t.trim(),o=Object.keys(this.errors).filter((function(t){return t.split("(")[0]===n}));return 0===o.length?ln.throwArgumentError("no matching error","name",n):o.length>1&&ln.throwArgumentError("multiple matching errors","name",n),this.errors[o[0]]}var i=this.errors[Dr.fromString(t).format()];return i||ln.throwArgumentError("no matching error","signature",t),i}},{key:"getSighash",value:function(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return R(this.constructor,"getSighash")(t)}},{key:"getEventTopic",value:function(t){return"string"==typeof t&&(t=this.getEvent(t)),R(this.constructor,"getEventTopic")(t)}},{key:"_decodeParams",value:function(t,e){return this._abiCoder.decode(t,e)}},{key:"_encodeParams",value:function(t,e){return this._abiCoder.encode(t,e)}},{key:"encodeDeploy",value:function(t){return this._encodeParams(this.deploy.inputs,t||[])}},{key:"decodeErrorResult",value:function(t,e){"string"==typeof t&&(t=this.getError(t));var r=Object(c.a)(e);return Object(c.i)(r.slice(0,4))!==this.getSighash(t)&&ln.throwArgumentError("data signature does not match error ".concat(t.name,"."),"data",Object(c.i)(r)),this._decodeParams(t.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(t,e){return"string"==typeof t&&(t=this.getError(t)),Object(c.i)(Object(c.b)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}},{key:"decodeFunctionData",value:function(t,e){"string"==typeof t&&(t=this.getFunction(t));var r=Object(c.a)(e);return Object(c.i)(r.slice(0,4))!==this.getSighash(t)&&ln.throwArgumentError("data signature does not match function ".concat(t.name,"."),"data",Object(c.i)(r)),this._decodeParams(t.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Object(c.i)(Object(c.b)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}},{key:"decodeFunctionResult",value:function(t,e){"string"==typeof t&&(t=this.getFunction(t));var r=Object(c.a)(e),n=null,o="",i=null,a=null,u=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(f){}break;case 4:var s=Object(c.i)(r.slice(0,4)),l=mn[s];if(l)i=this._abiCoder.decode(l.inputs,r.slice(4)),a=l.name,u=l.signature,l.reason&&(n=i[0]),"Error"===a?o="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(i[0])):"Panic"===a&&(o="; VM Exception while processing transaction: reverted with panic code ".concat(i[0]));else try{var f=this.getError(s);i=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,u=f.format()}catch(f){}}return ln.throwError("call revert exception"+o,h.b.errors.CALL_EXCEPTION,{method:t.format(),data:Object(c.i)(e),errorArgs:i,errorName:a,errorSignature:u,reason:n})}},{key:"encodeFunctionResult",value:function(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Object(c.i)(this._abiCoder.encode(t.outputs,e||[]))}},{key:"encodeFilterTopics",value:function(t,e){var r=this;"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&ln.throwError("too many arguments for "+t.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});var n=[];t.anonymous||n.push(this.getEventTopic(t));var o=function(t,e){return"string"===t.type?It(e):"bytes"===t.type?$(Object(c.i)(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=w.from(e).toHexString()),"address"===t.type&&r._abiCoder.encode(["address"],[e]),Object(c.h)(Object(c.i)(e),32))};for(e.forEach((function(e,r){var i=t.inputs[r];i.indexed?null==e?n.push(null):"array"===i.baseType||"tuple"===i.baseType?ln.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,e):Array.isArray(e)?n.push(e.map((function(t){return o(i,t)}))):n.push(o(i,e)):null!=e&&ln.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(t,e){var r=this;"string"==typeof t&&(t=this.getEvent(t));var n=[],o=[],i=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&ln.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach((function(t,a){var u=e[a];if(t.indexed)if("string"===t.type)n.push(It(u));else if("bytes"===t.type)n.push($(u));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([t.type],[u]))}else o.push(t),i.push(u)})),{data:this._abiCoder.encode(o,i),topics:n}}},{key:"decodeEventLog",value:function(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){var n=this.getEventTopic(t);Object(c.l)(r[0],32)&&r[0].toLowerCase()===n||ln.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var o=[],i=[],a=[];t.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(o.push(Nr.fromObject({type:"bytes32",name:t.name})),a.push(!0)):(o.push(t),a.push(!1)):(i.push(t),a.push(!1))}));var u=null!=r?this._abiCoder.decode(o,Object(c.b)(r)):null,s=this._abiCoder.decode(i,e,!0),l=[],f=0,p=0;t.inputs.forEach((function(t,e){if(t.indexed)if(null==u)l[e]=new dn({_isIndexed:!0,hash:null});else if(a[e])l[e]=new dn({_isIndexed:!0,hash:u[p++]});else try{l[e]=u[p++]}catch(t){l[e]=t}else try{l[e]=s[f++]}catch(t){l[e]=t}if(t.name&&null==l[t.name]){var r=l[e];r instanceof Error?Object.defineProperty(l,t.name,{enumerable:!0,get:function(){throw vn("property ".concat(JSON.stringify(t.name)),r)}}):l[t.name]=r}}));for(var d=function(t){var e=l[t];e instanceof Error&&Object.defineProperty(l,t,{enumerable:!0,get:function(){throw vn("index ".concat(t),e)}})},m=0;m<l.length;m++)d(m);return Object.freeze(l)}},{key:"parseTransaction",value:function(t){var e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new hn({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:w.from(t.value||"0")}):null}},{key:"parseLog",value:function(t){var e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new fn({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}},{key:"parseError",value:function(t){var e=Object(c.i)(t),r=this.getError(e.substring(0,10).toLowerCase());return r?new pn({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}}],[{key:"getAbiCoder",value:function(){return $r}},{key:"getAddress",value:function(t){return mt(t)}},{key:"getSighash",value:function(t){return Object(c.e)(It(t.format()),0,4)}},{key:"getEventTopic",value:function(t){return It(t.format())}},{key:"isInterface",value:function(t){return!(!t||!t._isInterface)}}])}();function gn(t){return(gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */bn=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==gn(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(gn(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function wn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,En(n.key),n)}}function kn(t,e,r){return e&&_n(t.prototype,e),r&&_n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function En(t){var e=function(t,e){if("object"!=gn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=gn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==gn(e)?e:e+""}function xn(t,e,r){return e=An(e),function(t,e){if(e&&("object"==gn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],An(t).constructor):e.apply(t,r))}function An(t){return(An=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function On(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sn(t,e)}function Sn(t,e){return(Sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Pn=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},jn=new h.b("abstract-provider/5.7.0"),Tn=function(t){function e(){return wn(this,e),xn(this,e,arguments)}return On(e,t),kn(e,null,[{key:"isForkEvent",value:function(t){return!(!t||!t._isForkEvent)}}])}(U),Nn=function(){return kn((function t(){wn(this,t),jn.checkAbstract(this instanceof t?this.constructor:void 0,t),I(this,"_isProvider",!0)}),[{key:"getFeeData",value:function(){return Pn(this,void 0,void 0,bn().mark((function t(){var e,r,n,o,i,a;return bn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,L({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((function(t){return null}))});case 2:return e=t.sent,r=e.block,n=e.gasPrice,o=null,i=null,a=null,r&&r.baseFeePerGas&&(o=r.baseFeePerGas,a=w.from("1500000000"),i=r.baseFeePerGas.mul(2).add(a)),t.abrupt("return",{lastBaseFeePerGas:o,maxFeePerGas:i,maxPriorityFeePerGas:a,gasPrice:n});case 8:case"end":return t.stop()}}),t,this)})))}},{key:"addListener",value:function(t,e){return this.on(t,e)}},{key:"removeListener",value:function(t,e){return this.off(t,e)}}],[{key:"isProvider",value:function(t){return!(!t||!t._isProvider)}}])}();function In(t){return(In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rn(t,e,r){return e=Ln(e),function(t,e){if(e&&("object"==In(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Ln(t).constructor):e.apply(t,r))}function Ln(t){return(Ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Cn(t,e){return(Cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Mn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Mn=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==In(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(In(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Bn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Un(n.key),n)}}function Dn(t,e,r){return e&&Fn(t.prototype,e),r&&Fn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Un(t){var e=function(t,e){if("object"!=In(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=In(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==In(e)?e:e+""}var zn=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Gn=new h.b("abstract-signer/5.7.0"),Hn=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],qn=[h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED],Kn=function(){return Dn((function t(){Bn(this,t),Gn.checkAbstract(this instanceof t?this.constructor:void 0,t),I(this,"_isSigner",!0)}),[{key:"getBalance",value:function(t){return zn(this,void 0,void 0,Mn().mark((function e(){return Mn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getBalance"),e.next=3,this.provider.getBalance(this.getAddress(),t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionCount",value:function(t){return zn(this,void 0,void 0,Mn().mark((function e(){return Mn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getTransactionCount"),e.next=3,this.provider.getTransactionCount(this.getAddress(),t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGas",value:function(t){return zn(this,void 0,void 0,Mn().mark((function e(){var r;return Mn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("estimateGas"),e.next=3,L(this.checkTransaction(t));case 3:return r=e.sent,e.next=6,this.provider.estimateGas(r);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"call",value:function(t,e){return zn(this,void 0,void 0,Mn().mark((function r(){var n;return Mn().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this._checkProvider("call"),r.next=3,L(this.checkTransaction(t));case 3:return n=r.sent,r.next=6,this.provider.call(n,e);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sendTransaction",value:function(t){return zn(this,void 0,void 0,Mn().mark((function e(){var r,n;return Mn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("sendTransaction"),e.next=3,this.populateTransaction(t);case 3:return r=e.sent,e.next=6,this.signTransaction(r);case 6:return n=e.sent,e.next=9,this.provider.sendTransaction(n);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)})))}},{key:"getChainId",value:function(){return zn(this,void 0,void 0,Mn().mark((function t(){var e;return Mn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getChainId"),t.next=3,this.provider.getNetwork();case 3:return e=t.sent,t.abrupt("return",e.chainId);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"getGasPrice",value:function(){return zn(this,void 0,void 0,Mn().mark((function t(){return Mn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getGasPrice"),t.next=3,this.provider.getGasPrice();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getFeeData",value:function(){return zn(this,void 0,void 0,Mn().mark((function t(){return Mn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getFeeData"),t.next=3,this.provider.getFeeData();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"resolveName",value:function(t){return zn(this,void 0,void 0,Mn().mark((function e(){return Mn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("resolveName"),e.next=3,this.provider.resolveName(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"checkTransaction",value:function(t){for(var e in t)-1===Hn.indexOf(e)&&Gn.throwArgumentError("invalid transaction key: "+e,"transaction",t);var r=M(t);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then((function(e){return e[0].toLowerCase()!==e[1].toLowerCase()&&Gn.throwArgumentError("from address mismatch","transaction",t),e[0]})),r}},{key:"populateTransaction",value:function(t){return zn(this,void 0,void 0,Mn().mark((function e(){var r,n,o,i,a=this;return Mn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L(this.checkTransaction(t));case 2:if(null!=(r=e.sent).to&&(r.to=Promise.resolve(r.to).then((function(t){return zn(a,void 0,void 0,Mn().mark((function e(){var r;return Mn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this.resolveName(t);case 4:return null==(r=e.sent)&&Gn.throwArgumentError("provided ENS name resolves to null","tx.to",t),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)})))})),r.to.catch((function(t){}))),n=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas,null==r.gasPrice||2!==r.type&&!n?0!==r.type&&1!==r.type||!n||Gn.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):Gn.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas){e.next=10;break}r.type=2,e.next=18;break;case 10:if(0!==r.type&&1!==r.type){e.next=14;break}null==r.gasPrice&&(r.gasPrice=this.getGasPrice()),e.next=18;break;case 14:return e.next=16,this.getFeeData();case 16:o=e.sent,null==r.type?null!=o.maxFeePerGas&&null!=o.maxPriorityFeePerGas?(r.type=2,null!=r.gasPrice?(i=r.gasPrice,delete r.gasPrice,r.maxFeePerGas=i,r.maxPriorityFeePerGas=i):(null==r.maxFeePerGas&&(r.maxFeePerGas=o.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))):null!=o.gasPrice?(n&&Gn.throwError("network does not support EIP-1559",h.b.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=o.gasPrice),r.type=0):Gn.throwError("failed to get consistent fee data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=o.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas));case 18:return null==r.nonce&&(r.nonce=this.getTransactionCount("pending")),null==r.gasLimit&&(r.gasLimit=this.estimateGas(r).catch((function(t){if(qn.indexOf(t.code)>=0)throw t;return Gn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(e){return 0!==e[1]&&e[0]!==e[1]&&Gn.throwArgumentError("chainId address mismatch","transaction",t),e[0]})),e.next=23,L(r);case 23:return e.abrupt("return",e.sent);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"_checkProvider",value:function(t){this.provider||Gn.throwError("missing provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}}],[{key:"isSigner",value:function(t){return!(!t||!t._isSigner)}}])}(),Wn=function(t){function e(t,r){var n;return Bn(this,e),I(n=Rn(this,e),"address",t),I(n,"provider",r||null),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cn(t,e)}(e,t),Dn(e,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(t,e){return Promise.resolve().then((function(){Gn.throwError(t,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})}))}},{key:"signMessage",value:function(t){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(t){return new e(this.address,t)}}])}(Kn),Qn=r(34);function Vn(t){return(Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yn(n.key),n)}}function Yn(t){var e=function(t,e){if("object"!=Vn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Vn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Vn(e)?e:e+""}var Zn=new h.b("signing-key/5.7.0"),Xn=null;function $n(){return Xn||(Xn=new Qn.a("secp256k1")),Xn}var to=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),I(this,"curve","secp256k1"),I(this,"privateKey",Object(c.i)(e)),32!==Object(c.d)(this.privateKey)&&Zn.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=$n().keyFromPrivate(Object(c.a)(this.privateKey));I(this,"publicKey","0x"+r.getPublic(!1,"hex")),I(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),I(this,"_isSigningKey",!0)},r=[{key:"isSigningKey",value:function(t){return!(!t||!t._isSigningKey)}}],(e=[{key:"_addPoint",value:function(t){var e=$n().keyFromPublic(Object(c.a)(this.publicKey)),r=$n().keyFromPublic(Object(c.a)(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(t){var e=$n().keyFromPrivate(Object(c.a)(this.privateKey)),r=Object(c.a)(t);32!==r.length&&Zn.throwArgumentError("bad digest length","digest",t);var n=e.sign(r,{canonical:!0});return Object(c.n)({recoveryParam:n.recoveryParam,r:Object(c.h)("0x"+n.r.toString(16),32),s:Object(c.h)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(t){var e=$n().keyFromPrivate(Object(c.a)(this.privateKey)),r=$n().keyFromPublic(Object(c.a)(ro(t)));return Object(c.h)("0x"+e.derive(r.getPublic()).toString(16),32)}}])&&Jn(t.prototype,e),r&&Jn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function eo(t,e){var r=Object(c.n)(e),n={r:Object(c.a)(r.r),s:Object(c.a)(r.s)};return"0x"+$n().recoverPubKey(Object(c.a)(t),n,r.recoveryParam).encode("hex",!1)}function ro(t,e){var r=Object(c.a)(t);if(32===r.length){var n=new to(r);return e?"0x"+$n().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?e?Object(c.i)(r):"0x"+$n().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+$n().keyFromPublic(r).getPublic(!0,"hex"):Object(c.i)(r):Zn.throwArgumentError("invalid public or private key","key","[REDACTED]")}var no,oo=new h.b("transactions/5.7.0");function io(t){return"0x"===t?null:mt(t)}function ao(t){return"0x"===t?Fe:w.from(t)}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(no||(no={}));var uo=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],so={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function co(t){var e=ro(t);return mt(Object(c.e)($(Object(c.e)(e,1)),12))}function lo(t,e){return co(eo(Object(c.a)(t),e))}function fo(t,e){var r=Object(c.o)(w.from(t).toHexString());return r.length>32&&oo.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function ho(t,e){return{address:mt(t),storageKeys:(e||[]).map((function(e,r){return 32!==Object(c.d)(e)&&oo.throwArgumentError("invalid access list storageKey","accessList[".concat(t,":").concat(r,"]"),e),e.toLowerCase()}))}}function po(t){if(Array.isArray(t))return t.map((function(t,e){return Array.isArray(t)?(t.length>2&&oo.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(e,"]"),t),ho(t[0],t[1])):ho(t.address,t.storageKeys)}));var e=Object.keys(t).map((function(e){var r=t[e].reduce((function(t,e){return t[e]=!0,t}),{});return ho(e,Object.keys(r).sort())}));return e.sort((function(t,e){return t.address.localeCompare(e.address)})),e}function mo(t){return po(t).map((function(t){return[t.address,t.storageKeys]}))}function vo(t,e){if(null!=t.gasPrice){var r=w.from(t.gasPrice),n=w.from(t.maxFeePerGas||0);r.eq(n)||oo.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var o=[fo(t.chainId||0,"chainId"),fo(t.nonce||0,"nonce"),fo(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),fo(t.maxFeePerGas||0,"maxFeePerGas"),fo(t.gasLimit||0,"gasLimit"),null!=t.to?mt(t.to):"0x",fo(t.value||0,"value"),t.data||"0x",mo(t.accessList||[])];if(e){var i=Object(c.n)(e);o.push(fo(i.recoveryParam,"recoveryParam")),o.push(Object(c.o)(i.r)),o.push(Object(c.o)(i.s))}return Object(c.c)(["0x02",nt(o)])}function yo(t,e){var r=[fo(t.chainId||0,"chainId"),fo(t.nonce||0,"nonce"),fo(t.gasPrice||0,"gasPrice"),fo(t.gasLimit||0,"gasLimit"),null!=t.to?mt(t.to):"0x",fo(t.value||0,"value"),t.data||"0x",mo(t.accessList||[])];if(e){var n=Object(c.n)(e);r.push(fo(n.recoveryParam,"recoveryParam")),r.push(Object(c.o)(n.r)),r.push(Object(c.o)(n.s))}return Object(c.c)(["0x01",nt(r)])}function go(t,e){if(null==t.type||0===t.type)return null!=t.accessList&&oo.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),function(t,e){C(t,so);var r=[];uo.forEach((function(e){var n=t[e.name]||[],o={};e.numeric&&(o.hexPad="left"),n=Object(c.a)(Object(c.i)(n,o)),e.length&&n.length!==e.length&&n.length>0&&oo.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=Object(c.o)(n)).length>e.maxLength&&oo.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),r.push(Object(c.i)(n))}));var n=0;if(null!=t.chainId?"number"!=typeof(n=t.chainId)&&oo.throwArgumentError("invalid transaction.chainId","transaction",t):e&&!Object(c.k)(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),0!==n&&(r.push(Object(c.i)(n)),r.push("0x"),r.push("0x")),!e)return nt(r);var o=Object(c.n)(e),i=27+o.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),i+=2*n+8,o.v>28&&o.v!==i&&oo.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):o.v!==i&&oo.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(Object(c.i)(i)),r.push(Object(c.o)(Object(c.a)(o.r))),r.push(Object(c.o)(Object(c.a)(o.s))),nt(r)}(t,e);switch(t.type){case 1:return yo(t,e);case 2:return vo(t,e)}return oo.throwError("unsupported transaction type: ".concat(t.type),h.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function bo(t,e,r){try{var n=ao(e[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");t.v=n}catch(t){oo.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Object(c.h)(e[1],32),t.s=Object(c.h)(e[2],32);try{var o=$(r(t));t.from=lo(o,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function wo(t){var e=Object(c.a)(t);if(e[0]>127)return function(t){var e=at(t);9!==e.length&&6!==e.length&&oo.throwArgumentError("invalid raw transaction","rawTransaction",t);var r={nonce:ao(e[0]).toNumber(),gasPrice:ao(e[1]),gasLimit:ao(e[2]),to:io(e[3]),value:ao(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=w.from(e[6]).toNumber()}catch(t){return r}if(r.r=Object(c.h)(e[7],32),r.s=Object(c.h)(e[8],32),w.from(r.r).isZero()&&w.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);var n=r.v-27,o=e.slice(0,6);0!==r.chainId&&(o.push(Object(c.i)(r.chainId)),o.push("0x"),o.push("0x"),n-=2*r.chainId+8);var i=$(nt(o));try{r.from=lo(i,{r:Object(c.i)(r.r),s:Object(c.i)(r.s),recoveryParam:n})}catch(t){}r.hash=$(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){var e=at(t.slice(1));8!==e.length&&11!==e.length&&oo.throwArgumentError("invalid component count for transaction type: 1","payload",Object(c.i)(t));var r={type:1,chainId:ao(e[0]).toNumber(),nonce:ao(e[1]).toNumber(),gasPrice:ao(e[2]),gasLimit:ao(e[3]),to:io(e[4]),value:ao(e[5]),data:e[6],accessList:po(e[7])};return 8===e.length||(r.hash=$(t),bo(r,e.slice(8),yo)),r}(e);case 2:return function(t){var e=at(t.slice(1));9!==e.length&&12!==e.length&&oo.throwArgumentError("invalid component count for transaction type: 2","payload",Object(c.i)(t));var r=ao(e[2]),n=ao(e[3]),o={type:2,chainId:ao(e[0]).toNumber(),nonce:ao(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:ao(e[4]),to:io(e[5]),value:ao(e[6]),data:e[7],accessList:po(e[8])};return 9===e.length||(o.hash=$(t),bo(o,e.slice(9),vo)),o}(e)}return oo.throwError("unsupported transaction type: ".concat(e[0]),h.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}function _o(t){return function(t){if(Array.isArray(t))return ko(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ko(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ko(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ko(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Eo(){return(Eo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=xo(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function xo(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Oo(t)););return t}function Ao(t,e,r){return e=Oo(e),function(t,e){if(e&&("object"==Ro(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Oo(t).constructor):e.apply(t,r))}function Oo(t){return(Oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function So(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Po(t,e)}function Po(t,e){return(Po=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function jo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function To(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Io(n.key),n)}}function No(t,e,r){return e&&To(t.prototype,e),r&&To(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Io(t){var e=function(t,e){if("object"!=Ro(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ro(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ro(e)?e:e+""}function Ro(t){return(Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lo(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Lo=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==Ro(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Ro(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}var Co=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Mo=new h.b("contracts/5.7.0"),Bo={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function Fo(t,e){return Co(this,void 0,void 0,Lo().mark((function r(){var n,o;return Lo().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e;case 2:return"string"!=typeof(n=r.sent)&&Mo.throwArgumentError("invalid address or ENS name","name",n),r.prev=4,r.abrupt("return",mt(n));case 8:r.prev=8,r.t0=r.catch(4);case 10:return t||Mo.throwError("a provider or signer is needed to resolve ENS names",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),r.next=13,t.resolveName(n);case 13:return null==(o=r.sent)&&Mo.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r.abrupt("return",o);case 16:case"end":return r.stop()}}),r,null,[[4,8]])})))}function Do(t,e,r){return Co(this,void 0,void 0,Lo().mark((function n(){return Lo().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=4;break}return n.next=3,Promise.all(r.map((function(r,n){return Do(t,Array.isArray(e)?e[n]:e[r.name],r)})));case 3:return n.abrupt("return",n.sent);case 4:if("address"!==r.type){n.next=8;break}return n.next=7,Fo(t,e);case 7:return n.abrupt("return",n.sent);case 8:if("tuple"!==r.type){n.next=12;break}return n.next=11,Do(t,e,r.components);case 11:return n.abrupt("return",n.sent);case 12:if("array"!==r.baseType){n.next=18;break}if(Array.isArray(e)){n.next=15;break}return n.abrupt("return",Promise.reject(Mo.makeError("invalid value for array",h.b.errors.INVALID_ARGUMENT,{argument:"value",value:e})));case 15:return n.next=17,Promise.all(e.map((function(e){return Do(t,e,r.arrayChildren)})));case 17:return n.abrupt("return",n.sent);case 18:return n.abrupt("return",e);case 19:case"end":return n.stop()}}),n)})))}function Uo(t,e,r){return Co(this,void 0,void 0,Lo().mark((function n(){var o,i,a,u,s,l,f,p,d,m,v=this;return Lo().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o={},r.length===e.inputs.length+1&&"object"===Ro(r[r.length-1])&&(o=M(r.pop())),Mo.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?o.from?o.from=L({override:Fo(t.signer,o.from),signer:t.signer.getAddress()}).then((function(t){return Co(v,void 0,void 0,Lo().mark((function e(){return Lo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return mt(t.signer)!==t.override&&Mo.throwError("Contract with a Signer cannot override from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.abrupt("return",t.override);case 2:case"end":return e.stop()}}),e)})))})):o.from=t.signer.getAddress():o.from&&(o.from=Fo(t.provider,o.from)),n.next=6,L({args:Do(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:L(o)||{}});case 6:if(i=n.sent,a=t.interface.encodeFunctionData(e,i.args),u={data:a,to:i.address},null!=(s=i.overrides).nonce&&(u.nonce=w.from(s.nonce).toNumber()),null!=s.gasLimit&&(u.gasLimit=w.from(s.gasLimit)),null!=s.gasPrice&&(u.gasPrice=w.from(s.gasPrice)),null!=s.maxFeePerGas&&(u.maxFeePerGas=w.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(u.maxPriorityFeePerGas=w.from(s.maxPriorityFeePerGas)),null!=s.from&&(u.from=s.from),null!=s.type&&(u.type=s.type),null!=s.accessList&&(u.accessList=po(s.accessList)),null==u.gasLimit&&null!=e.gas){for(l=21e3,f=Object(c.a)(a),p=0;p<f.length;p++)l+=4,f[p]&&(l+=64);u.gasLimit=w.from(e.gas).add(l)}return s.value&&((d=w.from(s.value)).isZero()||e.payable||Mo.throwError("non-payable method cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:o.value}),u.value=d),s.customData&&(u.customData=M(s.customData)),s.ccipReadEnabled&&(u.ccipReadEnabled=!!s.ccipReadEnabled),delete o.nonce,delete o.gasLimit,delete o.gasPrice,delete o.from,delete o.value,delete o.type,delete o.accessList,delete o.maxFeePerGas,delete o.maxPriorityFeePerGas,delete o.customData,delete o.ccipReadEnabled,(m=Object.keys(o).filter((function(t){return null!=o[t]}))).length&&Mo.throwError("cannot override ".concat(m.map((function(t){return JSON.stringify(t)})).join(",")),h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:m}),n.abrupt("return",u);case 36:case"end":return n.stop()}}),n)})))}function zo(t,e){var r=e.wait.bind(e);e.wait=function(e){return r(e).then((function(e){return e.events=e.logs.map((function(r){var n=D(r),o=null;try{o=t.interface.parseLog(r)}catch(t){}return o&&(n.args=o.args,n.decode=function(e,r){return t.interface.decodeEventLog(o.eventFragment,e,r)},n.event=o.name,n.eventSignature=o.signature),n.removeListener=function(){return t.provider},n.getBlock=function(){return t.provider.getBlock(e.blockHash)},n.getTransaction=function(){return t.provider.getTransaction(e.transactionHash)},n.getTransactionReceipt=function(){return Promise.resolve(e)},n})),e}))}}function Go(t,e,r){var n=t.signer||t.provider;return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return Co(this,void 0,void 0,Lo().mark((function o(){var a,u,s,c,l;return Lo().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a=void 0,i.length!==e.inputs.length+1||"object"!==Ro(i[i.length-1])){o.next=9;break}if(null==(u=M(i.pop())).blockTag){o.next=7;break}return o.next=6,u.blockTag;case 6:a=o.sent;case 7:delete u.blockTag,i.push(u);case 9:if(null==t.deployTransaction){o.next=12;break}return o.next=12,t._deployed(a);case 12:return o.next=14,Uo(t,e,i);case 14:return s=o.sent,o.next=17,n.call(s,a);case 17:return c=o.sent,o.prev=18,l=t.interface.decodeFunctionResult(e,c),r&&1===e.outputs.length&&(l=l[0]),o.abrupt("return",l);case 24:throw o.prev=24,o.t0=o.catch(18),o.t0.code===h.b.errors.CALL_EXCEPTION&&(o.t0.address=t.address,o.t0.args=i,o.t0.transaction=s),o.t0;case 28:case"end":return o.stop()}}),o,null,[[18,24]])})))}}function Ho(t,e,r){return e.constant?Go(t,e,r):function(t,e){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return Co(this,void 0,void 0,Lo().mark((function r(){var o,i;return Lo().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.signer||Mo.throwError("sending a transaction requires a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null==t.deployTransaction){r.next=4;break}return r.next=4,t._deployed();case 4:return r.next=6,Uo(t,e,n);case 6:return o=r.sent,r.next=9,t.signer.sendTransaction(o);case 9:return i=r.sent,zo(t,i),r.abrupt("return",i);case 12:case"end":return r.stop()}}),r)})))}}(t,e)}function qo(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((function(t){return Array.isArray(t)?t.join("|"):t})).join(":"):""):"*"}var Ko=function(){return No((function t(e,r){jo(this,t),I(this,"tag",e),I(this,"filter",r),this._listeners=[]}),[{key:"addListener",value:function(t,e){this._listeners.push({listener:t,once:e})}},{key:"removeListener",value:function(t){var e=!1;this._listeners=this._listeners.filter((function(r){return!(!e&&r.listener===t)||(e=!0,!1)}))}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"listeners",value:function(){return this._listeners.map((function(t){return t.listener}))}},{key:"listenerCount",value:function(){return this._listeners.length}},{key:"run",value:function(t){var e=this,r=this.listenerCount();return this._listeners=this._listeners.filter((function(r){var n=t.slice();return setTimeout((function(){r.listener.apply(e,n)}),0),!r.once})),r}},{key:"prepareEvent",value:function(t){}},{key:"getEmit",value:function(t){return[t]}}])}(),Wo=function(t){function e(){return jo(this,e),Ao(this,e,["error",null])}return So(e,t),No(e)}(Ko),Qo=function(t){function e(t,r,n,o){var i;jo(this,e);var a={address:t},u=r.getEventTopic(n);return o?(u!==o[0]&&Mo.throwArgumentError("topic mismatch","topics",o),a.topics=o.slice()):a.topics=[u],I(i=Ao(this,e,[qo(a),a]),"address",t),I(i,"interface",r),I(i,"fragment",n),i}return So(e,t),No(e,[{key:"prepareEvent",value:function(t){var r=this;Eo(Oo(e.prototype),"prepareEvent",this).call(this,t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=function(t,e){return r.interface.decodeEventLog(r.fragment,t,e)};try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}},{key:"getEmit",value:function(t){var e=Q(t.args);if(e.length)throw e[0].error;var r=(t.args||[]).slice();return r.push(t),r}}])}(Ko),Vo=function(t){function e(t,r){var n;return jo(this,e),I(n=Ao(this,e,["*",{address:t}]),"address",t),I(n,"interface",r),n}return So(e,t),No(e,[{key:"prepareEvent",value:function(t){var r=this;Eo(Oo(e.prototype),"prepareEvent",this).call(this,t);try{var n=this.interface.parseLog(t);t.event=n.name,t.eventSignature=n.signature,t.decode=function(t,e){return r.interface.decodeEventLog(n.eventFragment,t,e)},t.args=n.args}catch(t){}}}])}(Ko),Jo=function(){return No((function t(e,r,n){var o=this;jo(this,t),I(this,"interface",R(this instanceof t?this.constructor:void 0,"getInterface")(r)),null==n?(I(this,"provider",null),I(this,"signer",null)):Kn.isSigner(n)?(I(this,"provider",n.provider||null),I(this,"signer",n)):Nn.isProvider(n)?(I(this,"provider",n),I(this,"signer",null)):Mo.throwArgumentError("invalid signer or provider","signerOrProvider",n),I(this,"callStatic",{}),I(this,"estimateGas",{}),I(this,"functions",{}),I(this,"populateTransaction",{}),I(this,"filters",{});var i={};if(Object.keys(this.interface.events).forEach((function(t){var e=o.interface.events[t];I(o.filters,t,(function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return{address:o.address,topics:o.interface.encodeFilterTopics(e,r)}})),i[e.name]||(i[e.name]=[]),i[e.name].push(t)})),Object.keys(i).forEach((function(t){var e=i[t];1===e.length?I(o.filters,t,o.filters[e[0]]):Mo.warn("Duplicate definition of ".concat(t," (").concat(e.join(", "),")"))})),I(this,"_runningEvents",{}),I(this,"_wrappedEmits",{}),null==e&&Mo.throwArgumentError("invalid contract address or ENS name","addressOrName",e),I(this,"address",e),this.provider)I(this,"resolvedAddress",Fo(this.provider,e));else try{I(this,"resolvedAddress",Promise.resolve(mt(e)))}catch(t){Mo.throwError("provider is required to use ENS name as contract address",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((function(t){}));var a={},u={};Object.keys(this.interface.functions).forEach((function(t){var e=o.interface.functions[t];if(u[t])Mo.warn("Duplicate ABI entry for ".concat(JSON.stringify(t)));else{u[t]=!0;var r=e.name;a["%".concat(r)]||(a["%".concat(r)]=[]),a["%".concat(r)].push(t),null==o[t]&&I(o,t,Ho(o,e,!0)),null==o.functions[t]&&I(o.functions,t,Ho(o,e,!1)),null==o.callStatic[t]&&I(o.callStatic,t,Go(o,e,!0)),null==o.populateTransaction[t]&&I(o.populateTransaction,t,function(t,e){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return Uo(t,e,n)}}(o,e)),null==o.estimateGas[t]&&I(o.estimateGas,t,function(t,e){var r=t.signer||t.provider;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Co(this,void 0,void 0,Lo().mark((function n(){var i;return Lo().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r||Mo.throwError("estimate require a provider or signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),n.next=3,Uo(t,e,o);case 3:return i=n.sent,n.next=6,r.estimateGas(i);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))}}(o,e))}})),Object.keys(a).forEach((function(t){var e=a[t];if(!(e.length>1)){t=t.substring(1);var r=e[0];try{null==o[t]&&I(o,t,o[r])}catch(t){}null==o.functions[t]&&I(o.functions,t,o.functions[r]),null==o.callStatic[t]&&I(o.callStatic,t,o.callStatic[r]),null==o.populateTransaction[t]&&I(o.populateTransaction,t,o.populateTransaction[r]),null==o.estimateGas[t]&&I(o.estimateGas,t,o.estimateGas[r])}}))}),[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(t){var e=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return e})):this._deployedPromise=this.provider.getCode(this.address,t).then((function(t){return"0x"===t&&Mo.throwError("contract not deployed",h.b.errors.UNSUPPORTED_OPERATION,{contractAddress:e.address,operation:"getDeployed"}),e}))),this._deployedPromise}},{key:"fallback",value:function(t){var e=this;this.signer||Mo.throwError("sending a transactions require a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=M(t||{});return["from","to"].forEach((function(t){null!=r[t]&&Mo.throwError("cannot override "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})})),r.to=this.resolvedAddress,this.deployed().then((function(){return e.signer.sendTransaction(r)}))}},{key:"connect",value:function(t){"string"==typeof t&&(t=new Wn(t,this.provider));var e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&I(e,"deployTransaction",this.deployTransaction),e}},{key:"attach",value:function(t){return new this.constructor(t,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}},{key:"_getRunningEvent",value:function(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new Wo);if("event"===t)return this._normalizeRunningEvent(new Ko("event",null));if("*"===t)return this._normalizeRunningEvent(new Vo(this.address,this.interface));var e=this.interface.getEvent(t);return this._normalizeRunningEvent(new Qo(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{var r=t.topics[0];if("string"!=typeof r)throw new Error("invalid topic");var n=this.interface.getEvent(r);return this._normalizeRunningEvent(new Qo(this.address,this.interface,n,t.topics))}catch(t){}var o={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new Ko(qo(o),o))}return this._normalizeRunningEvent(new Vo(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];var e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}},{key:"_wrapEvent",value:function(t,e,r){var n=this,o=D(e);return o.removeListener=function(){r&&(t.removeListener(r),n._checkRunningEvents(t))},o.getBlock=function(){return n.provider.getBlock(e.blockHash)},o.getTransaction=function(){return n.provider.getTransaction(e.transactionHash)},o.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(e.transactionHash)},t.prepareEvent(o),o}},{key:"_addEventListener",value:function(t,e,r){var n=this;if(this.provider||Mo.throwError("events require a provider or a signer with a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){var o=function(r){var o=n._wrapEvent(t,r,e);if(null==o.decodeError)try{var i=t.getEmit(o);n.emit.apply(n,[t.filter].concat(_o(i)))}catch(t){o.decodeError=t.error}null!=t.filter&&n.emit("event",o),null!=o.decodeError&&n.emit("error",o.decodeError,o)};this._wrappedEmits[t.tag]=o,null!=t.filter&&this.provider.on(t.filter,o)}}},{key:"queryFilter",value:function(t,e,r){var n=this,o=this._getRunningEvent(t),i=M(o.filter);return"string"==typeof e&&Object(c.l)(e,32)?(null!=r&&Mo.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((function(t){return t.map((function(t){return n._wrapEvent(o,t,null)}))}))}},{key:"on",value:function(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}},{key:"once",value:function(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}},{key:"emit",value:function(t){if(!this.provider)return!1;for(var e=this._getRunningEvent(t),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=e.run(n)>0;return this._checkRunningEvents(e),i}},{key:"listenerCount",value:function(t){var e=this;return this.provider?null==t?Object.keys(this._runningEvents).reduce((function(t,r){return t+e._runningEvents[r].listenerCount()}),0):this._getRunningEvent(t).listenerCount():0}},{key:"listeners",value:function(t){if(!this.provider)return[];if(null==t){var e=[];for(var r in this._runningEvents)this._runningEvents[r].listeners().forEach((function(t){e.push(t)}));return e}return this._getRunningEvent(t).listeners()}},{key:"removeAllListeners",value:function(t){if(!this.provider)return this;if(null==t){for(var e in this._runningEvents){var r=this._runningEvents[e];r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(t);return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(t,e){if(!this.provider)return this;var r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(t,e){return this.off(t,e)}}],[{key:"getContractAddress",value:function(t){return gt(t)}},{key:"getInterface",value:function(t){return yn.isInterface(t)?t:new yn(t)}},{key:"isIndexed",value:function(t){return dn.isIndexed(t)}}])}(),Yo=function(t){function e(){return jo(this,e),Ao(this,e,arguments)}return So(e,t),No(e)}(Jo),Zo=function(){return No((function t(e,r,n){jo(this,t);var o=null;"0x"!==(o="string"==typeof r?r:Object(c.j)(r)?Object(c.i)(r):r&&"string"==typeof r.object?r.object:"!").substring(0,2)&&(o="0x"+o),(!Object(c.l)(o)||o.length%2)&&Mo.throwArgumentError("invalid bytecode","bytecode",r),n&&!Kn.isSigner(n)&&Mo.throwArgumentError("invalid signer","signer",n),I(this,"bytecode",o),I(this,"interface",R(this instanceof t?this.constructor:void 0,"getInterface")(e)),I(this,"signer",n||null)}),[{key:"getDeployTransaction",value:function(){for(var t={},e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length===this.interface.deploy.inputs.length+1&&"object"===Ro(r[r.length-1]))for(var o in t=M(r.pop()))if(!Bo[o])throw new Error("unknown transaction override "+o);if(["data","from","to"].forEach((function(e){null!=t[e]&&Mo.throwError("cannot override "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value){var i=w.from(t.value);i.isZero()||this.interface.deploy.payable||Mo.throwError("non-payable constructor cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return Mo.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=Object(c.i)(Object(c.b)([this.bytecode,this.interface.encodeDeploy(r)])),t}},{key:"deploy",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Co(this,void 0,void 0,Lo().mark((function t(){var r,n,o,i,a,u;return Lo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},e.length===this.interface.deploy.inputs.length+1&&(r=e.pop()),Mo.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.next=5,Do(this.signer,e,this.interface.deploy.inputs);case 5:return(n=t.sent).push(r),o=this.getDeployTransaction.apply(this,_o(n)),t.next=10,this.signer.sendTransaction(o);case 10:return i=t.sent,a=R(this.constructor,"getContractAddress")(i),zo(u=R(this.constructor,"getContract")(a,this.interface,this.signer),i),I(u,"deployTransaction",i),t.abrupt("return",u);case 16:case"end":return t.stop()}}),t,this)})))}},{key:"attach",value:function(t){return this.constructor.getContract(t,this.interface,this.signer)}},{key:"connect",value:function(t){return new this.constructor(this.interface,this.bytecode,t)}}],[{key:"fromSolidity",value:function(t,e){null==t&&Mo.throwError("missing compiler output",h.b.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));var r=t.abi,n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}},{key:"getInterface",value:function(t){return Yo.getInterface(t)}},{key:"getContractAddress",value:function(t){return gt(t)}},{key:"getContract",value:function(t,e,r){return new Yo(t,e,r)}}])}();function Xo(t){return(Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ti(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ri(n.key),n)}}function ei(t,e,r){return e&&ti(t.prototype,e),r&&ti(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ri(t){var e=function(t,e){if("object"!=Xo(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Xo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Xo(e)?e:e+""}var ni=new h.b("bignumber/5.7.0"),oi={},ii=w.from(0),ai=w.from(-1);function ui(t,e,r,n){var o={fault:e,operation:r};return void 0!==n&&(o.value=n),ni.throwError(t,h.b.errors.NUMERIC_FAULT,o)}for(var si="0";si.length<256;)si+=si;function ci(t){if("number"!=typeof t)try{t=w.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+si.substring(0,t):ni.throwArgumentError("invalid decimal size","decimals",t)}function li(t,e){null==e&&(e=0);var r=ci(e),n=(t=w.from(t)).lt(ii);n&&(t=t.mul(ai));for(var o=t.mod(r).toString();o.length<r.length-1;)o="0"+o;o=o.match(/^([0-9]*[1-9]|0)(0*)/)[1];var i=t.div(r).toString();return t=1===r.length?i:i+"."+o,n&&(t="-"+t),t}function fi(t,e){null==e&&(e=0);var r=ci(e);"string"==typeof t&&t.match(/^-?[0-9.]+$/)||ni.throwArgumentError("invalid decimal value","value",t);var n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&&ni.throwArgumentError("missing value","value",t);var o=t.split(".");o.length>2&&ni.throwArgumentError("too many decimal points","value",t);var i=o[0],a=o[1];for(i||(i="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&ui("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";var u=w.from(i),s=w.from(a),c=u.mul(r).add(s);return n&&(c=c.mul(ai)),c}var hi=function(){function t(e,r,n,o){$o(this,t),e!==oi&&ni.throwError("cannot use FixedFormat constructor; use FixedFormat.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=o,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(o),this._multiplier=ci(o),Object.freeze(this)}return ei(t,null,[{key:"from",value:function(e){if(e instanceof t)return e;"number"==typeof e&&(e="fixed128x".concat(e));var r=!0,n=128,o=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)r=!1;else{var i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||ni.throwArgumentError("invalid fixed format","format",e),r="u"!==i[1],n=parseInt(i[2]),o=parseInt(i[3])}else if(e){var a=function(t,r,n){return null==e[t]?n:(Xo(e[t])!==r&&ni.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t])};r=a("signed","boolean",r),n=a("width","number",n),o=a("decimals","number",o)}return n%8&&ni.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),o>80&&ni.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",o),new t(oi,r,n,o)}}])}(),pi=function(){function t(e,r,n,o){$o(this,t),e!==oi&&ni.throwError("cannot use FixedNumber constructor; use FixedNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=o,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}return ei(t,[{key:"_checkFormat",value:function(t){this.format.name!==t.format.name&&ni.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}},{key:"addUnsafe",value:function(e){this._checkFormat(e);var r=fi(this._value,this.format.decimals),n=fi(e._value,e.format.decimals);return t.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(e){this._checkFormat(e);var r=fi(this._value,this.format.decimals),n=fi(e._value,e.format.decimals);return t.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(e){this._checkFormat(e);var r=fi(this._value,this.format.decimals),n=fi(e._value,e.format.decimals);return t.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(e){this._checkFormat(e);var r=fi(this._value,this.format.decimals),n=fi(e._value,e.format.decimals);return t.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var e=this.toString().split(".");1===e.length&&e.push("0");var r=t.from(e[0],this.format),n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(di.toFormat(r.format))),r}},{key:"ceiling",value:function(){var e=this.toString().split(".");1===e.length&&e.push("0");var r=t.from(e[0],this.format),n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(di.toFormat(r.format))),r}},{key:"round",value:function(e){null==e&&(e=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(e<0||e>80||e%1)&&ni.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;var n=t.from("1"+si.substring(0,e),this.format),o=mi.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(o).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(t){if(null==t)return this._hex;t%8&&ni.throwArgumentError("invalid byte width","width",t);var e=w.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return Object(c.h)(e,t/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(e){return t.fromString(this._value,e)}}],[{key:"fromValue",value:function(e,r,n){return null!=n||null==r||function(t){return null!=t&&(w.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||Object(c.l)(t)||"bigint"==typeof t||Object(c.j)(t))}(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),t.fromString(li(e,r),hi.from(n))}},{key:"fromString",value:function(e,r){null==r&&(r="fixed");var n=hi.from(r),o=fi(e,n.decimals);!n.signed&&o.lt(ii)&&ui("unsigned value cannot be negative","overflow","value",e);var i=null;n.signed?i=o.toTwos(n.width).toHexString():(i=o.toHexString(),i=Object(c.h)(i,n.width/8));var a=li(o,n.decimals);return new t(oi,i,a,n)}},{key:"fromBytes",value:function(e,r){null==r&&(r="fixed");var n=hi.from(r);if(Object(c.a)(e).length>n.width/8)throw new Error("overflow");var o=w.from(e);n.signed&&(o=o.fromTwos(n.width));var i=o.toTwos((n.signed?0:1)+n.width).toHexString(),a=li(o,n.decimals);return new t(oi,i,a,n)}},{key:"from",value:function(e,r){if("string"==typeof e)return t.fromString(e,r);if(Object(c.j)(e))return t.fromBytes(e,r);try{return t.fromValue(e,0,r)}catch(t){if(t.code!==h.b.errors.INVALID_ARGUMENT)throw t}return ni.throwArgumentError("invalid FixedNumber value","value",e)}},{key:"isFixedNumber",value:function(t){return!(!t||!t._isFixedNumber)}}])}(),di=pi.from(1),mi=pi.from("0.5");function vi(t){return"string"==typeof t&&(t=Ot(t)),$(Object(c.b)([Ot("Ethereum Signed Message:\n"),Ot(String(t.length)),t]))}function yi(t){return(yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gi(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */gi=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==yi(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(yi(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function bi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wi(n.key),n)}}function wi(t){var e=function(t,e){if("object"!=yi(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==yi(e)?e:e+""}var _i=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},ki=new h.b("hash/5.7.0"),Ei=new Uint8Array(32);Ei.fill(0);var xi=w.from(-1),Ai=w.from(0),Oi=w.from(1),Si=w.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Pi=Object(c.h)(Oi.toHexString(),32),ji=Object(c.h)(Ai.toHexString(),32),Ti={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Ni=["name","version","chainId","verifyingContract","salt"];function Ii(t){return function(e){return"string"!=typeof e&&ki.throwArgumentError("invalid domain value for ".concat(JSON.stringify(t)),"domain.".concat(t),e),e}}var Ri={name:Ii("name"),version:Ii("version"),chainId:function(t){try{return w.from(t).toString()}catch(t){}return ki.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return mt(t).toLowerCase()}catch(t){}return ki.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{var e=Object(c.a)(t);if(32!==e.length)throw new Error("bad length");return Object(c.i)(e)}catch(t){}return ki.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Li(t){var e=t.match(/^(u?)int(\d*)$/);if(e){var r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&ki.throwArgumentError("invalid numeric width","type",t);var o=Si.mask(r?n-1:n),i=r?o.add(Oi).mul(xi):Ai;return function(e){var r=w.from(e);return(r.lt(i)||r.gt(o))&&ki.throwArgumentError("value out-of-bounds for ".concat(t),"value",e),Object(c.h)(r.toTwos(256).toHexString(),32)}}var a=t.match(/^bytes(\d+)$/);if(a){var u=parseInt(a[1]);return(0===u||u>32||a[1]!==String(u))&&ki.throwArgumentError("invalid bytes width","type",t),function(e){return Object(c.a)(e).length!==u&&ki.throwArgumentError("invalid length for ".concat(t),"value",e),function(t){var e=Object(c.a)(t),r=e.length%32;return r?Object(c.c)([e,Ei.slice(r)]):Object(c.i)(e)}(e)}}switch(t){case"address":return function(t){return Object(c.h)(mt(t),32)};case"bool":return function(t){return t?Pi:ji};case"bytes":return function(t){return $(t)};case"string":return function(t){return It(t)}}return null}function Ci(t,e){return"".concat(t,"(").concat(e.map((function(t){var e=t.name;return t.type+" "+e})).join(","),")")}var Mi=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),I(this,"types",Object.freeze(D(e))),I(this,"_encoderCache",{}),I(this,"_types",{});var r={},n={},o={};Object.keys(e).forEach((function(t){r[t]={},n[t]=[],o[t]={}}));var i=function(t){var o={};e[t].forEach((function(i){o[i.name]&&ki.throwArgumentError("duplicate variable name ".concat(JSON.stringify(i.name)," in ").concat(JSON.stringify(t)),"types",e),o[i.name]=!0;var a=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===t&&ki.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",e),Li(a)||(n[a]||ki.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",e),n[a].push(t),r[t][a]=!0)}))};for(var a in e)i(a);var u=Object.keys(n).filter((function(t){return 0===n[t].length}));for(var s in 0===u.length?ki.throwArgumentError("missing primary type","types",e):u.length>1&&ki.throwArgumentError("ambiguous primary types or unused types: ".concat(u.map((function(t){return JSON.stringify(t)})).join(", ")),"types",e),I(this,"primaryType",u[0]),function t(i,a){a[i]&&ki.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",e),a[i]=!0,Object.keys(r[i]).forEach((function(e){n[e]&&(t(e,a),Object.keys(a).forEach((function(t){o[t][e]=!0})))})),delete a[i]}(this.primaryType,{}),o){var c=Object.keys(o[s]);c.sort(),this._types[s]=Ci(s,e[s])+c.map((function(t){return Ci(t,e[t])})).join("")}}return e=t,n=[{key:"from",value:function(e){return new t(e)}},{key:"getPrimaryType",value:function(e){return t.from(e).primaryType}},{key:"hashStruct",value:function(e,r,n){return t.from(r).hashStruct(e,n)}},{key:"hashDomain",value:function(e){var r=[];for(var n in e){var o=Ti[n];o||ki.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",e),r.push({name:n,type:o})}return r.sort((function(t,e){return Ni.indexOf(t.name)-Ni.indexOf(e.name)})),t.hashStruct("EIP712Domain",{EIP712Domain:r},e)}},{key:"encode",value:function(e,r,n){return Object(c.c)(["0x1901",t.hashDomain(e),t.from(r).hash(n)])}},{key:"hash",value:function(e,r,n){return $(t.encode(e,r,n))}},{key:"resolveNames",value:function(e,r,n,o){return _i(this,void 0,void 0,gi().mark((function i(){var a,u,s;return gi().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:e=M(e),a={},e.verifyingContract&&!Object(c.l)(e.verifyingContract,20)&&(a[e.verifyingContract]="0x"),(u=t.from(r)).visit(n,(function(t,e){return"address"!==t||Object(c.l)(e,20)||(a[e]="0x"),e})),i.t0=gi().keys(a);case 6:if((i.t1=i.t0()).done){i.next=13;break}return s=i.t1.value,i.next=10,o(s);case 10:a[s]=i.sent,i.next=6;break;case 13:return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=u.visit(n,(function(t,e){return"address"===t&&a[e]?a[e]:e})),i.abrupt("return",{domain:e,value:n});case 16:case"end":return i.stop()}}),i)})))}},{key:"getPayload",value:function(e,r,n){t.hashDomain(e);var o={},i=[];Ni.forEach((function(t){var r=e[t];null!=r&&(o[t]=Ri[t](r),i.push({name:t,type:Ti[t]}))}));var a=t.from(r),u=M(r);return u.EIP712Domain?ki.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):u.EIP712Domain=i,a.encode(n),{types:u,domain:o,primaryType:a.primaryType,message:a.visit(n,(function(t,e){if(t.match(/^bytes(\d*)/))return Object(c.i)(Object(c.a)(e));if(t.match(/^u?int/))return w.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&ki.throwArgumentError("invalid string","value",e),e}return ki.throwArgumentError("unsupported type","type",t)}))}}}],(r=[{key:"getEncoder",value:function(t){var e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}},{key:"_getEncoder",value:function(t){var e=this,r=Li(t);if(r)return r;var n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var o=n[1],i=this.getEncoder(o),a=parseInt(n[3]);return function(t){a>=0&&t.length!==a&&ki.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);var r=t.map(i);return e._types[o]&&(r=r.map($)),$(Object(c.c)(r))}}var u=this.types[t];if(u){var s=It(this._types[t]);return function(t){var r=u.map((function(r){var n=r.name,o=r.type,i=e.getEncoder(o)(t[n]);return e._types[o]?$(i):i}));return r.unshift(s),Object(c.c)(r)}}return ki.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"encodeType",value:function(t){var e=this._types[t];return e||ki.throwArgumentError("unknown type: ".concat(JSON.stringify(t)),"name",t),e}},{key:"encodeData",value:function(t,e){return this.getEncoder(t)(e)}},{key:"hashStruct",value:function(t,e){return $(this.encodeData(t,e))}},{key:"encode",value:function(t){return this.encodeData(this.primaryType,t)}},{key:"hash",value:function(t){return this.hashStruct(this.primaryType,t)}},{key:"_visit",value:function(t,e,r){var n=this;if(Li(t))return r(t,e);var o=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(o){var i=o[1],a=parseInt(o[3]);return a>=0&&e.length!==a&&ki.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((function(t){return n._visit(i,t,r)}))}var u=this.types[t];return u?u.reduce((function(t,o){var i=o.name,a=o.type;return t[i]=n._visit(a,e[i],r),t}),{}):ki.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"visit",value:function(t,e){return this._visit(this.primaryType,t,e)}}])&&bi(e.prototype,r),n&&bi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Bi(t){return(Bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Di(n.key),n)}}function Di(t){var e=function(t,e){if("object"!=Bi(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Bi(e)?e:e+""}var Ui,zi=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),I(this,"alphabet",e),I(this,"base",e.length),I(this,"_alphabetMap",{}),I(this,"_leader",e.charAt(0));for(var r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r},(e=[{key:"encode",value:function(t){var e=Object(c.a)(t);if(0===e.length)return"";for(var r=[0],n=0;n<e.length;++n){for(var o=e[n],i=0;i<r.length;++i)o+=r[i]<<8,r[i]=o%this.base,o=o/this.base|0;for(;o>0;)r.push(o%this.base),o=o/this.base|0}for(var a="",u=0;0===e[u]&&u<e.length-1;++u)a+=this._leader;for(var s=r.length-1;s>=0;--s)a+=this.alphabet[r[s]];return a}},{key:"decode",value:function(t){if("string"!=typeof t)throw new TypeError("Expected String");var e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(var r=0;r<t.length;r++){var n=this._alphabetMap[t[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");for(var o=n,i=0;i<e.length;++i)o+=e[i]*this.base,e[i]=255&o,o>>=8;for(;o>0;)e.push(255&o),o>>=8}for(var a=0;t[a]===this._leader&&a<t.length-1;++a)e.push(0);return Object(c.a)(new Uint8Array(e.reverse()))}}])&&Fi(t.prototype,e),r&&Fi(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Gi=(new zi("abcdefghijklmnopqrstuvwxyz234567"),new zi("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),Hi=r(4),qi=r.n(Hi);!function(t){t.sha256="sha256",t.sha512="sha512"}(Ui||(Ui={}));var Ki=new h.b("sha2/5.7.0");function Wi(t){return"0x"+qi.a.ripemd160().update(Object(c.a)(t)).digest("hex")}function Qi(t){return"0x"+qi.a.sha256().update(Object(c.a)(t)).digest("hex")}function Vi(t){return"0x"+qi.a.sha512().update(Object(c.a)(t)).digest("hex")}function Ji(t,e,r){return Ui[t]||Ki.throwError("unsupported algorithm "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+qi.a.hmac(qi.a[t],Object(c.a)(e)).update(Object(c.a)(r)).digest("hex")}function Yi(t,e,r,n,o){var i;t=Object(c.a)(t),e=Object(c.a)(e);var a,u,s=1,l=new Uint8Array(n),f=new Uint8Array(e.length+4);f.set(e);for(var h=1;h<=s;h++){f[e.length]=h>>24&255,f[e.length+1]=h>>16&255,f[e.length+2]=h>>8&255,f[e.length+3]=255&h;var p=Object(c.a)(Ji(o,t,f));i||(i=p.length,u=new Uint8Array(i),a=n-((s=Math.ceil(n/i))-1)*i),u.set(p);for(var d=1;d<r;d++){p=Object(c.a)(Ji(o,t,p));for(var m=0;m<i;m++)u[m]^=p[m]}var v=(h-1)*i,y=h===s?a:i;l.set(Object(c.a)(u).slice(0,y),v)}return Object(c.i)(l)}function Zi(t){return(Zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$i(n.key),n)}}function $i(t){var e=function(t,e){if("object"!=Zi(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Zi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Zi(e)?e:e+""}var ta=new h.b("wordlists/5.7.0"),ea=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ta.checkAbstract(this instanceof t?this.constructor:void 0,t),I(this,"locale",e)},r=[{key:"check",value:function(t){for(var e=[],r=0;r<2048;r++){var n=t.getWord(r);if(r!==t.getWordIndex(n))return"0x";e.push(n)}return It(e.join("\n")+"\n")}},{key:"register",value:function(t,e){e||(e=t.locale)}}],(e=[{key:"split",value:function(t){return t.toLowerCase().split(/ +/g)}},{key:"join",value:function(t){return t.join(" ")}}])&&Xi(t.prototype,e),r&&Xi(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ra(t){return(ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oa(n.key),n)}}function oa(t){var e=function(t,e){if("object"!=ra(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ra(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ra(e)?e:e+""}function ia(t,e,r){return e=aa(e),function(t,e){if(e&&("object"==ra(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],aa(t).constructor):e.apply(t,r))}function aa(t){return(aa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ua(t,e){return(ua=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var sa=null;function ca(t){if(null==sa&&(sa="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==ea.check(t)))throw sa=null,new Error("BIP39 Wordlist for en (English) FAILED")}var la=new(function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),ia(this,e,["en"])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ua(t,e)}(e,t),r=e,(n=[{key:"getWord",value:function(t){return ca(this),sa[t]}},{key:"getWordIndex",value:function(t){return ca(this),sa.indexOf(t)}}])&&na(r.prototype,n),o&&na(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(ea));ea.register(la);var fa={en:la};function ha(t){return(ha="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,da(n.key),n)}}function da(t){var e=function(t,e){if("object"!=ha(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ha(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ha(e)?e:e+""}var ma=new h.b("hdnode/5.7.0"),va=w.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ya=Ot("Bitcoin seed");function ga(t){return(1<<t)-1<<8-t}function ba(t){return Object(c.h)(Object(c.i)(t),32)}function wa(t){return Gi.encode(Object(c.b)([t,Object(c.e)(Qi(Qi(t)),0,4)]))}function _a(t){if(null==t)return fa.en;if("string"==typeof t){var e=fa[t];return null==e&&ma.throwArgumentError("unknown locale","wordlist",t),e}return t}var ka={},Ea="m/44'/60'/0'/0/0",xa=function(){function t(e,r,n,o,i,a,u,s){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e!==ka)throw new Error("HDNode constructor cannot be called directly");if(r){var l=new to(r);I(this,"privateKey",l.privateKey),I(this,"publicKey",l.compressedPublicKey)}else I(this,"privateKey",null),I(this,"publicKey",Object(c.i)(n));I(this,"parentFingerprint",o),I(this,"fingerprint",Object(c.e)(Wi(Qi(this.publicKey)),0,4)),I(this,"address",co(this.publicKey)),I(this,"chainCode",i),I(this,"index",a),I(this,"depth",u),null==s?(I(this,"mnemonic",null),I(this,"path",null)):"string"==typeof s?(I(this,"mnemonic",null),I(this,"path",s)):(I(this,"mnemonic",s),I(this,"path",s.path))}return e=t,n=[{key:"_fromSeed",value:function(e,r){var n=Object(c.a)(e);if(n.length<16||n.length>64)throw new Error("invalid seed");var o=Object(c.a)(Ji(Ui.sha512,ya,n));return new t(ka,ba(o.slice(0,32)),null,"0x00000000",ba(o.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(e,r,n){return e=Sa(Oa(e,n=_a(n)),n),t._fromSeed(Aa(e,r),{phrase:e,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(e){return t._fromSeed(e,null)}},{key:"fromExtendedKey",value:function(e){var r=Gi.decode(e);82===r.length&&wa(r.slice(0,78))===e||ma.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],o=Object(c.i)(r.slice(5,9)),i=parseInt(Object(c.i)(r.slice(9,13)).substring(2),16),a=Object(c.i)(r.slice(13,45)),u=r.slice(45,78);switch(Object(c.i)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new t(ka,null,Object(c.i)(u),o,a,i,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new t(ka,Object(c.i)(u.slice(1)),null,o,a,i,n,null)}return ma.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}],(r=[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!");return wa(Object(c.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(c.i)(this.depth),this.parentFingerprint,Object(c.h)(Object(c.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(c.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new t(ka,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(e){if(e>4294967295)throw new Error("invalid index - "+String(e));var r=this.path;r&&(r+="/"+(2147483647&e));var n=new Uint8Array(37);if(2147483648&e){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Object(c.a)(this.privateKey),1),r&&(r+="'")}else n.set(Object(c.a)(this.publicKey));for(var o=24;o>=0;o-=8)n[33+(o>>3)]=e>>24-o&255;var i=Object(c.a)(Ji(Ui.sha512,this.chainCode,n)),a=i.slice(0,32),u=i.slice(32),s=null,l=null;this.privateKey?s=ba(w.from(a).add(this.privateKey).mod(va)):l=new to(Object(c.i)(a))._addPoint(this.publicKey);var f=r,h=this.mnemonic;return h&&(f=Object.freeze({phrase:h.phrase,path:r,locale:h.locale||"en"})),new t(ka,s,l,this.fingerprint,ba(u),e,this.depth+1,f)}},{key:"derivePath",value:function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var r=this,n=0;n<e.length;n++){var o=e[n];if(o.match(/^[0-9]+'$/)){var i=parseInt(o.substring(0,o.length-1));if(i>=2147483648)throw new Error("invalid path index - "+o);r=r._derive(2147483648+i)}else{if(!o.match(/^[0-9]+$/))throw new Error("invalid path component - "+o);var a=parseInt(o);if(a>=2147483648)throw new Error("invalid path index - "+o);r=r._derive(a)}}return r}}])&&pa(e.prototype,r),n&&pa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Aa(t,e){e||(e="");var r=Ot("mnemonic"+e,wt.NFKD);return Yi(Ot(t,wt.NFKD),r,2048,64,"sha512")}function Oa(t,e){e=_a(e),ma.checkNormalize();var r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=Object(c.a)(new Uint8Array(Math.ceil(11*r.length/8))),o=0,i=0;i<r.length;i++){var a=e.getWordIndex(r[i].normalize("NFKD"));if(-1===a)throw new Error("invalid mnemonic");for(var u=0;u<11;u++)a&1<<10-u&&(n[o>>3]|=1<<7-o%8),o++}var s=32*r.length/3,l=ga(r.length/3);if((Object(c.a)(Qi(n.slice(0,s/8)))[0]&l)!==(n[n.length-1]&l))throw new Error("invalid checksum");return Object(c.i)(n.slice(0,s/8))}function Sa(t,e){if(e=_a(e),(t=Object(c.a)(t)).length%4!=0||t.length<16||t.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,o=0;o<t.length;o++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&(1<<8-n)-1),n+=3);var i=t.length/4,a=Object(c.a)(Qi(t))[0]&ga(i);return r[r.length-1]<<=i,r[r.length-1]|=a>>8-i,e.join(r.map((function(t){return e.getWord(t)})))}function Pa(t,e){try{return Oa(t,e),!0}catch(t){}return!1}function ja(t){return("number"!=typeof t||t<0||t>=2147483648||t%1)&&ma.throwArgumentError("invalid account index","index",t),"m/44'/60'/".concat(t,"'/0/0")}var Ta=r(79),Na=r(6),Ia=r.n(Na),Ra=r(14),La=r.n(Ra);function Ca(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Object(c.a)(t)}function Ma(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function Ba(t){return"string"==typeof t?Ot(t,wt.NFKC):Object(c.a)(t)}function Fa(t,e){for(var r=t,n=e.toLowerCase().split("/"),o=0;o<n.length;o++){var i=null;for(var a in r)if(a.toLowerCase()===n[o]){i=r[a];break}if(null===i)return null;r=i}return r}function Da(t){var e=Object(c.a)(t);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var r=Object(c.i)(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}function Ua(t){return(Ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function za(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */za=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==Ua(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Ua(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ga(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ha(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qa(n.key),n)}}function qa(t){var e=function(t,e){if("object"!=Ua(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ua(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ua(e)?e:e+""}function Ka(t,e,r){return e=Wa(e),function(t,e){if(e&&("object"==Ua(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Wa(t).constructor):e.apply(t,r))}function Wa(t){return(Wa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qa(t,e){return(Qa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Va=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Ja=new h.b("json-wallets/5.7.0");function Ya(t){return null!=t&&t.mnemonic&&t.mnemonic.phrase}var Za=function(t){function e(){return Ga(this,e),Ka(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qa(t,e)}(e,t),r=e,(n=[{key:"isKeystoreAccount",value:function(t){return!(!t||!t._isKeystoreAccount)}}])&&Ha(r.prototype,n),o&&Ha(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(U);function Xa(t,e){var r=Ca(Fa(t,"crypto/ciphertext"));if(Object(c.i)($(Object(c.b)([e.slice(16,32),r]))).substring(2)!==Fa(t,"crypto/mac").toLowerCase())throw new Error("invalid password");var n=function(t,e,r){if("aes-128-ctr"===Fa(t,"crypto/cipher")){var n=Ca(Fa(t,"crypto/cipherparams/iv")),o=new Ia.a.Counter(n),i=new Ia.a.ModeOfOperation.ctr(e,o);return Object(c.a)(i.decrypt(r))}return null}(t,e.slice(0,16),r);n||Ja.throwError("unsupported cipher",h.b.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var o=e.slice(32,64),i=co(n);if(t.address){var a=t.address.toLowerCase();if("0x"!==a.substring(0,2)&&(a="0x"+a),mt(a)!==i)throw new Error("address mismatch")}var u={_isKeystoreAccount:!0,address:i,privateKey:Object(c.i)(n)};if("0.1"===Fa(t,"x-ethers/version")){var s=Ca(Fa(t,"x-ethers/mnemonicCiphertext")),l=Ca(Fa(t,"x-ethers/mnemonicCounter")),f=new Ia.a.Counter(l),p=new Ia.a.ModeOfOperation.ctr(o,f),d=Fa(t,"x-ethers/path")||Ea,m=Fa(t,"x-ethers/locale")||"en",v=Object(c.a)(p.decrypt(s));try{var y=Sa(v,m),g=xa.fromMnemonic(y,null,m).derivePath(d);if(g.privateKey!=u.privateKey)throw new Error("mnemonic mismatch");u.mnemonic=g.mnemonic}catch(t){if(t.code!==h.b.errors.INVALID_ARGUMENT||"wordlist"!==t.argument)throw t}}return new Za(u)}function $a(t,e,r,n,o){return Object(c.a)(Yi(t,e,r,n,o))}function tu(t,e,r,n,o){return Promise.resolve($a(t,e,r,n,o))}function eu(t,e,r,n,o){var i=Ba(e),a=Fa(t,"crypto/kdf");if(a&&"string"==typeof a){var u=function(t,e){return Ja.throwArgumentError("invalid key-derivation function parameters",t,e)};if("scrypt"===a.toLowerCase()){var s=Ca(Fa(t,"crypto/kdfparams/salt")),c=parseInt(Fa(t,"crypto/kdfparams/n")),l=parseInt(Fa(t,"crypto/kdfparams/r")),f=parseInt(Fa(t,"crypto/kdfparams/p"));c&&l&&f||u("kdf",a),0!=(c&c-1)&&u("N",c);var h=parseInt(Fa(t,"crypto/kdfparams/dklen"));return 32!==h&&u("dklen",h),n(i,s,c,l,f,64,o)}if("pbkdf2"===a.toLowerCase()){var p=Ca(Fa(t,"crypto/kdfparams/salt")),d=null,m=Fa(t,"crypto/kdfparams/prf");"hmac-sha256"===m?d="sha256":"hmac-sha512"===m?d="sha512":u("prf",m);var v=parseInt(Fa(t,"crypto/kdfparams/c")),y=parseInt(Fa(t,"crypto/kdfparams/dklen"));return 32!==y&&u("dklen",y),r(i,p,v,y,d)}}return Ja.throwArgumentError("unsupported key-derivation function","kdf",a)}function ru(t){return(ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ou(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iu(n.key),n)}}function iu(t){var e=function(t,e){if("object"!=ru(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ru(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ru(e)?e:e+""}function au(t,e,r){return e=uu(e),function(t,e){if(e&&("object"==ru(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],uu(t).constructor):e.apply(t,r))}function uu(t){return(uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function su(t,e){return(su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var cu=new h.b("json-wallets/5.7.0"),lu=function(t){function e(){return nu(this,e),au(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&su(t,e)}(e,t),r=e,(n=[{key:"isCrowdsaleAccount",value:function(t){return!(!t||!t._isCrowdsaleAccount)}}])&&ou(r.prototype,n),o&&ou(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(U);function fu(t,e){var r=JSON.parse(t);e=Ba(e);var n=mt(Fa(r,"ethaddr")),o=Ca(Fa(r,"encseed"));o&&o.length%16==0||cu.throwArgumentError("invalid encseed","json",t);for(var i=Object(c.a)(Yi(e,e,2e3,32,"sha256")).slice(0,16),a=o.slice(0,16),u=o.slice(16),s=new Ia.a.ModeOfOperation.cbc(i,a),l=Ia.a.padding.pkcs7.strip(Object(c.a)(s.decrypt(u))),f="",h=0;h<l.length;h++)f+=String.fromCharCode(l[h]);var p=$(Ot(f));return new lu({_isCrowdsaleAccount:!0,address:n,privateKey:p})}function hu(t){var e=null;try{e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function pu(t){var e=null;try{e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}function du(t){if(hu(t))try{return mt(JSON.parse(t).ethaddr)}catch(t){return null}if(pu(t))try{return mt(JSON.parse(t).address)}catch(t){return null}return null}function mu(t,e,r){if(hu(t)){r&&r(0);var n=fu(t,e);return r&&r(1),Promise.resolve(n)}return pu(t)?function(t,e,r){return Va(this,void 0,void 0,za().mark((function n(){var o,i;return za().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=JSON.parse(t),n.next=3,eu(o,e,tu,La.a.scrypt,r);case 3:return i=n.sent,n.abrupt("return",Xa(o,i));case 5:case"end":return n.stop()}}),n)})))}(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function vu(t,e){if(hu(t))return fu(t,e);if(pu(t))return function(t,e){var r=JSON.parse(t);return Xa(r,eu(r,e,$a,La.a.syncScrypt))}(t,e);throw new Error("invalid JSON wallet")}function yu(t){return(yu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gu(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */gu=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==yu(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(yu(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function bu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wu(n.key),n)}}function wu(t){var e=function(t,e){if("object"!=yu(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=yu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==yu(e)?e:e+""}function _u(t,e,r){return e=ku(e),function(t,e){if(e&&("object"==yu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ku(t).constructor):e.apply(t,r))}function ku(t){return(ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Eu(t,e){return(Eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var xu=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Au=new h.b("wallet/5.7.0");var Ou=function(t){function e(t,r){var n,o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=_u(this,e),null!=(o=t)&&Object(c.l)(o.privateKey,32)&&null!=o.address){var i=new to(t.privateKey);if(I(n,"_signingKey",(function(){return i})),I(n,"address",co(n.publicKey)),n.address!==mt(t.address)&&Au.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(t){var e=t.mnemonic;return e&&e.phrase}(t)){var a=t.mnemonic;I(n,"_mnemonic",(function(){return{phrase:a.phrase,path:a.path||Ea,locale:a.locale||"en"}}));var u=n.mnemonic;co(xa.fromMnemonic(u.phrase,null,u.locale).derivePath(u.path).privateKey)!==n.address&&Au.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else I(n,"_mnemonic",(function(){return null}))}else{if(to.isSigningKey(t))"secp256k1"!==t.curve&&Au.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),I(n,"_signingKey",(function(){return t}));else{"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t);var s=new to(t);I(n,"_signingKey",(function(){return s}))}I(n,"_mnemonic",(function(){return null})),I(n,"address",co(n.publicKey))}return r&&!Nn.isProvider(r)&&Au.throwArgumentError("invalid provider","provider",r),I(n,"provider",r||null),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Eu(t,e)}(e,t),r=e,o=[{key:"createRandom",value:function(t){var r=Object(Ta.a)(16);t||(t={}),t.extraEntropy&&(r=Object(c.a)(Object(c.e)($(Object(c.b)([r,t.extraEntropy])),0,16)));var n=Sa(r,t.locale);return e.fromMnemonic(n,t.path,t.locale)}},{key:"fromEncryptedJson",value:function(t,r,n){return mu(t,r,n).then((function(t){return new e(t)}))}},{key:"fromEncryptedJsonSync",value:function(t,r){return new e(vu(t,r))}},{key:"fromMnemonic",value:function(t,r,n){return r||(r=Ea),new e(xa.fromMnemonic(t,null,n).derivePath(r))}}],(n=[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(t){return new e(this,t)}},{key:"signTransaction",value:function(t){var e=this;return L(t).then((function(r){null!=r.from&&(mt(r.from)!==e.address&&Au.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete r.from);var n=e._signingKey().signDigest($(go(r)));return go(r,n)}))}},{key:"signMessage",value:function(t){return xu(this,void 0,void 0,gu().mark((function e(){return gu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(c.m)(this._signingKey().signDigest(vi(t))));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"_signTypedData",value:function(t,e,r){return xu(this,void 0,void 0,gu().mark((function n(){var o,i=this;return gu().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Mi.resolveNames(t,e,r,(function(t){return null==i.provider&&Au.throwError("cannot resolve ENS names without a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:t}),i.provider.resolveName(t)}));case 2:return o=n.sent,n.abrupt("return",Object(c.m)(this._signingKey().signDigest(Mi.hash(o.domain,e,o.value))));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"encrypt",value:function(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e||(e={}),function(t,e,r,n){try{if(mt(t.address)!==co(t.privateKey))throw new Error("address/privateKey mismatch");if(Ya(t)){var o=t.mnemonic;if(xa.fromMnemonic(o.phrase,null,o.locale).derivePath(o.path||Ea).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(t){return Promise.reject(t)}"function"!=typeof r||n||(n=r,r={}),r||(r={});var i=Object(c.a)(t.privateKey),a=Ba(e),u=null,s=null,l=null;if(Ya(t)){var f=t.mnemonic;u=Object(c.a)(Oa(f.phrase,f.locale||"en")),s=f.path||Ea,l=f.locale||"en"}var h=r.client;h||(h="ethers.js");var p=null;p=r.salt?Object(c.a)(r.salt):Object(Ta.a)(32);var d=null;if(r.iv){if(16!==(d=Object(c.a)(r.iv)).length)throw new Error("invalid iv")}else d=Object(Ta.a)(16);var m=null;if(r.uuid){if(16!==(m=Object(c.a)(r.uuid)).length)throw new Error("invalid uuid")}else m=Object(Ta.a)(16);var v=1<<17,y=8,g=1;return r.scrypt&&(r.scrypt.N&&(v=r.scrypt.N),r.scrypt.r&&(y=r.scrypt.r),r.scrypt.p&&(g=r.scrypt.p)),La.a.scrypt(a,p,v,y,g,64,n).then((function(e){var r=(e=Object(c.a)(e)).slice(0,16),n=e.slice(16,32),o=e.slice(32,64),a=new Ia.a.Counter(d),f=new Ia.a.ModeOfOperation.ctr(r,a),b=Object(c.a)(f.encrypt(i)),w=$(Object(c.b)([n,b])),_={address:t.address.substring(2).toLowerCase(),id:Da(m),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Object(c.i)(d).substring(2)},ciphertext:Object(c.i)(b).substring(2),kdf:"scrypt",kdfparams:{salt:Object(c.i)(p).substring(2),n:v,dklen:32,p:g,r:y},mac:w.substring(2)}};if(u){var k=Object(Ta.a)(16),E=new Ia.a.Counter(k),x=new Ia.a.ModeOfOperation.ctr(o,E),A=Object(c.a)(x.encrypt(u)),O=new Date,S=O.getUTCFullYear()+"-"+Ma(O.getUTCMonth()+1,2)+"-"+Ma(O.getUTCDate(),2)+"T"+Ma(O.getUTCHours(),2)+"-"+Ma(O.getUTCMinutes(),2)+"-"+Ma(O.getUTCSeconds(),2)+".0Z";_["x-ethers"]={client:h,gethFilename:"UTC--"+S+"--"+_.address,mnemonicCounter:Object(c.i)(k).substring(2),mnemonicCiphertext:Object(c.i)(A).substring(2),path:s,locale:l,version:"0.1"}}return JSON.stringify(_)}))}(this,t,e,r)}}])&&bu(r.prototype,n),o&&bu(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Kn);function Su(t,e){return lo(vi(t),e)}function Pu(t,e,r,n){return lo(Mi.hash(t,e,r),n)}var ju="0x0000000000000000000000000000000000000000",Tu="0x0000000000000000000000000000000000000000000000000000000000000000",Nu="Ξ",Iu=new h.b("networks/5.7.1");function Ru(t){var e=function(e,r){null==r&&(r={});var n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){try{var o=new e.PocketProvider(t,r.pocket);o.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(o.network.name)&&n.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{var i=new e.AnkrProvider(t,r.ankr);i.network&&-1===["ropsten"].indexOf(i.network.name)&&n.push(i)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){var a=1;return null!=r.quorum?a=r.quorum:"homestead"===t&&(a=2),new e.FallbackProvider(n,a)}return n[0]};return e.renetwork=function(t){return Ru(t)},e}function Lu(t,e){var r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return Lu(t,e)},r}var Cu={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Ru("homestead")},Mu={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Ru("ropsten")},Bu={chainId:63,name:"classicMordor",_defaultProvider:Lu("https://www.ethercluster.com/mordor","classicMordor")},Fu={unspecified:{chainId:0,name:"unspecified"},homestead:Cu,mainnet:Cu,morden:{chainId:2,name:"morden"},ropsten:Mu,testnet:Mu,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Ru("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Ru("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Ru("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Ru("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Lu("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Bu,classicTestnet:Bu,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Lu("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Ru("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Ru("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Du(t){if(null==t)return null;if("number"==typeof t){for(var e in Fu){var r=Fu[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var n=Fu[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var o=Fu[t.name];if(!o)return"number"!=typeof t.chainId&&Iu.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==o.chainId&&Iu.throwArgumentError("network chainId mismatch","network",t);var i,a=t._defaultProvider||null;return null==a&&o._defaultProvider&&(a=(i=o._defaultProvider)&&"function"==typeof i.renetwork?o._defaultProvider.renetwork(t):o._defaultProvider),{name:t.name,chainId:o.chainId,ensAddress:t.ensAddress||o.ensAddress||null,_defaultProvider:a}}function Uu(t){t=atob(t);for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r));return Object(c.a)(e)}function zu(t){t=Object(c.a)(t);for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Gu(t,e){null==e&&(e=1);var r=[],n=r.forEach;return function t(e,o){n.call(e,(function(e){o>0&&Array.isArray(e)?t(e,o-1):r.push(e)}))}(t,e),r}function Hu(t){return function(t){var e=0;return function(){return t[e++]}}(function(t){var e=0;function r(){return t[e++]<<8|t[e++]}for(var n=r(),o=1,i=[0,1],a=1;a<n;a++)i.push(o+=r());var u=r(),s=e;e+=u;var c=0,l=0;function f(){return 0==c&&(l=l<<8|t[e++],c=8),l>>--c&1}for(var h=Math.pow(2,31),p=h>>>1,d=p>>1,m=h-1,v=0,y=0;y<31;y++)v=v<<1|f();for(var g=[],b=0,w=h;;){for(var _=Math.floor(((v-b+1)*o-1)/w),k=0,E=n;E-k>1;){var x=k+E>>>1;_<i[x]?E=x:k=x}if(0==k)break;g.push(k);for(var A=b+Math.floor(w*i[k]/o),O=b+Math.floor(w*i[k+1]/o)-1;0==((A^O)&p);)v=v<<1&m|f(),A=A<<1&m,O=O<<1&m|1;for(;A&~O&d;)v=v&p|v<<1&m>>>1|f(),A=A<<1^p,O=(O^p)<<1|p|1;b=A,w=1+O-A}var S=n-4;return g.map((function(e){switch(e-S){case 3:return S+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return S+256+(t[s++]<<8|t[s++]);case 1:return S+t[s++];default:return e-1}}))}(t))}function qu(t){return 1&t?~t>>1:t>>1}function Ku(t,e){for(var r=Array(t),n=0,o=-1;n<t;n++)r[n]=o+=1+e();return r}function Wu(t,e){for(var r=Array(t),n=0,o=0;n<t;n++)r[n]=o+=qu(e());return r}function Qu(t,e){for(var r=Ku(t(),t),n=t(),o=Ku(n,t),i=function(t,e){for(var r=Array(t),n=0;n<t;n++)r[n]=1+e();return r}(n,t),a=0;a<n;a++)for(var u=0;u<i[a];u++)r.push(o[a]+u);return e?r.map((function(t){return e[t]})):r}function Vu(t,e,r){for(var n=Array(t).fill(void 0).map((function(){return[]})),o=0;o<e;o++)Wu(t,r).forEach((function(t,e){return n[e].push(t)}));return n}function Ju(t,e){var r=1+e(),n=e(),o=function(t){for(var e=[];;){var r=t();if(0==r)break;e.push(r)}return e}(e);return Gu(Vu(o.length,1+t,e).map((function(t,e){var i=t[0],a=t.slice(1);return Array(o[e]).fill(void 0).map((function(t,e){var o=e*n;return[i+e*r,a.map((function(t){return t+o}))]}))})))}function Yu(t,e){return Vu(1+e(),1+t,e).map((function(t){return[t[0],t.slice(1)]}))}function Zu(t){return function(t){if(Array.isArray(t))return $u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Xu(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xu(t,e){if(t){if("string"==typeof t)return $u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$u(t,e):void 0}}function $u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ts,es,rs=Hu(Uu("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),ns=new Set(Qu(rs)),os=new Set(Qu(rs)),is=function(t){for(var e=[];;){var r=t();if(0==r)break;e.push(Ju(r,t))}for(;;){var n=t()-1;if(n<0)break;e.push(Yu(n,t))}return function(t){for(var e={},r=0;r<t.length;r++){var n=t[r];e[n[0]]=n[1]}return e}(Gu(e))}(rs),as=(es=Qu(ts=rs).sort((function(t,e){return t-e})),function t(){for(var e=[];;){var r=Qu(ts,es);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((function(t,e){return e.set.size-t.set.size}));var n=ts();return{branches:e,valid:n%3,fe0f:!!(1&(n=n/3|0)),save:1==(n>>=1),check:2==n}}());function us(t){return Nt(t)}function ss(t){return t.filter((function(t){return 65039!=t}))}function cs(t){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Xu(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t.split("."));try{for(r.s();!(e=r.n()).done;){var n=e.value,o=us(n);try{for(var i=o.lastIndexOf(95)-1;i>=0;i--)if(95!==o[i])throw new Error("underscore only allowed at start");if(o.length>=4&&o.every((function(t){return t<128}))&&45===o[2]&&45===o[3])throw new Error("invalid label extension")}catch(t){throw new Error('Invalid label "'.concat(n,'": ').concat(t.message))}}}catch(t){r.e(t)}finally{r.f()}return t}function ls(t){return cs(function(t,e){var r=us(t).reverse(),n=[];for(;r.length;){var o=fs(r);if(o)n.push.apply(n,Zu(e(o)));else{var i=r.pop();if(ns.has(i))n.push(i);else if(!os.has(i)){var a=is[i];if(!a)throw new Error("Disallowed codepoint: 0x".concat(i.toString(16).toUpperCase()));n.push.apply(n,Zu(a))}}}return cs((u=String.fromCodePoint.apply(String,n),u.normalize("NFC")));var u}(t,ss))}function fs(t,e){var r,n,o,i=as,a=[],u=t.length;e&&(e.length=0);for(var s=function(){var s=t[--u];if(!(i=null===(r=i.branches.find((function(t){return t.set.has(s)})))||void 0===r?void 0:r.node))return 0;if(i.save)o=s;else if(i.check&&s===o)return 0;a.push(s),i.fe0f&&(a.push(65039),u>0&&65039==t[u-1]&&u--),i.valid&&(n=a.slice(),2==i.valid&&n.splice(1,1),e&&e.push.apply(e,Zu(t.slice(u).reverse())),t.length=u)};u&&0!==s(););return n}var hs=new h.b("hash/5.7.0"),ps=new Uint8Array(32);function ds(t){if(0===t.length)throw new Error("invalid ENS name; empty component");return t}function ms(t){var e=Ot(ls(t)),r=[];if(0===t.length)return r;for(var n=0,o=0;o<e.length;o++){46===e[o]&&(r.push(ds(e.slice(n,o))),n=o+1)}if(n>=e.length)throw new Error("invalid ENS name; empty component");return r.push(ds(e.slice(n))),r}function vs(t){try{return 0!==ms(t).length}catch(t){}return!1}function ys(t){"string"!=typeof t&&hs.throwArgumentError("invalid ENS name; not a string","name",t);for(var e=ps,r=ms(t);r.length;)e=$(Object(c.b)([e,$(r.pop())]));return Object(c.i)(e)}function gs(t){return Object(c.i)(Object(c.b)(ms(t).map((function(t){if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e}))))+"00"}ps.fill(0);function bs(t){return(bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ws(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ws=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==bs(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(bs(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}var _s=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};function ks(t,e){return _s(this,void 0,void 0,ws().mark((function r(){var n,o,i,a,u;return ws().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e&&(e={}),n={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0},!0!==e.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=e.fetchOptions&&((o=e.fetchOptions).mode&&(n.mode=o.mode),o.cache&&(n.cache=o.cache),o.credentials&&(n.credentials=o.credentials),o.redirect&&(n.redirect=o.redirect),o.referrer&&(n.referrer=o.referrer)),r.next=7,fetch(t,n);case 7:return i=r.sent,r.next=10,i.arrayBuffer();case 10:return a=r.sent,u={},i.headers.forEach?i.headers.forEach((function(t,e){u[e.toLowerCase()]=t})):i.headers.keys().forEach((function(t){u[t.toLowerCase()]=i.headers.get(t)})),r.abrupt("return",{headers:u,statusCode:i.status,statusMessage:i.statusText,body:Object(c.a)(new Uint8Array(a))});case 14:case"end":return r.stop()}}),r)})))}function Es(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Es=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==xs(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(xs(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function xs(t){return(xs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var As=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Os=new h.b("web/5.7.1");function Ss(t){return new Promise((function(e){setTimeout(e,t)}))}function Ps(t,e){if(null==t)return null;if("string"==typeof t)return t;if(Object(c.k)(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return Tt(t)}catch(t){}return Object(c.i)(t)}return t}function js(t,e,r){var n="object"===xs(t)&&null!=t.throttleLimit?t.throttleLimit:12;Os.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);var o="object"===xs(t)?t.throttleCallback:null,i="object"===xs(t)&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;Os.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);var a="object"===xs(t)&&!!t.errorPassThrough,u={},s=null,c={method:"GET"},l=!1,f=12e4;if("string"==typeof t)s=t;else if("object"===xs(t)){if(null!=t&&null!=t.url||Os.throwArgumentError("missing URL","connection.url",t),s=t.url,"number"==typeof t.timeout&&t.timeout>0&&(f=t.timeout),t.headers)for(var p in t.headers)u[p.toLowerCase()]={key:p,value:String(t.headers[p])},["if-none-match","if-modified-since"].indexOf(p.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==s.substring(0,6)&&!0!==t.allowInsecureAuthentication&&Os.throwError("basic authentication requires a secure https url",h.b.errors.INVALID_ARGUMENT,{argument:"url",url:s,user:t.user,password:"[REDACTED]"});var d=t.user+":"+t.password;u.authorization={key:"Authorization",value:"Basic "+zu(Ot(d))}}null!=t.skipFetchSetup&&(c.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(c.fetchOptions=M(t.fetchOptions))}var m,v=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=s?s.match(v):null;if(y)try{var g={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?Uu(y[3]):(m=y[3],Ot(m.replace(/%([0-9a-f][0-9a-f])/gi,(function(t,e){return String.fromCharCode(parseInt(e,16))}))))},b=g.body;return r&&(b=r(g.body,g)),Promise.resolve(b)}catch(t){Os.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:Ps(y[1],y[2]),error:t,requestBody:null,requestMethod:"GET",url:s})}e&&(c.method="POST",c.body=e,null==u["content-type"]&&(u["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==u["content-length"]&&(u["content-length"]={key:"Content-Length",value:String(e.length)}));var w={};Object.keys(u).forEach((function(t){var e=u[t];w[e.key]=e.value})),c.headers=w;var _,k=(_=null,{promise:new Promise((function(t,e){f&&(_=setTimeout((function(){null!=_&&(_=null,e(Os.makeError("timeout",h.b.errors.TIMEOUT,{requestBody:Ps(c.body,w["content-type"]),requestMethod:c.method,timeout:f,url:s})))}),f))})),cancel:function(){null!=_&&(clearTimeout(_),_=null)}}),E=function(){return As(this,void 0,void 0,Es().mark((function t(){var e,u,f,p,d,m,v,y,g,b;return Es().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<n)){t.next=65;break}return u=null,t.prev=3,t.next=6,ks(s,c);case 6:if(u=t.sent,!(e<n)){t.next=28;break}if(301!==u.statusCode&&302!==u.statusCode){t.next=15;break}if(f=u.headers.location||"","GET"!==c.method||!f.match(/^https:/)){t.next=13;break}return s=u.headers.location,t.abrupt("continue",62);case 13:t.next=28;break;case 15:if(429!==u.statusCode){t.next=28;break}if(p=!0,!o){t.next=21;break}return t.next=20,o(e,s);case 20:p=t.sent;case 21:if(!p){t.next=28;break}return d=0,m=u.headers["retry-after"],d="string"==typeof m&&m.match(/^[1-9][0-9]*$/)?1e3*parseInt(m):i*parseInt(String(Math.random()*Math.pow(2,e))),t.next=27,Ss(d);case 27:return t.abrupt("continue",62);case 28:t.next=34;break;case 30:t.prev=30,t.t0=t.catch(3),null==(u=t.t0.response)&&(k.cancel(),Os.throwError("missing response",h.b.errors.SERVER_ERROR,{requestBody:Ps(c.body,w["content-type"]),requestMethod:c.method,serverError:t.t0,url:s}));case 34:if(v=u.body,l&&304===u.statusCode?v=null:!a&&(u.statusCode<200||u.statusCode>=300)&&(k.cancel(),Os.throwError("bad response",h.b.errors.SERVER_ERROR,{status:u.statusCode,headers:u.headers,body:Ps(v,u.headers?u.headers["content-type"]:null),requestBody:Ps(c.body,w["content-type"]),requestMethod:c.method,url:s})),!r){t.next=60;break}return t.prev=37,t.next=40,r(v,u);case 40:return y=t.sent,k.cancel(),t.abrupt("return",y);case 45:if(t.prev=45,t.t1=t.catch(37),!(t.t1.throttleRetry&&e<n)){t.next=58;break}if(g=!0,!o){t.next=53;break}return t.next=52,o(e,s);case 52:g=t.sent;case 53:if(!g){t.next=58;break}return b=i*parseInt(String(Math.random()*Math.pow(2,e))),t.next=57,Ss(b);case 57:return t.abrupt("continue",62);case 58:k.cancel(),Os.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:Ps(v,u.headers?u.headers["content-type"]:null),error:t.t1,requestBody:Ps(c.body,w["content-type"]),requestMethod:c.method,url:s});case 60:return k.cancel(),t.abrupt("return",v);case 62:e++,t.next=1;break;case 65:return t.abrupt("return",Os.throwError("failed response",h.b.errors.SERVER_ERROR,{requestBody:Ps(c.body,w["content-type"]),requestMethod:c.method,url:s}));case 66:case"end":return t.stop()}}),t,null,[[3,30],[37,45]])})))}();return Promise.race([k.promise,E])}function Ts(t,e,r){var n=null;if(null!=e){n=Ot(e);var o="string"==typeof t?{url:t}:M(t);if(o.headers)0!==Object.keys(o.headers).filter((function(t){return"content-type"===t.toLowerCase()})).length||(o.headers=M(o.headers),o.headers["content-type"]="application/json");else o.headers={"content-type":"application/json"};t=o}return js(t,n,(function(t,e){var n=null;if(null!=t)try{n=JSON.parse(Tt(t))}catch(e){Os.throwError("invalid JSON",h.b.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function Ns(t,e){return e||(e={}),null==(e=M(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){var o=null,i=!1,a=function(){return!i&&(i=!0,o&&clearTimeout(o),!0)};e.timeout&&(o=setTimeout((function(){a()&&n(new Error("timeout"))}),e.timeout));var u=e.retryLimit,s=0;!function o(){return t().then((function(t){if(void 0!==t)a()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",o);else if(e.onceBlock)e.onceBlock.once("block",o);else if(!i){if(++s>u)return void(a()&&n(new Error("retry limit reached")));var c=e.interval*parseInt(String(Math.random()*Math.pow(2,s)));c<e.floor&&(c=e.floor),c>e.ceiling&&(c=e.ceiling),setTimeout(o,c)}return null}),(function(t){a()&&n(t)}))}()}))}var Is=r(22),Rs=r.n(Is);function Ls(t){return(Ls="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ms(n.key),n)}}function Ms(t){var e=function(t,e){if("object"!=Ls(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ls(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ls(e)?e:e+""}var Bs=new h.b("providers/5.7.2"),Fs=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.formats=this.getDefaultFormats()}return e=t,n=[{key:"check",value:function(t,e){var r={};for(var n in t)try{var o=t[n](e[n]);void 0!==o&&(r[n]=o)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}},{key:"allowNull",value:function(t,e){return function(r){return null==r?e:t(r)}}},{key:"allowFalsish",value:function(t,e){return function(r){return r?t(r):e}}},{key:"arrayOf",value:function(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var r=[];return e.forEach((function(e){r.push(t(e))})),r}}}],(r=[{key:"getDefaultFormats",value:function(){var e=this,r={},n=this.address.bind(this),o=this.bigNumber.bind(this),i=this.blockTag.bind(this),a=this.data.bind(this),u=this.hash.bind(this),s=this.hex.bind(this),c=this.number.bind(this),l=this.type.bind(this);return r.transaction={hash:u,type:l,accessList:t.allowNull(this.accessList.bind(this),null),blockHash:t.allowNull(u,null),blockNumber:t.allowNull(c,null),transactionIndex:t.allowNull(c,null),confirmations:t.allowNull(c,null),from:n,gasPrice:t.allowNull(o),maxPriorityFeePerGas:t.allowNull(o),maxFeePerGas:t.allowNull(o),gasLimit:o,to:t.allowNull(n,null),value:o,nonce:c,data:a,r:t.allowNull(this.uint256),s:t.allowNull(this.uint256),v:t.allowNull(c),creates:t.allowNull(n,null),raw:t.allowNull(a)},r.transactionRequest={from:t.allowNull(n),nonce:t.allowNull(c),gasLimit:t.allowNull(o),gasPrice:t.allowNull(o),maxPriorityFeePerGas:t.allowNull(o),maxFeePerGas:t.allowNull(o),to:t.allowNull(n),value:t.allowNull(o),data:t.allowNull((function(t){return e.data(t,!0)})),type:t.allowNull(c),accessList:t.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:u,address:n,topics:t.arrayOf(u),data:a,logIndex:c,blockHash:u},r.receipt={to:t.allowNull(this.address,null),from:t.allowNull(this.address,null),contractAddress:t.allowNull(n,null),transactionIndex:c,root:t.allowNull(s),gasUsed:o,logsBloom:t.allowNull(a),blockHash:u,transactionHash:u,logs:t.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:t.allowNull(c,null),cumulativeGasUsed:o,effectiveGasPrice:t.allowNull(o),status:t.allowNull(c),type:l},r.block={hash:t.allowNull(u),parentHash:u,number:c,timestamp:c,nonce:t.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:o,gasUsed:o,miner:t.allowNull(n),extraData:a,transactions:t.allowNull(t.arrayOf(u)),baseFeePerGas:t.allowNull(o)},r.blockWithTransactions=M(r.block),r.blockWithTransactions.transactions=t.allowNull(t.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:t.allowNull(i,void 0),toBlock:t.allowNull(i,void 0),blockHash:t.allowNull(u,void 0),address:t.allowNull(n,void 0),topics:t.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:t.allowNull(c),blockHash:t.allowNull(u),transactionIndex:c,removed:t.allowNull(this.boolean.bind(this)),address:n,data:t.allowFalsish(a,"0x"),topics:t.arrayOf(u),transactionHash:u,logIndex:c},r}},{key:"accessList",value:function(t){return po(t||[])}},{key:"number",value:function(t){return"0x"===t?0:w.from(t).toNumber()}},{key:"type",value:function(t){return"0x"===t||null==t?0:w.from(t).toNumber()}},{key:"bigNumber",value:function(t){return w.from(t)}},{key:"boolean",value:function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}},{key:"hex",value:function(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),Object(c.l)(t))?t.toLowerCase():Bs.throwArgumentError("invalid hash","value",t)}},{key:"data",value:function(t,e){var r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}},{key:"address",value:function(t){return mt(t)}},{key:"callAddress",value:function(t){if(!Object(c.l)(t,32))return null;var e=mt(Object(c.e)(t,12));return e===ju?null:e}},{key:"contractAddress",value:function(t){return gt(t)}},{key:"blockTag",value:function(t){if(null==t)return"latest";if("earliest"===t)return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if("number"==typeof t||Object(c.l)(t))return Object(c.g)(t);throw new Error("invalid blockTag")}},{key:"hash",value:function(t,e){var r=this.hex(t,e);return 32!==Object(c.d)(r)?Bs.throwArgumentError("invalid hash","value",t):r}},{key:"difficulty",value:function(t){if(null==t)return null;var e=w.from(t);try{return e.toNumber()}catch(t){}return null}},{key:"uint256",value:function(t){if(!Object(c.l)(t))throw new Error("invalid uint256");return Object(c.h)(t,32)}},{key:"_block",value:function(e,r){null!=e.author&&null==e.miner&&(e.miner=e.author);var n=null!=e._difficulty?e._difficulty:e.difficulty,o=t.check(r,e);return o._difficulty=null==n?null:w.from(n),o}},{key:"block",value:function(t){return this._block(t,this.formats.block)}},{key:"blockWithTransactions",value:function(t){return this._block(t,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(e){return t.check(this.formats.transactionRequest,e)}},{key:"transactionResponse",value:function(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&w.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);var r=t.check(this.formats.transaction,e);if(null!=e.chainId){var n=e.chainId;Object(c.l)(n)&&(n=w.from(n).toNumber()),r.chainId=n}else{var o=e.networkId;null==o&&null==r.v&&(o=e.chainId),Object(c.l)(o)&&(o=w.from(o).toNumber()),"number"!=typeof o&&null!=r.v&&((o=(r.v-35)/2)<0&&(o=0),o=parseInt(o)),"number"!=typeof o&&(o=0),r.chainId=o}return r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}},{key:"transaction",value:function(t){return wo(t)}},{key:"receiptLog",value:function(e){return t.check(this.formats.receiptLog,e)}},{key:"receipt",value:function(e){var r=t.check(this.formats.receipt,e);if(null!=r.root)if(r.root.length<=4){var n=w.from(r.root).toNumber();0===n||1===n?(null!=r.status&&r.status!==n&&Bs.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):Bs.throwArgumentError("invalid alt-root-status","value.root",r.root)}else 66!==r.root.length&&Bs.throwArgumentError("invalid root hash","value.root",r.root);return null!=r.status&&(r.byzantium=!0),r}},{key:"topics",value:function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.topics(t)})):null!=t?this.hash(t,!0):null}},{key:"filter",value:function(e){return t.check(this.formats.filter,e)}},{key:"filterLog",value:function(e){return t.check(this.formats.filterLog,e)}}])&&Cs(e.prototype,r),n&&Cs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Ds(t){return t&&"function"==typeof t.isCommunityResource}function Us(t){return Ds(t)&&t.isCommunityResource()}var zs=!1;function Gs(){zs||(zs=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}function Hs(t,e,r){return e=qs(e),function(t,e){if(e&&("object"==Zs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],qs(t).constructor):e.apply(t,r))}function qs(t){return(qs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ks(t,e){return(Ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ws(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ws=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==Zs(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Zs(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Qs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ys(n.key),n)}}function Js(t,e,r){return e&&Vs(t.prototype,e),r&&Vs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ys(t){var e=function(t,e){if("object"!=Zs(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Zs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Zs(e)?e:e+""}function Zs(t){return(Zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Xs=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},$s=new h.b("providers/5.7.2");function tc(t){return null==t?"null":(32!==Object(c.d)(t)&&$s.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function ec(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((function(t){if(Array.isArray(t)){var e={};t.forEach((function(t){e[tc(t)]=!0}));var r=Object.keys(e);return r.sort(),r.join("|")}return tc(t)})).join("&")}function rc(t){if("string"==typeof t){if(t=t.toLowerCase(),32===Object(c.d)(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+ec(t);if(Tn.isForkEvent(t))throw $s.warn("not implemented"),new Error("not implemented");if(t&&"object"===Zs(t))return"filter:"+(t.address||"*")+":"+ec(t.topics||[])}throw new Error("invalid event - "+t)}function nc(){return(new Date).getTime()}function oc(t){return new Promise((function(e){setTimeout(e,t)}))}var ic=["block","network","pending","poll"],ac=function(){return Js((function t(e,r,n){Qs(this,t),I(this,"tag",e),I(this,"listener",r),I(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}),[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}},{key:"filter",get:function(){var t=this.tag.split(":");if("filter"!==t[0])return null;var e,r=t[1],n=""===(e=t[2])?[]:e.split(/&/g).map((function(t){if(""===t)return[];var e=t.split("|").map((function(t){return"null"===t?null:t}));return 1===e.length?e[0]:e})),o={};return n.length>0&&(o.topics=n),r&&"*"!==r&&(o.address=r),o}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||ic.indexOf(this.tag)>=0}}])}(),uc={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function sc(t){return Object(c.h)(w.from(t).toHexString(),32)}function cc(t){return Gi.encode(Object(c.b)([t,Object(c.e)(Qi(Qi(t)),0,4)]))}var lc=new RegExp("^(ipfs)://(.*)$","i"),fc=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),lc,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function hc(t,e){try{return Tt(pc(t,e))}catch(t){}return null}function pc(t,e){if("0x"===t)return null;var r=w.from(Object(c.e)(t,e,e+32)).toNumber(),n=w.from(Object(c.e)(t,r,r+32)).toNumber();return Object(c.e)(t,r+32,r+32+n)}function dc(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):$s.throwArgumentError("unsupported IPFS format","link",t),"https://gateway.ipfs.io/ipfs/".concat(t)}function mc(t){var e=Object(c.a)(t);if(e.length>32)throw new Error("internal; should not happen");var r=new Uint8Array(32);return r.set(e,32-e.length),r}function vc(t){if(t.length%32==0)return t;var e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function yc(t){for(var e=[],r=0,n=0;n<t.length;n++)e.push(null),r+=32;for(var o=0;o<t.length;o++){var i=Object(c.a)(t[o]);e[o]=mc(r),e.push(mc(i.length)),e.push(vc(i)),r+=32+32*Math.ceil(i.length/32)}return Object(c.c)(e)}var gc=function(){return Js((function t(e,r,n,o){Qs(this,t),I(this,"provider",e),I(this,"name",n),I(this,"address",e.formatter.address(r)),I(this,"_resolvedAddress",o)}),[{key:"supportsWildcard",value:function(){var t=this;return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((function(t){return w.from(t).eq(1)})).catch((function(e){if(e.code===h.b.errors.CALL_EXCEPTION)return!1;throw t._supportsEip2544=null,e}))),this._supportsEip2544}},{key:"_fetch",value:function(t,e){return Xs(this,void 0,void 0,Ws().mark((function r(){var n,o,i;return Ws().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={to:this.address,ccipReadEnabled:!0,data:Object(c.c)([t,ys(this.name),e||"0x"])},o=!1,r.next=4,this.supportsWildcard();case 4:if(!r.sent){r.next=7;break}o=!0,n.data=Object(c.c)(["0x9061b923",yc([gs(this.name),n.data])]);case 7:return r.prev=7,r.next=10,this.provider.call(n);case 10:return i=r.sent,Object(c.a)(i).length%32==4&&$s.throwError("resolver threw error",h.b.errors.CALL_EXCEPTION,{transaction:n,data:i}),o&&(i=pc(i,0)),r.abrupt("return",i);case 16:if(r.prev=16,r.t0=r.catch(7),r.t0.code!==h.b.errors.CALL_EXCEPTION){r.next=20;break}return r.abrupt("return",null);case 20:throw r.t0;case 21:case"end":return r.stop()}}),r,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(t,e){return Xs(this,void 0,void 0,Ws().mark((function r(){var n;return Ws().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._fetch(t,e);case 2:if(null==(n=r.sent)){r.next=5;break}return r.abrupt("return",pc(n,0));case 5:return r.abrupt("return",null);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_getAddress",value:function(t,e){var r=uc[String(t)];if(null==r&&$s.throwError("unsupported coin type: ".concat(t),h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(t,")")}),"eth"===r.ilk)return this.provider.formatter.address(e);var n=Object(c.a)(e);if(null!=r.p2pkh){var o=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){var i=parseInt(o[1],16);if(o[2].length===2*i&&i>=1&&i<=75)return cc(Object(c.b)([[r.p2pkh],"0x"+o[2]]))}}if(null!=r.p2sh){var a=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){var u=parseInt(a[1],16);if(a[2].length===2*u&&u>=1&&u<=75)return cc(Object(c.b)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var s=n[1],l=n[0];if(0===l?20!==s&&32!==s&&(l=-1):l=-1,l>=0&&n.length===2+s&&s>=1&&s<=75){var f=Rs.a.toWords(n.slice(2));return f.unshift(l),Rs.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n,o;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t&&(t=60),60!==t){e.next=16;break}return e.prev=2,e.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(r=e.sent)&&r!==Tu){e.next=8;break}return e.abrupt("return",null);case 8:return e.abrupt("return",this.provider.formatter.callAddress(r));case 11:if(e.prev=11,e.t0=e.catch(2),e.t0.code!==h.b.errors.CALL_EXCEPTION){e.next=15;break}return e.abrupt("return",null);case 15:throw e.t0;case 16:return e.next=18,this._fetchBytes("0xf1cb7e06",sc(t));case 18:if(null!=(n=e.sent)&&"0x"!==n){e.next=21;break}return e.abrupt("return",null);case 21:return null==(o=this._getAddress(t,n))&&$s.throwError("invalid or unsupported coin data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(t,")"),coinType:t,data:n}),e.abrupt("return",o);case 24:case"end":return e.stop()}}),e,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return Xs(this,void 0,void 0,Ws().mark((function t(){var e,r,n,o,i,a,u,s,l,f,h,p,d,m,v,y;return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[{type:"name",content:this.name}],t.prev=1,t.next=4,this.getText("avatar");case 4:if(null!=(r=t.sent)){t.next=7;break}return t.abrupt("return",null);case 7:n=0;case 8:if(!(n<fc.length)){t.next=91;break}if(null!=(o=r.match(fc[n]))){t.next=12;break}return t.abrupt("continue",88);case 12:i=o[1].toLowerCase(),t.t0=i,t.next="https"===t.t0?16:"data"===t.t0?18:"ipfs"===t.t0?20:"erc721"===t.t0||"erc1155"===t.t0?22:88;break;case 16:return e.push({type:"url",content:r}),t.abrupt("return",{linkage:e,url:r});case 18:return e.push({type:"data",content:r}),t.abrupt("return",{linkage:e,url:r});case 20:return e.push({type:"ipfs",content:r}),t.abrupt("return",{linkage:e,url:dc(r)});case 22:if(a="erc721"===i?"0xc87b56dd":"0x0e89341c",e.push({type:i,content:r}),t.t1=this._resolvedAddress,t.t1){t.next=29;break}return t.next=28,this.getAddress();case 28:t.t1=t.sent;case 29:if(u=t.t1,2===(s=(o[2]||"").split("/")).length){t.next=33;break}return t.abrupt("return",null);case 33:return t.next=35,this.provider.formatter.address(s[0]);case 35:if(l=t.sent,f=Object(c.h)(w.from(s[1]).toHexString(),32),"erc721"!==i){t.next=48;break}return t.t2=this.provider.formatter,t.next=41,this.provider.call({to:l,data:Object(c.c)(["0x6352211e",f])});case 41:if(t.t3=t.sent,h=t.t2.callAddress.call(t.t2,t.t3),u===h){t.next=45;break}return t.abrupt("return",null);case 45:e.push({type:"owner",content:h}),t.next=57;break;case 48:if("erc1155"!==i){t.next=57;break}return t.t4=w,t.next=52,this.provider.call({to:l,data:Object(c.c)(["0x00fdd58e",Object(c.h)(u,32),f])});case 52:if(t.t5=t.sent,!(p=t.t4.from.call(t.t4,t.t5)).isZero()){t.next=56;break}return t.abrupt("return",null);case 56:e.push({type:"balance",content:p.toString()});case 57:return d={to:this.provider.formatter.address(s[0]),data:Object(c.c)([a,f])},t.t6=hc,t.next=61,this.provider.call(d);case 61:if(t.t7=t.sent,null!=(m=(0,t.t6)(t.t7,0))){t.next=65;break}return t.abrupt("return",null);case 65:return e.push({type:"metadata-url-base",content:m}),"erc1155"===i&&(m=m.replace("{id}",f.substring(2)),e.push({type:"metadata-url-expanded",content:m})),m.match(/^ipfs:/i)&&(m=dc(m)),e.push({type:"metadata-url",content:m}),t.next=71,Ts(m);case 71:if(v=t.sent){t.next=74;break}return t.abrupt("return",null);case 74:if(e.push({type:"metadata",content:JSON.stringify(v)}),"string"==typeof(y=v.image)){t.next=78;break}return t.abrupt("return",null);case 78:if(!y.match(/^(https:\/\/|data:)/i)){t.next=81;break}t.next=86;break;case 81:if(null!=y.match(lc)){t.next=84;break}return t.abrupt("return",null);case 84:e.push({type:"url-ipfs",content:y}),y=dc(y);case 86:return e.push({type:"url",content:y}),t.abrupt("return",{linkage:e,url:y});case 88:n++,t.next=8;break;case 91:t.next=95;break;case 93:t.prev=93,t.t8=t.catch(1);case 95:return t.abrupt("return",null);case 96:case"end":return t.stop()}}),t,this,[[1,93]])})))}},{key:"getContentHash",value:function(){return Xs(this,void 0,void 0,Ws().mark((function t(){var e,r,n,o,i,a,u,s,c;return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(e=t.sent)&&"0x"!==e){t.next=5;break}return t.abrupt("return",null);case 5:if(!(r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){t.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){t.next=10;break}return t.abrupt("return","ipfs://"+Gi.encode("0x"+r[1]));case 10:if(!(o=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){t.next=15;break}if(i=parseInt(o[3],16),o[4].length!==2*i){t.next=15;break}return t.abrupt("return","ipns://"+Gi.encode("0x"+o[1]));case 15:if(!(a=e.match(/^0xe40101fa011b20([0-9a-f]*)$/))){t.next=19;break}if(64!==a[1].length){t.next=19;break}return t.abrupt("return","bzz://"+a[1]);case 19:if(!(u=e.match(/^0x90b2c605([0-9a-f]*)$/))){t.next=25;break}if(68!==u[1].length){t.next=25;break}return s={"=":"","+":"-","/":"_"},c=zu("0x"+u[1]).replace(/[=+\/]/g,(function(t){return s[t]})),t.abrupt("return","sia://"+c);case 25:return t.abrupt("return",$s.throwError("invalid or unsupported content hash data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e}));case 26:case"end":return t.stop()}}),t,this)})))}},{key:"getText",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ot(t),(r=Object(c.b)([sc(64),sc(r.length),r])).length%32!=0&&(r=Object(c.b)([r,Object(c.h)("0x",32-t.length%32)])),e.next=5,this._fetchBytes("0x59d1d43c",Object(c.i)(r));case 5:if(null!=(n=e.sent)&&"0x"!==n){e.next=8;break}return e.abrupt("return",null);case 8:return e.abrupt("return",Tt(n));case 9:case"end":return e.stop()}}),e,this)})))}}])}(),bc=null,wc=1,_c=function(t){function e(t){var r;if(Qs(this,e),(r=Hs(this,e))._events=[],r._emitted={block:-2},r.disableCcipRead=!1,r.formatter=(this instanceof e?this.constructor:void 0).getFormatter(),I(r,"anyNetwork","any"===t),r.anyNetwork&&(t=r.detectNetwork()),t instanceof Promise)r._networkPromise=t,t.catch((function(t){})),r._ready().catch((function(t){}));else{var n=R(this instanceof e?this.constructor:void 0,"getNetwork")(t);n?(I(r,"_network",n),r.emit("network",n,null)):$s.throwArgumentError("invalid network","network",t)}return r._maxInternalBlockNumber=-1024,r._lastBlockNumber=-2,r._maxFilterBlockRange=10,r._pollingInterval=4e3,r._fastQueryDate=0,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ks(t,e)}(e,t),Js(e,[{key:"_ready",value:function(){return Xs(this,void 0,void 0,Ws().mark((function t(){var e;return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=this._network){t.next=17;break}if(e=null,!this._networkPromise){t.next=11;break}return t.prev=3,t.next=6,this._networkPromise;case 6:e=t.sent,t.next=11;break;case 9:t.prev=9,t.t0=t.catch(3);case 11:if(null!=e){t.next=15;break}return t.next=14,this.detectNetwork();case 14:e=t.sent;case 15:e||$s.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:I(this,"_network",e),this.emit("network",e,null));case 17:return t.abrupt("return",this._network);case 18:case"end":return t.stop()}}),t,this,[[3,9]])})))}},{key:"ready",get:function(){var t=this;return Ns((function(){return t._ready().then((function(t){return t}),(function(t){if(t.code!==h.b.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))}))}},{key:"ccipReadFetch",value:function(t,e,r){return Xs(this,void 0,void 0,Ws().mark((function n(){var o,i,a,u,s,c,l,f,p;return Ws().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.disableCcipRead&&0!==r.length){n.next=2;break}return n.abrupt("return",null);case 2:o=t.to.toLowerCase(),i=e.toLowerCase(),a=[],u=0;case 6:if(!(u<r.length)){n.next=22;break}return s=r[u],c=s.replace("{sender}",o).replace("{data}",i),l=s.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:o}),n.next=12,Ts({url:c,errorPassThrough:!0},l,(function(t,e){return t.status=e.statusCode,t}));case 12:if(!(f=n.sent).data){n.next=15;break}return n.abrupt("return",f.data);case 15:if(p=f.message||"unknown error",!(f.status>=400&&f.status<500)){n.next=18;break}return n.abrupt("return",$s.throwError("response not found during CCIP fetch: ".concat(p),h.b.errors.SERVER_ERROR,{url:s,errorMessage:p}));case 18:a.push(p);case 19:u++,n.next=6;break;case 22:return n.abrupt("return",$s.throwError("error encountered during CCIP fetch: ".concat(a.map((function(t){return JSON.stringify(t)})).join(", ")),h.b.errors.SERVER_ERROR,{urls:r,errorMessages:a}));case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n,o,i,a=this;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:if(!(t>0)){e.next=20;break}case 3:if(!this._internalBlockNumber){e.next=20;break}return r=this._internalBlockNumber,e.prev=5,e.next=8,r;case 8:if(n=e.sent,!(nc()-n.respTime<=t)){e.next=11;break}return e.abrupt("return",n.blockNumber);case 11:return e.abrupt("break",20);case 14:if(e.prev=14,e.t0=e.catch(5),this._internalBlockNumber!==r){e.next=18;break}return e.abrupt("break",20);case 18:e.next=3;break;case 20:return o=nc(),i=L({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(t){return null}),(function(t){return t}))}).then((function(t){var e=t.blockNumber,r=t.networkError;if(r)throw a._internalBlockNumber===i&&(a._internalBlockNumber=null),r;var n=nc();return(e=w.from(e).toNumber())<a._maxInternalBlockNumber&&(e=a._maxInternalBlockNumber),a._maxInternalBlockNumber=e,a._setFastBlockNumber(e),{blockNumber:e,reqTime:o,respTime:n}})),this._internalBlockNumber=i,i.catch((function(t){a._internalBlockNumber===i&&(a._internalBlockNumber=null)})),e.next=26,i;case 26:return e.abrupt("return",e.sent.blockNumber);case 27:case"end":return e.stop()}}),e,this,[[5,14]])})))}},{key:"poll",value:function(){return Xs(this,void 0,void 0,Ws().mark((function t(){var e,r,n,o,i=this;return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=wc++,r=[],n=null,t.prev=3,t.next=6,this._getInternalBlockNumber(100+this.pollingInterval/2);case 6:n=t.sent,t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(3),this.emit("error",t.t0),t.abrupt("return");case 13:if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){t.next=18;break}return this.emit("didPoll",e),t.abrupt("return");case 18:if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)$s.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",$s.makeError("network block skew detected",h.b.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(o=this._emitted.block+1;o<=n;o++)this.emit("block",o);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(t){if("block"!==t){var e=i._emitted[t];"pending"!==e&&n-e>12&&delete i._emitted[t]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(t){switch(t.type){case"tx":var e=t.hash,o=i.getTransactionReceipt(e).then((function(t){return t&&null!=t.blockNumber?(i._emitted["t:"+e]=t.blockNumber,i.emit(e,t),null):null})).catch((function(t){i.emit("error",t)}));r.push(o);break;case"filter":if(!t._inflight){t._inflight=!0,-2===t._lastBlockNumber&&(t._lastBlockNumber=n-1);var a=t.filter;a.fromBlock=t._lastBlockNumber+1,a.toBlock=n;var u=a.toBlock-i._maxFilterBlockRange;u>a.fromBlock&&(a.fromBlock=u),a.fromBlock<0&&(a.fromBlock=0);var s=i.getLogs(a).then((function(e){t._inflight=!1,0!==e.length&&e.forEach((function(e){e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),i._emitted["b:"+e.blockHash]=e.blockNumber,i._emitted["t:"+e.transactionHash]=e.blockNumber,i.emit(a,e)}))})).catch((function(e){i.emit("error",e),t._inflight=!1}));r.push(s)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){i.emit("didPoll",e)})).catch((function(t){i.emit("error",t)})),t.abrupt("return");case 26:case"end":return t.stop()}}),t,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return Xs(this,void 0,void 0,Ws().mark((function t(){return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",$s.throwError("provider does not support network detection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return t.stop()}}),t)})))}},{key:"getNetwork",value:function(){return Xs(this,void 0,void 0,Ws().mark((function t(){var e,r,n;return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:return e=t.sent,t.next=5,this.detectNetwork();case 5:if(r=t.sent,e.chainId===r.chainId){t.next=23;break}if(!this.anyNetwork){t.next=20;break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),t.next=19,oc(0);case 19:return t.abrupt("return",this._network);case 20:throw n=$s.makeError("underlying network changed",h.b.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r}),this.emit("error",n),n;case 23:return t.abrupt("return",e);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"blockNumber",get:function(){var t=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(e){t._setFastBlockNumber(e)}),(function(t){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(t){var e=this;t&&!this._poller?(this._poller=setInterval((function(){e.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){e.poll(),e._bootstrapPoll=setTimeout((function(){e._poller||e.poll(),e._bootstrapPoll=null}),e.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(t){var e=this;if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){e.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var t=this,e=nc();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=nc(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}},{key:"waitForTransaction",value:function(t,e,r){return Xs(this,void 0,void 0,Ws().mark((function n(){return Ws().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(t,null==e?1:e,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(t,e,r,n){return Xs(this,void 0,void 0,Ws().mark((function o(){var i,a=this;return Ws().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getTransactionReceipt(t);case 2:if(!(((i=o.sent)?i.confirmations:0)>=e)){o.next=5;break}return o.abrupt("return",i);case 5:return o.abrupt("return",new Promise((function(o,i){var u=[],s=!1,c=function(){return!!s||(s=!0,u.forEach((function(t){t()})),!1)},l=function(t){t.confirmations<e||c()||o(t)};if(a.on(t,l),u.push((function(){a.removeListener(t,l)})),n){var f=n.startBlock,p=null,d=function r(o){return Xs(a,void 0,void 0,Ws().mark((function a(){var u=this;return Ws().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!s){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,oc(1e3);case 4:this.getTransactionCount(n.from).then((function(a){return Xs(u,void 0,void 0,Ws().mark((function u(){var l,d,m,v,y,g;return Ws().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(!s){u.next=2;break}return u.abrupt("return");case 2:if(!(a<=n.nonce)){u.next=6;break}f=o,u.next=41;break;case 6:return u.next=8,this.getTransaction(t);case 8:if(!(l=u.sent)||null==l.blockNumber){u.next=11;break}return u.abrupt("return");case 11:null==p&&(p=f-3)<n.startBlock&&(p=n.startBlock);case 12:if(!(p<=o)){u.next=41;break}if(!s){u.next=15;break}return u.abrupt("return");case 15:return u.next=17,this.getBlockWithTransactions(p);case 17:d=u.sent,m=0;case 19:if(!(m<d.transactions.length)){u.next=38;break}if((v=d.transactions[m]).hash!==t){u.next=23;break}return u.abrupt("return");case 23:if(v.from!==n.from||v.nonce!==n.nonce){u.next=35;break}if(!s){u.next=26;break}return u.abrupt("return");case 26:return u.next=28,this.waitForTransaction(v.hash,e);case 28:if(y=u.sent,!c()){u.next=31;break}return u.abrupt("return");case 31:return g="replaced",v.data===n.data&&v.to===n.to&&v.value.eq(n.value)?g="repriced":"0x"===v.data&&v.from===v.to&&v.value.isZero()&&(g="cancelled"),i($s.makeError("transaction was replaced",h.b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===g||"cancelled"===g,reason:g,replacement:this._wrapTransaction(v),hash:t,receipt:y})),u.abrupt("return");case 35:m++,u.next=19;break;case 38:p++,u.next=12;break;case 41:if(!s){u.next=43;break}return u.abrupt("return");case 43:this.once("block",r);case 44:case"end":return u.stop()}}),u,this)})))}),(function(t){s||u.once("block",r)}));case 5:case"end":return a.stop()}}),a,this)})))};if(s)return;a.once("block",d),u.push((function(){a.removeListener("block",d)}))}if("number"==typeof r&&r>0){var m=setTimeout((function(){c()||i($s.makeError("timeout exceeded",h.b.errors.TIMEOUT,{timeout:r}))}),r);m.unref&&m.unref(),u.push((function(){clearTimeout(m)}))}})));case 6:case"end":return o.stop()}}),o,this)})))}},{key:"getBlockNumber",value:function(){return Xs(this,void 0,void 0,Ws().mark((function t(){return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"getGasPrice",value:function(){return Xs(this,void 0,void 0,Ws().mark((function t(){var e;return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,this.perform("getGasPrice",{});case 4:return e=t.sent,t.prev=5,t.abrupt("return",w.from(e));case 9:return t.prev=9,t.t0=t.catch(5),t.abrupt("return",$s.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t.t0}));case 12:case"end":return t.stop()}}),t,this,[[5,9]])})))}},{key:"getBalance",value:function(t,e){return Xs(this,void 0,void 0,Ws().mark((function r(){var n,o;return Ws().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,L({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return o=r.sent,r.prev=8,r.abrupt("return",w.from(o));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",$s.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getBalance",params:n,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(t,e){return Xs(this,void 0,void 0,Ws().mark((function r(){var n,o;return Ws().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,L({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return o=r.sent,r.prev=8,r.abrupt("return",w.from(o).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",$s.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(t,e){return Xs(this,void 0,void 0,Ws().mark((function r(){var n,o;return Ws().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,L({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return o=r.sent,r.prev=8,r.abrupt("return",Object(c.i)(o));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",$s.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getCode",params:n,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(t,e,r){return Xs(this,void 0,void 0,Ws().mark((function n(){var o,i;return Ws().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,L({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((function(t){return Object(c.g)(t)}))});case 4:return o=n.sent,n.next=7,this.perform("getStorageAt",o);case 7:return i=n.sent,n.prev=8,n.abrupt("return",Object(c.i)(i));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",$s.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getStorageAt",params:o,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(t,e,r){var n=this;if(null!=e&&32!==Object(c.d)(e))throw new Error("invalid response - sendTransaction");var o=t;return null!=e&&t.hash!==e&&$s.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.b.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),o.wait=function(e,o){return Xs(n,void 0,void 0,Ws().mark((function n(){var i,a;return Ws().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==e&&(e=1),null==o&&(o=0),i=void 0,0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r}),n.next=6,this._waitForTransaction(t.hash,e,o,i);case 6:if(null!=(a=n.sent)||0!==e){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+t.hash]=a.blockNumber,0===a.status&&$s.throwError("transaction failed",h.b.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:a}),n.abrupt("return",a);case 12:case"end":return n.stop()}}),n,this)})))},o}},{key:"sendTransaction",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n,o,i;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,Promise.resolve(t).then((function(t){return Object(c.i)(t)}));case 4:return r=e.sent,null==(n=this.formatter.transaction(t)).confirmations&&(n.confirmations=0),e.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return o=e.sent,e.prev=10,e.next=13,this.perform("sendTransaction",{signedTransaction:r});case 13:return i=e.sent,e.abrupt("return",this._wrapTransaction(n,i,o));case 17:throw e.prev=17,e.t0=e.catch(10),e.t0.transaction=n,e.t0.transactionHash=n.hash,e.t0;case 22:case"end":return e.stop()}}),e,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n,o=this;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return r=e.sent,n={},["from","to"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?o._getAddress(t):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?w.from(t):null})))})),["type"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return null!=t?t:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?Object(c.i)(t):null})))})),e.t0=this.formatter,e.next=12,L(n);case 12:return e.t1=e.sent,e.abrupt("return",e.t0.transactionRequest.call(e.t0,e.t1));case 14:case"end":return e.stop()}}),e,this)})))}},{key:"_getFilter",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n=this;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,r={},null!=t.address&&(r.address=this._getAddress(t.address)),["blockHash","topics"].forEach((function(e){null!=t[e]&&(r[e]=t[e])})),["fromBlock","toBlock"].forEach((function(e){null!=t[e]&&(r[e]=n._getBlockTag(t[e]))})),e.t0=this.formatter,e.next=10,L(r);case 10:return e.t1=e.sent,e.abrupt("return",e.t0.filter.call(e.t0,e.t1));case 12:case"end":return e.stop()}}),e,this)})))}},{key:"_call",value:function(t,e,r){return Xs(this,void 0,void 0,Ws().mark((function n(){var o,i,a,u,s,l,f,p,d,m,v,y,g,b,_;return Ws().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&$s.throwError("CCIP read exceeded maximum redirections",h.b.errors.SERVER_ERROR,{redirects:r,transaction:t}),o=t.to,n.next=4,this.perform("call",{transaction:t,blockTag:e});case 4:if(i=n.sent,!(r>=0&&"latest"===e&&null!=o&&"0x556f1830"===i.substring(0,10)&&Object(c.d)(i)%32==4)){n.next=31;break}for(n.prev=6,a=Object(c.e)(i,4),u=Object(c.e)(a,0,32),w.from(u).eq(o)||$s.throwError("CCIP Read sender did not match",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),s=[],l=w.from(Object(c.e)(a,32,64)).toNumber(),f=w.from(Object(c.e)(a,l,l+32)).toNumber(),p=Object(c.e)(a,l+32),d=0;d<f;d++)null==(m=hc(p,32*d))&&$s.throwError("CCIP Read contained corrupt URL string",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),s.push(m);return v=pc(a,64),w.from(Object(c.e)(a,100,128)).isZero()||$s.throwError("CCIP Read callback selector included junk",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),y=Object(c.e)(a,96,100),g=pc(a,128),n.next=21,this.ccipReadFetch(t,v,s);case 21:return null==(b=n.sent)&&$s.throwError("CCIP Read disabled or provided no URLs",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),_={to:o,data:Object(c.c)([y,yc([b,g])])},n.abrupt("return",this._call(_,e,r+1));case 27:if(n.prev=27,n.t0=n.catch(6),n.t0.code!==h.b.errors.SERVER_ERROR){n.next=31;break}throw n.t0;case 31:return n.prev=31,n.abrupt("return",Object(c.i)(i));case 35:return n.prev=35,n.t1=n.catch(31),n.abrupt("return",$s.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:n.t1}));case 38:case"end":return n.stop()}}),n,this,[[6,27],[31,35]])})))}},{key:"call",value:function(t,e){return Xs(this,void 0,void 0,Ws().mark((function r(){var n;return Ws().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,L({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});case 4:return n=r.sent,r.abrupt("return",this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1));case 6:case"end":return r.stop()}}),r,this)})))}},{key:"estimateGas",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,L({transaction:this._getTransactionRequest(t)});case 4:return r=e.sent,e.next=7,this.perform("estimateGas",r);case 7:return n=e.sent,e.prev=8,e.abrupt("return",w.from(n));case 12:return e.prev=12,e.t0=e.catch(8),e.abrupt("return",$s.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:e.t0}));case 15:case"end":return e.stop()}}),e,this,[[8,12]])})))}},{key:"_getAddress",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return"string"!=typeof(t=e.sent)&&$s.throwArgumentError("invalid address or ENS name","name",t),e.next=6,this.resolveName(t);case 6:return null==(r=e.sent)&&$s.throwError("ENS name not configured",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(t),")")}),e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"_getBlock",value:function(t,e){return Xs(this,void 0,void 0,Ws().mark((function r(){var n,o,i=this;return Ws().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,t;case 4:if(t=r.sent,n=-128,o={includeTransactions:!!e},!Object(c.l)(t,32)){r.next=11;break}o.blockHash=t,r.next=21;break;case 11:return r.prev=11,r.next=14,this._getBlockTag(t);case 14:o.blockTag=r.sent,Object(c.l)(o.blockTag)&&(n=parseInt(o.blockTag.substring(2),16)),r.next=21;break;case 18:r.prev=18,r.t0=r.catch(11),$s.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t);case 21:return r.abrupt("return",Ns((function(){return Xs(i,void 0,void 0,Ws().mark((function t(){var r,i,a,u,s,c,l=this;return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getBlock",o);case 2:if(null!=(r=t.sent)){t.next=11;break}if(null==o.blockHash){t.next=7;break}if(null!=this._emitted["b:"+o.blockHash]){t.next=7;break}return t.abrupt("return",null);case 7:if(null==o.blockTag){t.next=10;break}if(!(n>this._emitted.block)){t.next=10;break}return t.abrupt("return",null);case 10:return t.abrupt("return",void 0);case 11:if(!e){t.next=34;break}i=null,a=0;case 14:if(!(a<r.transactions.length)){t.next=31;break}if(null!=(u=r.transactions[a]).blockNumber){t.next=20;break}u.confirmations=0,t.next=28;break;case 20:if(null!=u.confirmations){t.next=28;break}if(null!=i){t.next=25;break}return t.next=24,this._getInternalBlockNumber(100+2*this.pollingInterval);case 24:i=t.sent;case 25:(s=i-u.blockNumber+1)<=0&&(s=1),u.confirmations=s;case 28:a++,t.next=14;break;case 31:return(c=this.formatter.blockWithTransactions(r)).transactions=c.transactions.map((function(t){return l._wrapTransaction(t)})),t.abrupt("return",c);case 34:return t.abrupt("return",this.formatter.block(r));case 35:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 22:case"end":return r.stop()}}),r,this,[[11,18]])})))}},{key:"getBlock",value:function(t){return this._getBlock(t,!1)}},{key:"getBlockWithTransactions",value:function(t){return this._getBlock(t,!0)}},{key:"getTransaction",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n=this;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,t;case 4:return t=e.sent,r={transactionHash:this.formatter.hash(t,!0)},e.abrupt("return",Ns((function(){return Xs(n,void 0,void 0,Ws().mark((function e(){var n,o,i,a;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getTransaction",r);case 2:if(null!=(n=e.sent)){e.next=7;break}if(null!=this._emitted["t:"+t]){e.next=6;break}return e.abrupt("return",null);case 6:return e.abrupt("return",void 0);case 7:if(null!=(o=this.formatter.transactionResponse(n)).blockNumber){e.next=12;break}o.confirmations=0,e.next=19;break;case 12:if(null!=o.confirmations){e.next=19;break}return e.next=15,this._getInternalBlockNumber(100+2*this.pollingInterval);case 15:i=e.sent,(a=i-o.blockNumber+1)<=0&&(a=1),o.confirmations=a;case 19:return e.abrupt("return",this._wrapTransaction(o));case 20:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionReceipt",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n=this;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,t;case 4:return t=e.sent,r={transactionHash:this.formatter.hash(t,!0)},e.abrupt("return",Ns((function(){return Xs(n,void 0,void 0,Ws().mark((function e(){var n,o,i,a;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getTransactionReceipt",r);case 2:if(null!=(n=e.sent)){e.next=7;break}if(null!=this._emitted["t:"+t]){e.next=6;break}return e.abrupt("return",null);case 6:return e.abrupt("return",void 0);case 7:if(null!=n.blockHash){e.next=9;break}return e.abrupt("return",void 0);case 9:if(null!=(o=this.formatter.receipt(n)).blockNumber){e.next=14;break}o.confirmations=0,e.next=21;break;case 14:if(null!=o.confirmations){e.next=21;break}return e.next=17,this._getInternalBlockNumber(100+2*this.pollingInterval);case 17:i=e.sent,(a=i-o.blockNumber+1)<=0&&(a=1),o.confirmations=a;case 21:return e.abrupt("return",o);case 22:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getLogs",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,L({filter:this._getFilter(t)});case 4:return r=e.sent,e.next=7,this.perform("getLogs",r);case 7:return(n=e.sent).forEach((function(t){null==t.removed&&(t.removed=!1)})),e.abrupt("return",Fs.arrayOf(this.formatter.filterLog.bind(this.formatter))(n));case 10:case"end":return e.stop()}}),e,this)})))}},{key:"getEtherPrice",value:function(){return Xs(this,void 0,void 0,Ws().mark((function t(){return Ws().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.abrupt("return",this.perform("getEtherPrice",{}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlockTag",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(!("number"==typeof(t=e.sent)&&t<0)){e.next=11;break}return t%1&&$s.throwArgumentError("invalid BlockTag","blockTag",t),e.next=7,this._getInternalBlockNumber(100+2*this.pollingInterval);case 7:return r=e.sent,(r+=t)<0&&(r=0),e.abrupt("return",this.formatter.blockTag(r));case 11:return e.abrupt("return",this.formatter.blockTag(t));case 12:case"end":return e.stop()}}),e,this)})))}},{key:"getResolver",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n,o;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t;case 1:if(""!==r&&"."!==r){e.next=4;break}return e.abrupt("return",null);case 4:if("eth"===t||"eth"!==r){e.next=6;break}return e.abrupt("return",null);case 6:return e.next=8,this._getResolver(r,"getResolver");case 8:if(null==(n=e.sent)){e.next=19;break}if(o=new gc(this,n,t),e.t0=r!==t,!e.t0){e.next=16;break}return e.next=15,o.supportsWildcard();case 15:e.t0=!e.sent;case 16:if(!e.t0){e.next=18;break}return e.abrupt("return",null);case 18:return e.abrupt("return",o);case 19:r=r.split(".").slice(1).join("."),e.next=1;break;case 22:case"end":return e.stop()}}),e,this)})))}},{key:"_getResolver",value:function(t,e){return Xs(this,void 0,void 0,Ws().mark((function r(){var n,o;return Ws().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e&&(e="ENS"),r.next=3,this.getNetwork();case 3:return(n=r.sent).ensAddress||$s.throwError("network does not support ENS",h.b.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name}),r.prev=5,r.next=8,this.call({to:n.ensAddress,data:"0x0178b8bf"+ys(t).substring(2)});case 8:return o=r.sent,r.abrupt("return",this.formatter.callAddress(o));case 12:r.prev=12,r.t0=r.catch(5);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r,this,[[5,12]])})))}},{key:"resolveName",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,e.prev=3,e.abrupt("return",Promise.resolve(this.formatter.address(t)));case 7:if(e.prev=7,e.t0=e.catch(3),!Object(c.l)(t)){e.next=11;break}throw e.t0;case 11:return"string"!=typeof t&&$s.throwArgumentError("invalid ENS name","name",t),e.next=14,this.getResolver(t);case 14:if(r=e.sent){e.next=17;break}return e.abrupt("return",null);case 17:return e.next=19,r.getAddress();case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e,this,[[3,7]])})))}},{key:"lookupAddress",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n,o;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,t=this.formatter.address(t),r=t.substring(2).toLowerCase()+".addr.reverse",e.next=7,this._getResolver(r,"lookupAddress");case 7:if(null!=(n=e.sent)){e.next=10;break}return e.abrupt("return",null);case 10:return e.t0=hc,e.next=13,this.call({to:n,data:"0x691f3431"+ys(r).substring(2)});case 13:return e.t1=e.sent,o=(0,e.t0)(e.t1,0),e.next=17,this.resolveName(o);case 17:if(e.sent==t){e.next=20;break}return e.abrupt("return",null);case 20:return e.abrupt("return",o);case 21:case"end":return e.stop()}}),e,this)})))}},{key:"getAvatar",value:function(t){return Xs(this,void 0,void 0,Ws().mark((function e(){var r,n,o,i,a,u,s;return Ws().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,!Object(c.l)(t)){e.next=40;break}return n=this.formatter.address(t),o=n.substring(2).toLowerCase()+".addr.reverse",e.next=6,this._getResolver(o,"getAvatar");case 6:if(i=e.sent){e.next=9;break}return e.abrupt("return",null);case 9:return r=new gc(this,i,o),e.prev=10,e.next=13,r.getAvatar();case 13:if(!(a=e.sent)){e.next=16;break}return e.abrupt("return",a.url);case 16:e.next=22;break;case 18:if(e.prev=18,e.t0=e.catch(10),e.t0.code===h.b.errors.CALL_EXCEPTION){e.next=22;break}throw e.t0;case 22:return e.prev=22,e.t1=hc,e.next=26,this.call({to:i,data:"0x691f3431"+ys(o).substring(2)});case 26:return e.t2=e.sent,u=(0,e.t1)(e.t2,0),e.next=30,this.getResolver(u);case 30:r=e.sent,e.next=38;break;case 33:if(e.prev=33,e.t3=e.catch(22),e.t3.code===h.b.errors.CALL_EXCEPTION){e.next=37;break}throw e.t3;case 37:return e.abrupt("return",null);case 38:e.next=45;break;case 40:return e.next=42,this.getResolver(t);case 42:if(r=e.sent){e.next=45;break}return e.abrupt("return",null);case 45:return e.next=47,r.getAvatar();case 47:if(null!=(s=e.sent)){e.next=50;break}return e.abrupt("return",null);case 50:return e.abrupt("return",s.url);case 51:case"end":return e.stop()}}),e,this,[[10,18],[22,33]])})))}},{key:"perform",value:function(t,e){return $s.throwError(t+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:t})}},{key:"_startEvent",value:function(t){this.polling=this._events.filter((function(t){return t.pollable()})).length>0}},{key:"_stopEvent",value:function(t){this.polling=this._events.filter((function(t){return t.pollable()})).length>0}},{key:"_addEventListener",value:function(t,e,r){var n=new ac(rc(t),e,r);return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(t,e){return this._addEventListener(t,e,!1)}},{key:"once",value:function(t,e){return this._addEventListener(t,e,!0)}},{key:"emit",value:function(t){for(var e=this,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=!1,a=[],u=rc(t);return this._events=this._events.filter((function(t){return t.tag!==u||(setTimeout((function(){t.listener.apply(e,n)}),0),i=!0,!t.once||(a.push(t),!1))})),a.forEach((function(t){e._stopEvent(t)})),i}},{key:"listenerCount",value:function(t){if(!t)return this._events.length;var e=rc(t);return this._events.filter((function(t){return t.tag===e})).length}},{key:"listeners",value:function(t){if(null==t)return this._events.map((function(t){return t.listener}));var e=rc(t);return this._events.filter((function(t){return t.tag===e})).map((function(t){return t.listener}))}},{key:"off",value:function(t,e){var r=this;if(null==e)return this.removeAllListeners(t);var n=[],o=!1,i=rc(t);return this._events=this._events.filter((function(t){return t.tag!==i||t.listener!=e||(!!o||(o=!0,n.push(t),!1))})),n.forEach((function(t){r._stopEvent(t)})),this}},{key:"removeAllListeners",value:function(t){var e=this,r=[];if(null==t)r=this._events,this._events=[];else{var n=rc(t);this._events=this._events.filter((function(t){return t.tag!==n||(r.push(t),!1)}))}return r.forEach((function(t){e._stopEvent(t)})),this}}],[{key:"getFormatter",value:function(){return null==bc&&(bc=new Fs),bc}},{key:"getNetwork",value:function(t){return Du(null==t?"homestead":t)}}])}(Nn);function kc(){return(kc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Ec(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function Ec(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Tc(t)););return t}function xc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */xc=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==Rc(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Rc(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ac(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Pc(n.key),n)}}function Sc(t,e,r){return e&&Oc(t.prototype,e),r&&Oc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pc(t){var e=function(t,e){if("object"!=Rc(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Rc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Rc(e)?e:e+""}function jc(t,e,r){return e=Tc(e),function(t,e){if(e&&("object"==Rc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Tc(t).constructor):e.apply(t,r))}function Tc(t){return(Tc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Nc(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ic(t,e)}function Ic(t,e){return(Ic=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Rc(t){return(Rc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Lc=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Cc=new h.b("providers/5.7.2"),Mc=["call","estimateGas"];function Bc(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){var r=Object(c.l)(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"===Rc(t)){for(var n in t){var o=Bc(t[n],e);if(o)return o}return null}if("string"==typeof t)try{return Bc(JSON.parse(t),e)}catch(t){}return null}function Fc(t,e,r){var n=r.transaction||r.signedTransaction;if("call"===t){var o=Bc(e,!0);if(o)return o.data;Cc.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){var i=Bc(e.body,!1);null==i&&(i=Bc(e,!1)),i&&Cc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:i.message,method:t,transaction:n,error:e})}var a=e.message;throw e.code===h.b.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?a=e.error.message:"string"==typeof e.body?a=e.body:"string"==typeof e.responseText&&(a=e.responseText),(a=(a||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Cc.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),a.match(/nonce (is )?too low/i)&&Cc.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Cc.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),a.match(/only replay-protected/i)&&Cc.throwError("legacy pre-eip-155 transactions not supported",h.b.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),Mc.indexOf(t)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Cc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Dc(t){return new Promise((function(e){setTimeout(e,t)}))}function Uc(t){if(t.error){var e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function zc(t){return t?t.toLowerCase():t}var Gc={},Hc=function(t){function e(t,r,n){var o;if(Ac(this,e),o=jc(this,e),t!==Gc)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return I(o,"provider",r),null==n&&(n=0),"string"==typeof n?(I(o,"_address",o.provider.formatter.address(n)),I(o,"_index",null)):"number"==typeof n?(I(o,"_index",n),I(o,"_address",null)):Cc.throwArgumentError("invalid address or index","addressOrIndex",n),o}return Nc(e,t),Sc(e,[{key:"connect",value:function(t){return Cc.throwError("cannot alter JSON-RPC Signer connection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new qc(Gc,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var t=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(e){return e.length<=t._index&&Cc.throwError("unknown account #"+t._index,h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),t.provider.formatter.address(e[t._index])}))}},{key:"sendUncheckedTransaction",value:function(t){var e=this;t=M(t);var r=this.getAddress().then((function(t){return t&&(t=t.toLowerCase()),t}));if(null==t.gasLimit){var n=M(t);n.from=r,t.gasLimit=this.provider.estimateGas(n)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((function(t){return Lc(e,void 0,void 0,xc().mark((function e(){var r;return xc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this.provider.resolveName(t);case 4:return null==(r=e.sent)&&Cc.throwArgumentError("provided ENS name resolves to null","tx.to",t),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)})))}))),L({tx:L(t),sender:r}).then((function(r){var n=r.tx,o=r.sender;null!=n.from?n.from.toLowerCase()!==o&&Cc.throwArgumentError("from address mismatch","transaction",t):n.from=o;var i=e.provider.constructor.hexlifyTransaction(n,{from:!0});return e.provider.send("eth_sendTransaction",[i]).then((function(t){return t}),(function(t){return"string"==typeof t.message&&t.message.match(/user denied/i)&&Cc.throwError("user rejected transaction",h.b.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),Fc("sendTransaction",t,i)}))}))}},{key:"signTransaction",value:function(t){return Cc.throwError("signing transactions is unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(t){return Lc(this,void 0,void 0,xc().mark((function e(){var r,n,o=this;return xc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return r=e.sent,e.next=5,this.sendUncheckedTransaction(t);case 5:return n=e.sent,e.prev=6,e.next=9,Ns((function(){return Lc(o,void 0,void 0,xc().mark((function t(){var e;return xc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.getTransaction(n);case 2:if(null!==(e=t.sent)){t.next=5;break}return t.abrupt("return",void 0);case 5:return t.abrupt("return",this.provider._wrapTransaction(e,n,r));case 6:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this.provider});case 9:return e.abrupt("return",e.sent);case 12:throw e.prev=12,e.t0=e.catch(6),e.t0.transactionHash=n,e.t0;case 16:case"end":return e.stop()}}),e,this,[[6,12]])})))}},{key:"signMessage",value:function(t){return Lc(this,void 0,void 0,xc().mark((function e(){var r,n;return xc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?Ot(t):t,e.next=3,this.getAddress();case 3:return n=e.sent,e.prev=4,e.next=7,this.provider.send("personal_sign",[Object(c.i)(r),n.toLowerCase()]);case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(4),"string"==typeof e.t0.message&&e.t0.message.match(/user denied/i)&&Cc.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:t}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(t){return Lc(this,void 0,void 0,xc().mark((function e(){var r,n;return xc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?Ot(t):t,e.next=3,this.getAddress();case 3:return n=e.sent,e.prev=4,e.next=7,this.provider.send("eth_sign",[n.toLowerCase(),Object(c.i)(r)]);case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(4),"string"==typeof e.t0.message&&e.t0.message.match(/user denied/i)&&Cc.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:t}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[4,10]])})))}},{key:"_signTypedData",value:function(t,e,r){return Lc(this,void 0,void 0,xc().mark((function n(){var o,i,a=this;return xc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Mi.resolveNames(t,e,r,(function(t){return a.provider.resolveName(t)}));case 2:return o=n.sent,n.next=5,this.getAddress();case 5:return i=n.sent,n.prev=6,n.next=9,this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Mi.getPayload(o.domain,e,o.value))]);case 9:return n.abrupt("return",n.sent);case 12:throw n.prev=12,n.t0=n.catch(6),"string"==typeof n.t0.message&&n.t0.message.match(/user denied/i)&&Cc.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:o.domain,types:e,value:o.value}}),n.t0;case 16:case"end":return n.stop()}}),n,this,[[6,12]])})))}},{key:"unlock",value:function(t){return Lc(this,void 0,void 0,xc().mark((function e(){var r,n;return xc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.provider,e.next=3,this.getAddress();case 3:return n=e.sent,e.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),t,null]));case 5:case"end":return e.stop()}}),e,this)})))}}])}(Kn),qc=function(t){function e(){return Ac(this,e),jc(this,e,arguments)}return Nc(e,t),Sc(e,[{key:"sendTransaction",value:function(t){var e=this;return this.sendUncheckedTransaction(t).then((function(t){return{hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return e.provider.waitForTransaction(t,r)}}}))}}])}(Hc),Kc={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},Wc=function(t){function e(t,r){var n;Ac(this,e);var o=r;return null==o&&(o=new Promise((function(t,e){setTimeout((function(){n.detectNetwork().then((function(e){t(e)}),(function(t){e(t)}))}),0)}))),n=jc(this,e,[o]),t||(t=R(n.constructor,"defaultUrl")()),I(n,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(M(t))),n._nextId=42,n}return Nc(e,t),Sc(e,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var t=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){t._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return Lc(this,void 0,void 0,xc().mark((function t(){var e,r;return xc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Dc(0);case 2:return e=null,t.prev=3,t.next=6,this.send("eth_chainId",[]);case 6:e=t.sent,t.next=19;break;case 9:return t.prev=9,t.t0=t.catch(3),t.prev=11,t.next=14,this.send("net_version",[]);case 14:e=t.sent,t.next=19;break;case 17:t.prev=17,t.t1=t.catch(11);case 19:if(null==e){t.next=28;break}return r=R(this.constructor,"getNetwork"),t.prev=21,t.abrupt("return",r(w.from(e).toNumber()));case 25:return t.prev=25,t.t2=t.catch(21),t.abrupt("return",Cc.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t.t2}));case 28:return t.abrupt("return",Cc.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return t.stop()}}),t,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(t){return new Hc(Gc,this,t)}},{key:"getUncheckedSigner",value:function(t){return this.getSigner(t).connectUnchecked()}},{key:"listAccounts",value:function(){var t=this;return this.send("eth_accounts",[]).then((function(e){return e.map((function(e){return t.formatter.address(e)}))}))}},{key:"send",value:function(t,e){var r=this,n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:D(n),provider:this});var o=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(o&&this._cache[t])return this._cache[t];var i=Ts(this.connection,JSON.stringify(n),Uc).then((function(t){return r.emit("debug",{action:"response",request:n,response:t,provider:r}),t}),(function(t){throw r.emit("debug",{action:"response",error:t,request:n,provider:r}),t}));return o&&(this._cache[t]=i,setTimeout((function(){r._cache[t]=null}),0)),i}},{key:"prepareRequest",value:function(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[zc(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[zc(e.address),e.blockTag]];case"getCode":return["eth_getCode",[zc(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[zc(e.address),Object(c.h)(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[R(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[R(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=zc(e.filter.address)),["eth_getLogs",[e.filter]]}return null}},{key:"perform",value:function(t,e){return Lc(this,void 0,void 0,xc().mark((function r(){var n,o,i;return xc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==t&&"estimateGas"!==t){r.next=8;break}if(!(n=e.transaction)||null==n.type||!w.from(n.type).isZero()){r.next=8;break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8;break}return r.next=6,this.getFeeData();case 6:null==(o=r.sent).maxFeePerGas&&null==o.maxPriorityFeePerGas&&((e=M(e)).transaction=M(n),delete e.transaction.type);case 8:return null==(i=this.prepareRequest(t,e))&&Cc.throwError(t+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:t}),r.prev=10,r.next=13,this.send(i[0],i[1]);case 13:return r.abrupt("return",r.sent);case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",Fc(t,r.t0,e));case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(t){"pending"===t.tag&&this._startPending(),kc(Tc(e.prototype),"_startEvent",this).call(this,t)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;var n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return Dc(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((function(t){}))}(),r})).catch((function(t){}))}}},{key:"_stopEvent",value:function(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),kc(Tc(e.prototype),"_stopEvent",this).call(this,t)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(t,e){var r=M(Kc);if(e)for(var n in e)e[n]&&(r[n]=!0);C(t,r);var o={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null!=t[e]){var r=Object(c.g)(w.from(t[e]));"gasLimit"===e&&(e="gas"),o[e]=r}})),["from","to","data"].forEach((function(e){null!=t[e]&&(o[e]=Object(c.i)(t[e]))})),t.accessList&&(o.accessList=po(t.accessList)),o}}])}(_c),Qc=null;try{if(null==(Qc=WebSocket))throw new Error("inject please")}catch(t){var Vc=new h.b("providers/5.7.2");Qc=function(){Vc.throwError("WebSockets not supported in this environment",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}function Jc(t){return(Jc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Yc=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==Jc(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Jc(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Zc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xc(n.key),n)}}function Xc(t){var e=function(t,e){if("object"!=Jc(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Jc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Jc(e)?e:e+""}function $c(t,e,r){return e=ol(e),function(t,e){if(e&&("object"==Jc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return tl(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],ol(t).constructor):e.apply(t,r))}function tl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function el(t,e){return(el=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function rl(){return(rl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=nl(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function nl(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ol(t)););return t}function ol(t){return(ol=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var il=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},al=new h.b("providers/5.7.2"),ul=1,sl=function(t){function e(t,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"any"===r&&al.throwError("WebSocketProvider does not support 'any' network yet",h.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(n=$c(this,e,"string"==typeof t?[t,r]:["_websocket",r]))._pollingInterval=-1,n._wsReady=!1,I(tl(n),"_websocket","string"==typeof t?new Qc(n.connection.url):t),I(tl(n),"_requests",{}),I(tl(n),"_subs",{}),I(tl(n),"_subIds",{}),I(tl(n),"_detectNetwork",rl((tl(n),ol(e.prototype)),"detectNetwork",tl(n)).call(tl(n))),n.websocket.onopen=function(){n._wsReady=!0,Object.keys(n._requests).forEach((function(t){n.websocket.send(n._requests[t].payload)}))},n.websocket.onmessage=function(t){var e=t.data,r=JSON.parse(e);if(null!=r.id){var o=String(r.id),i=n._requests[o];if(delete n._requests[o],void 0!==r.result)i.callback(null,r.result),n.emit("debug",{action:"response",request:JSON.parse(i.payload),response:r.result,provider:tl(n)});else{var a=null;r.error?(I(a=new Error(r.error.message||"unknown error"),"code",r.error.code||null),I(a,"response",e)):a=new Error("unknown error"),i.callback(a,void 0),n.emit("debug",{action:"response",error:a,request:JSON.parse(i.payload),provider:tl(n)})}}else if("eth_subscription"===r.method){var u=n._subs[r.params.subscription];u&&u.processFunc(r.params.result)}else console.warn("this should not happen")};var o=setInterval((function(){n.emit("poll")}),1e3);return o.unref&&o.unref(),tl(n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&el(t,e)}(e,t),r=e,o=[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}],(n=[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(t){al.throwError("cannot set polling interval on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(t){al.throwError("cannot reset events block on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return il(this,void 0,void 0,Yc().mark((function t(){return Yc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 1:case"end":return t.stop()}}),t)})))}},{key:"polling",set:function(t){t&&al.throwError("cannot set polling on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(t,e){var r=this,n=ul++;return new Promise((function(o,i){var a=JSON.stringify({method:t,params:e,id:n,jsonrpc:"2.0"});r.emit("debug",{action:"request",request:JSON.parse(a),provider:r}),r._requests[String(n)]={callback:function(t,e){return t?i(t):o(e)},payload:a},r._wsReady&&r.websocket.send(a)}))}},{key:"_subscribe",value:function(t,e,r){return il(this,void 0,void 0,Yc().mark((function n(){var o,i,a=this;return Yc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==(o=this._subIds[t])&&(o=Promise.all(e).then((function(t){return a.send("eth_subscribe",t)})),this._subIds[t]=o),n.next=4,o;case 4:i=n.sent,this._subs[i]={tag:t,processFunc:r};case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_startEvent",value:function(t){var e=this;switch(t.type){case"block":this._subscribe("block",["newHeads"],(function(t){var r=w.from(t.number).toNumber();e._emitted.block=r,e.emit("block",r)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(t){e.emit("pending",t)}));break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],(function(r){null==r.removed&&(r.removed=!1),e.emit(t.filter,e.formatter.filterLog(r))}));break;case"tx":var r=function(t){var r=t.hash;e.getTransactionReceipt(r).then((function(t){t&&e.emit(r,t)}))};r(t),this._subscribe("tx",["newHeads"],(function(t){e._events.filter((function(t){return"tx"===t.type})).forEach(r)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}},{key:"_stopEvent",value:function(t){var e=this,r=t.tag;if("tx"===t.type){if(this._events.filter((function(t){return"tx"===t.type})).length)return;r="tx"}else if(this.listenerCount(t.event))return;var n=this._subIds[r];n&&(delete this._subIds[r],n.then((function(t){e._subs[t]&&(delete e._subs[t],e.send("eth_unsubscribe",[t]))})))}},{key:"destroy",value:function(){return il(this,void 0,void 0,Yc().mark((function t(){var e=this;return Yc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.websocket.readyState!==Qc.CONNECTING){t.next=3;break}return t.next=3,new Promise((function(t){e.websocket.onopen=function(){t(!0)},e.websocket.onerror=function(){t(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return t.stop()}}),t,this)})))}}])&&Zc(r.prototype,n),o&&Zc(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Wc);function cl(t){return(cl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ll(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ll=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==cl(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(cl(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function fl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dl(n.key),n)}}function pl(t,e,r){return e&&hl(t.prototype,e),r&&hl(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function dl(t){var e=function(t,e){if("object"!=cl(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=cl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==cl(e)?e:e+""}function ml(t,e,r){return e=gl(e),function(t,e){if(e&&("object"==cl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],gl(t).constructor):e.apply(t,r))}function vl(){return(vl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=yl(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function yl(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=gl(t)););return t}function gl(t){return(gl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wl(t,e)}function wl(t,e){return(wl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var _l=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},kl=new h.b("providers/5.7.2"),El=function(t){function e(){return fl(this,e),ml(this,e,arguments)}return bl(e,t),pl(e,[{key:"detectNetwork",value:function(){var t=this,r=Object.create(null,{detectNetwork:{get:function(){return vl(gl(e.prototype),"detectNetwork",t)}}});return _l(this,void 0,void 0,ll().mark((function t(){var e;return ll().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(e=this.network)){t.next=7;break}return t.next=4,r.detectNetwork.call(this);case 4:(e=t.sent)||kl.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(I(this,"_network",e),this.emit("network",e,null));case 7:return t.abrupt("return",e);case 8:case"end":return t.stop()}}),t,this)})))}}])}(Wc),xl=function(t){function e(t,r){var n;fl(this,e),kl.checkAbstract(this instanceof e?this.constructor:void 0,e),t=R(this instanceof e?this.constructor:void 0,"getNetwork")(t),r=R(this instanceof e?this.constructor:void 0,"getApiKey")(r);var o=R(this instanceof e?this.constructor:void 0,"getUrl")(t,r);return n=ml(this,e,[o,t]),"string"==typeof r?I(n,"apiKey",r):null!=r&&Object.keys(r).forEach((function(t){I(n,t,r[t])})),n}return bl(e,t),pl(e,[{key:"_startPending",value:function(){kl.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(t){return kl.throwError("API provider does not support signing",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(t){return t}},{key:"getUrl",value:function(t,e){return kl.throwError("not implemented; sub-classes must override getUrl",h.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}])}(El);function Al(t){return(Al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ol(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jl(n.key),n)}}function Pl(t,e,r){return e&&Sl(t.prototype,e),r&&Sl(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function jl(t){var e=function(t,e){if("object"!=Al(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Al(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Al(e)?e:e+""}function Tl(t,e,r){return e=Nl(e),function(t,e){if(e&&("object"==Al(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Nl(t).constructor):e.apply(t,r))}function Nl(t){return(Nl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Il(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Rl(t,e)}function Rl(t,e){return(Rl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Ll=new h.b("providers/5.7.2"),Cl="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",Ml=function(t){function e(t,r){var n;Ol(this,e);var o=new Bl(t,r);return I(n=Tl(this,e,[o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),o.network]),"apiKey",o.apiKey),n}return Il(e,t),Pl(e,[{key:"isCommunityResource",value:function(){return this.apiKey===Cl}}])}(sl),Bl=function(t){function e(){return Ol(this,e),Tl(this,e,arguments)}return Il(e,t),Pl(e,[{key:"isCommunityResource",value:function(){return this.apiKey===Cl}}],[{key:"getWebSocketProvider",value:function(t,e){return new Ml(t,e)}},{key:"getApiKey",value:function(t){return null==t?Cl:(t&&"string"!=typeof t&&Ll.throwArgumentError("invalid apiKey","apiKey",t),t)}},{key:"getUrl",value:function(t,e){var r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:Ll.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:function(t,r){return e===Cl&&Gs(),Promise.resolve(!0)}}}}])}(xl);function Fl(t){return(Fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ul(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zl(n.key),n)}}function zl(t){var e=function(t,e){if("object"!=Fl(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Fl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Fl(e)?e:e+""}function Gl(t,e,r){return e=Hl(e),function(t,e){if(e&&("object"==Fl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Hl(t).constructor):e.apply(t,r))}function Hl(t){return(Hl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ql(t,e){return(ql=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Kl=new h.b("providers/5.7.2"),Wl="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Ql(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return Kl.throwArgumentError("unsupported network","name",t)}var Vl=function(t){function e(){return Dl(this,e),Gl(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ql(t,e)}(e,t),r=e,o=[{key:"getApiKey",value:function(t){return null==t?Wl:t}},{key:"getUrl",value:function(t,e){null==e&&(e=Wl);var r={allowGzip:!0,url:"https://"+Ql(t.name)+e,throttleCallback:function(t,r){return e.apiKey===Wl&&Gs(),Promise.resolve(!0)}};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}],(n=[{key:"isCommunityResource",value:function(){return this.apiKey===Wl}}])&&Ul(r.prototype,n),o&&Ul(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(xl);function Jl(t){return(Jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yl(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Yl=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==Jl(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Jl(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Zl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$l(n.key),n)}}function $l(t){var e=function(t,e){if("object"!=Jl(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Jl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Jl(e)?e:e+""}function tf(t,e,r){return e=nf(e),function(t,e){if(e&&("object"==Jl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],nf(t).constructor):e.apply(t,r))}function ef(){return(ef="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=rf(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function rf(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=nf(t)););return t}function nf(t){return(nf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function of(t,e){return(of=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var af=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},uf=new h.b("providers/5.7.2"),sf=function(t){function e(){return Zl(this,e),tf(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&of(t,e)}(e,t),r=e,o=[{key:"getApiKey",value:function(t){return null!=t&&uf.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}},{key:"getUrl",value:function(t,e){var r=null;switch(t.name){case"homestead":r="https://cloudflare-eth.com/";break;default:uf.throwArgumentError("unsupported network","network",arguments[0])}return r}}],(n=[{key:"perform",value:function(t,r){var n=this,o=Object.create(null,{perform:{get:function(){return ef(nf(e.prototype),"perform",n)}}});return af(this,void 0,void 0,Yl().mark((function e(){var n;return Yl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("getBlockNumber"!==t){e.next=5;break}return e.next=3,o.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return n=e.sent,e.abrupt("return",n.number);case 5:return e.abrupt("return",o.perform.call(this,t,r));case 6:case"end":return e.stop()}}),e,this)})))}}])&&Xl(r.prototype,n),o&&Xl(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(xl);function cf(t){return(cf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */lf=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==cf(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(cf(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function ff(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hf(n.key),n)}}function hf(t){var e=function(t,e){if("object"!=cf(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=cf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==cf(e)?e:e+""}function pf(t,e,r){return e=vf(e),function(t,e){if(e&&("object"==cf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],vf(t).constructor):e.apply(t,r))}function df(){return(df="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=mf(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(null,arguments)}function mf(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vf(t)););return t}function vf(t){return(vf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yf(t,e){return(yf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var gf=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},bf=new h.b("providers/5.7.2");function wf(t){var e={};for(var r in t)if(null!=t[r]){var n=t[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?Object(c.g)(Object(c.i)(n)):"accessList"===r?"["+po(n).map((function(t){return'{address:"'.concat(t.address,'",storageKeys:["').concat(t.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(c.i)(n),e[r]=n)}return e}function _f(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"string"!=typeof t.message||!t.message.match(/^OK/)){var e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function kf(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){var e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){var r=new Error("invalid response");throw r.result=JSON.stringify(t),r}if(t.error){var n=new Error(t.error.message||"unknown error");throw t.error.code&&(n.code=t.error.code),t.error.data&&(n.data=t.error.data),n}return t.result}function Ef(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}function xf(t,e,r){if("call"===t&&e.code===h.b.errors.SERVER_ERROR){var n=e.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var o=n.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),Object(c.l)(o))return o;bf.throwError("missing revert data in call exception",h.b.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}var i=e.message;throw e.code===h.b.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText)),(i=(i||"").toLowerCase()).match(/insufficient funds/)&&bf.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&bf.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),i.match(/another transaction with same nonce/)&&bf.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),i.match(/execution failed due to an exception|execution reverted/)&&bf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}var Af=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),I(n=pf(this,e,[t]),"baseUrl",n.getBaseUrl()),I(n,"apiKey",r||null),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yf(t,e)}(e,t),r=e,(n=[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return bf.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(t,e){var r=Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&(t+="&".concat(r,"=").concat(n)),t}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(t).concat(r).concat(n)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(t,e){return e.module=t,e.apikey=this.apiKey,e}},{key:"fetch",value:function(t,e,r){return gf(this,void 0,void 0,lf().mark((function n(){var o,i,a,u,s,c,l=this;return lf().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=r?this.getPostUrl():this.getUrl(t,e),i=r?this.getPostData(t,e):null,a="proxy"===t?kf:_f,this.emit("debug",{action:"request",request:o,provider:this}),u={url:o,throttleSlotInterval:1e3,throttleCallback:function(t,e){return l.isCommunityResource()&&Gs(),Promise.resolve(!0)}},s=null,i&&(u.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map((function(t){return"".concat(t,"=").concat(i[t])})).join("&")),n.next=9,Ts(u,s,a||kf);case 9:return c=n.sent,this.emit("debug",{action:"response",request:o,response:D(c),provider:this}),n.abrupt("return",c);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return gf(this,void 0,void 0,lf().mark((function t(){return lf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.network);case 1:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(t,r){var n=this,o=Object.create(null,{perform:{get:function(){return df(vf(e.prototype),"perform",n)}}});return gf(this,void 0,void 0,lf().mark((function e(){var n,i,a,u,s,c,l,f,p;return lf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next="getBlockNumber"===e.t0?3:"getGasPrice"===e.t0?4:"getBalance"===e.t0?5:"getTransactionCount"===e.t0?6:"getCode"===e.t0?7:"getStorageAt"===e.t0?8:"sendTransaction"===e.t0?9:"getBlock"===e.t0?10:"getTransaction"===e.t0?13:"getTransactionReceipt"===e.t0?14:"call"===e.t0?15:"estimateGas"===e.t0?29:"getLogs"===e.t0?41:"getEtherPrice"===e.t0?65:72;break;case 3:return e.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return e.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return e.abrupt("return",this.fetch("account",{action:"balance",address:r.address,tag:r.blockTag}));case 6:return e.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:r.address,tag:r.blockTag}));case 7:return e.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:r.address,tag:r.blockTag}));case 8:return e.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:r.address,position:r.position,tag:r.blockTag}));case 9:return e.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:r.signedTransaction},!0).catch((function(t){return xf("sendTransaction",t,r.signedTransaction)})));case 10:if(!r.blockTag){e.next=12;break}return e.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:r.blockTag,boolean:r.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return e.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:r.transactionHash}));case 14:return e.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:r.transactionHash}));case 15:if("latest"===r.blockTag){e.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(n=wf(r.transaction)).module="proxy",n.action="eth_call",e.prev=20,e.next=23,this.fetch("proxy",n,!0);case 23:return e.abrupt("return",e.sent);case 26:return e.prev=26,e.t1=e.catch(20),e.abrupt("return",xf("call",e.t1,r.transaction));case 29:return(i=wf(r.transaction)).module="proxy",i.action="eth_estimateGas",e.prev=32,e.next=35,this.fetch("proxy",i,!0);case 35:return e.abrupt("return",e.sent);case 38:return e.prev=38,e.t2=e.catch(32),e.abrupt("return",xf("estimateGas",e.t2,r.transaction));case 41:return a={action:"getLogs"},r.filter.fromBlock&&(a.fromBlock=Ef(r.filter.fromBlock)),r.filter.toBlock&&(a.toBlock=Ef(r.filter.toBlock)),r.filter.address&&(a.address=r.filter.address),r.filter.topics&&r.filter.topics.length>0&&(r.filter.topics.length>1&&bf.throwError("unsupported topic count",h.b.errors.UNSUPPORTED_OPERATION,{topics:r.filter.topics}),1===r.filter.topics.length&&("string"==typeof(u=r.filter.topics[0])&&66===u.length||bf.throwError("unsupported topic format",h.b.errors.UNSUPPORTED_OPERATION,{topic0:u}),a.topic0=u)),e.next=48,this.fetch("logs",a);case 48:s=e.sent,c={},l=0;case 51:if(!(l<s.length)){e.next=64;break}if(null==(f=s[l]).blockHash){e.next=55;break}return e.abrupt("continue",61);case 55:if(null!=c[f.blockNumber]){e.next=60;break}return e.next=58,this.getBlock(f.blockNumber);case 58:(p=e.sent)&&(c[f.blockNumber]=p.hash);case 60:f.blockHash=c[f.blockNumber];case 61:l++,e.next=51;break;case 64:return e.abrupt("return",s);case 65:if("homestead"===this.network.name){e.next=67;break}return e.abrupt("return",0);case 67:return e.t3=parseFloat,e.next=70,this.fetch("stats",{action:"ethprice"});case 70:return e.t4=e.sent.ethusd,e.abrupt("return",(0,e.t3)(e.t4));case 72:return e.abrupt("break",73);case 73:return e.abrupt("return",o.perform.call(this,t,r));case 74:case"end":return e.stop()}}),e,this,[[20,26],[32,38]])})))}},{key:"getHistory",value:function(t,e,r){return gf(this,void 0,void 0,lf().mark((function n(){var o,i,a=this;return lf().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.resolveName(t);case 2:return n.t0=n.sent,n.t1=null==e?0:e,n.t2=null==r?99999999:r,o={action:"txlist",address:n.t0,startblock:n.t1,endblock:n.t2,sort:"asc"},n.next=8,this.fetch("account",o);case 8:return i=n.sent,n.abrupt("return",i.map((function(t){["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);var e=a.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e})));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"isCommunityResource",value:function(){return null==this.apiKey}}])&&ff(r.prototype,n),o&&ff(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(_c);function Of(t){for(var e=(t=t.slice()).length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}function Sf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Pf(n.key),n)}}function Pf(t){var e=function(t,e){if("object"!=Rf(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Rf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Rf(e)?e:e+""}function jf(t,e,r){return e=Tf(e),function(t,e){if(e&&("object"==Rf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Tf(t).constructor):e.apply(t,r))}function Tf(t){return(Tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Nf(t,e){return(Nf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function If(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */If=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:A(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="executing",d="completed",m={};function v(){}function y(){}function g(){}var b={};c(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==Rf(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function A(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?d:"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Rf(e)+" is not iterable")}return y.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(x.prototype),c(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,s,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Rf(t){return(Rf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Lf=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Cf=new h.b("providers/5.7.2");function Mf(){return(new Date).getTime()}function Bf(t){for(var e=null,r=0;r<t.length;r++){var n=t[r];if(null==n)return null;e?e.name===n.name&&e.chainId===n.chainId&&(e.ensAddress===n.ensAddress||null==e.ensAddress&&null==n.ensAddress)||Cf.throwArgumentError("provider mismatch","networks",t):e=n}return e}function Ff(t,e){t=t.slice().sort();var r=Math.floor(t.length/2);if(t.length%2)return t[r];var n=t[r-1],o=t[r];return null!=e&&Math.abs(n-o)>e?null:(n+o)/2}function Df(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(w.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map((function(t){return Df(t)})));if("object"===Rf(t)){var e=Object.keys(t);return e.sort(),"{"+e.map((function(e){var r=t[e];return r="function"==typeof r?"[function]":Df(r),JSON.stringify(e)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+Rf(t))}var Uf=1;function zf(t){var e=null,r=null,n=new Promise((function(n){e=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(e,t)}));return{cancel:e,getPromise:function(){return n},wait:function(t){return n=n.then(t)}}}var Gf=[h.b.errors.CALL_EXCEPTION,h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED,h.b.errors.UNPREDICTABLE_GAS_LIMIT],Hf=["address","args","errorArgs","errorSignature","method","transaction"];function qf(t,e){var r={weight:t.weight};return Object.defineProperty(r,"provider",{get:function(){return t.provider}}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function Kf(t,e,r){var n=Df;switch(e){case"getBlockNumber":return function(e){var r=e.map((function(t){return t.result})),n=Ff(e.map((function(t){return t.result})),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){var e=t.map((function(t){return t.result}));return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return Ff(t.map((function(t){return t.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(t){return null==t?null:((t=M(t)).confirmations=-1,Df(t))};break;case"getBlock":n=r.includeTransactions?function(t){return null==t?null:((t=M(t)).transactions=t.transactions.map((function(t){return(t=M(t)).confirmations=-1,t})),Df(t))}:function(t){return null==t?null:Df(t)};break;default:throw new Error("unknown method: "+e)}return function(t,e){return function(r){var n={};r.forEach((function(e){var r=t(e.result);n[r]||(n[r]={count:0,result:e.result}),n[r].count++}));for(var o=Object.keys(n),i=0;i<o.length;i++){var a=n[o[i]];if(a.count>=e)return a.result}}}(n,t.quorum)}function Wf(t,e){return Lf(this,void 0,void 0,If().mark((function r(){var n;return If().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=t.provider).blockNumber&&n.blockNumber>=e||-1===e)){r.next=3;break}return r.abrupt("return",n);case 3:return r.abrupt("return",Ns((function(){return new Promise((function(r,o){setTimeout((function(){return n.blockNumber>=e?r(n):t.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n}));case 4:case"end":return r.stop()}}),r)})))}function Qf(t,e,r,n){return Lf(this,void 0,void 0,If().mark((function o(){var i,a;return If().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:i=t.provider,o.t0=r,o.next="getBlockNumber"===o.t0||"getGasPrice"===o.t0?4:"getEtherPrice"===o.t0?5:"getBalance"===o.t0||"getTransactionCount"===o.t0||"getCode"===o.t0?8:"getStorageAt"===o.t0?13:"getBlock"===o.t0?18:"call"===o.t0||"estimateGas"===o.t0?23:"getTransaction"===o.t0||"getTransactionReceipt"===o.t0?30:"getLogs"===o.t0?31:37;break;case 4:return o.abrupt("return",i[r]());case 5:if(!i.getEtherPrice){o.next=7;break}return o.abrupt("return",i.getEtherPrice());case 7:return o.abrupt("break",37);case 8:if(!n.blockTag||!Object(c.l)(n.blockTag)){o.next=12;break}return o.next=11,Wf(t,e);case 11:i=o.sent;case 12:return o.abrupt("return",i[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!Object(c.l)(n.blockTag)){o.next=17;break}return o.next=16,Wf(t,e);case 16:i=o.sent;case 17:return o.abrupt("return",i.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!Object(c.l)(n.blockTag)){o.next=22;break}return o.next=21,Wf(t,e);case 21:i=o.sent;case 22:return o.abrupt("return",i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!Object(c.l)(n.blockTag)){o.next=27;break}return o.next=26,Wf(t,e);case 26:i=o.sent;case 27:if("call"!==r||!n.blockTag){o.next=29;break}return o.abrupt("return",i[r](n.transaction,n.blockTag));case 29:return o.abrupt("return",i[r](n.transaction));case 30:return o.abrupt("return",i[r](n.transactionHash));case 31:if(!((a=n.filter).fromBlock&&Object(c.l)(a.fromBlock)||a.toBlock&&Object(c.l)(a.toBlock))){o.next=36;break}return o.next=35,Wf(t,e);case 35:i=o.sent;case 36:return o.abrupt("return",i.getLogs(a));case 37:return o.abrupt("return",Cf.throwError("unknown method error",h.b.errors.UNKNOWN_ERROR,{method:r,params:n}));case 38:case"end":return o.stop()}}),o)})))}var Vf=function(t){function e(t,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),0===t.length&&Cf.throwArgumentError("missing providers","providers",t);var o=t.map((function(t,e){if(Nn.isProvider(t)){var r=Us(t)?2e3:750;return Object.freeze({provider:t,weight:1,stallTimeout:r,priority:1})}var n=M(t);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=Us(t)?2e3:750),null==n.weight&&(n.weight=1);var o=n.weight;return(o%1||o>512||o<1)&&Cf.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(e,"].weight"),o),Object.freeze(n)})),i=o.reduce((function(t,e){return t+e.weight}),0);null==r?r=i/2:r>i&&Cf.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);var a=Bf(o.map((function(t){return t.provider.network})));return null==a&&(a=new Promise((function(t,e){setTimeout((function(){n.detectNetwork().then(t,e)}),0)}))),I(n=jf(this,e,[a]),"providerConfigs",Object.freeze(o)),I(n,"quorum",r),n._highestBlockNumber=-1,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nf(t,e)}(e,t),r=e,(n=[{key:"detectNetwork",value:function(){return Lf(this,void 0,void 0,If().mark((function t(){var e;return If().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(this.providerConfigs.map((function(t){return t.provider.getNetwork()})));case 2:return e=t.sent,t.abrupt("return",Bf(e));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(t,e){return Lf(this,void 0,void 0,If().mark((function r(){var n,o,i,a,u,s,c,l,f,p,d=this;return If().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==t){r.next=13;break}return r.next=3,Promise.all(this.providerConfigs.map((function(t){return t.provider.sendTransaction(e.signedTransaction).then((function(t){return t.hash}),(function(t){return t}))})));case 3:n=r.sent,o=0;case 5:if(!(o<n.length)){r.next=12;break}if("string"!=typeof(i=n[o])){r.next=9;break}return r.abrupt("return",i);case 9:o++,r.next=5;break;case 12:throw n[0];case 13:if(-1!==this._highestBlockNumber||"getBlockNumber"===t){r.next=16;break}return r.next=16,this.getBlockNumber();case 16:a=Kf(this,t,e),(u=Of(this.providerConfigs.map(M))).sort((function(t,e){return t.priority-e.priority})),s=this._highestBlockNumber,c=0,l=!0,f=If().mark((function r(){var n,o,i,f,h,p,m;return If().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=Mf(),o=u.filter((function(t){return t.runner&&n-t.start<t.stallTimeout})).reduce((function(t,e){return t+e.weight}),0),i=If().mark((function r(){var n,i;return If().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=u[c++],i=Uf++,n.start=Mf(),n.staller=zf(n.stallTimeout),n.staller.wait((function(){n.staller=null})),n.runner=Qf(n,s,t,e).then((function(r){n.done=!0,n.result=r,d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:i,backend:qf(n,Mf()),request:{method:t,params:D(e)},provider:d})}),(function(r){n.done=!0,n.error=r,d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:i,backend:qf(n,Mf()),request:{method:t,params:D(e)},provider:d})})),d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:i,backend:qf(n,null),request:{method:t,params:D(e)},provider:d}),o+=n.weight;case 8:case"end":return r.stop()}}),r)}));case 3:if(!(o<d.quorum&&c<u.length)){r.next=7;break}return r.delegateYield(i(),"t0",5);case 5:r.next=3;break;case 7:if(f=[],u.forEach((function(t){!t.done&&t.runner&&(f.push(t.runner),t.staller&&f.push(t.staller.getPromise()))})),!f.length){r.next=12;break}return r.next=12,Promise.race(f);case 12:if(!((h=u.filter((function(t){return t.done&&null==t.error}))).length>=d.quorum)){r.next=22;break}if(void 0===(p=a(h))){r.next=18;break}return u.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0})),r.abrupt("return",{v:p});case 18:if(l){r.next=21;break}return r.next=21,zf(100).getPromise();case 21:l=!1;case 22:if(m=u.reduce((function(t,e){if(!e.done||null==e.error)return t;var r=e.error.code;return Gf.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t}),{}),Object.keys(m).forEach((function(t){var e=m[t];if(!(e.weight<d.quorum)){u.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0}));var r=e.error,n={};Hf.forEach((function(t){null!=r[t]&&(n[t]=r[t])})),Cf.throwError(r.reason||r.message,t,n)}})),0!==u.filter((function(t){return!t.done})).length){r.next=26;break}return r.abrupt("return",0);case 26:case"end":return r.stop()}}),r)}));case 23:return r.delegateYield(f(),"t0",25);case 25:if(0!==(p=r.t0)){r.next=28;break}return r.abrupt("break",32);case 28:if(!p){r.next=30;break}return r.abrupt("return",p.v);case 30:r.next=23;break;case 32:return u.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0})),r.abrupt("return",Cf.throwError("failed to meet quorum",h.b.errors.SERVER_ERROR,{method:t,params:e,results:u.map((function(t){return qf(t)})),provider:this}));case 34:case"end":return r.stop()}}),r,this)})))}}])&&Sf(r.prototype,n),o&&Sf(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(_c),Jf=null;function Yf(t){return(Yf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,th(n.key),n)}}function $f(t,e,r){return e&&Xf(t.prototype,e),r&&Xf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function th(t){var e=function(t,e){if("object"!=Yf(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Yf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Yf(e)?e:e+""}function eh(t,e,r){return e=rh(e),function(t,e){if(e&&("object"==Yf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],rh(t).constructor):e.apply(t,r))}function rh(t){return(rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nh(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oh(t,e)}function oh(t,e){return(oh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var ih=new h.b("providers/5.7.2"),ah="84842078b09946638c03157f83405213",uh=function(t){function e(t,r){var n;Zf(this,e);var o=new sh(t,r),i=o.connection;return i.password&&ih.throwError("INFURA WebSocket project secrets unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"}),I(n=eh(this,e,[i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),t]),"apiKey",o.projectId),I(n,"projectId",o.projectId),I(n,"projectSecret",o.projectSecret),n}return nh(e,t),$f(e,[{key:"isCommunityResource",value:function(){return this.projectId===ah}}])}(sl),sh=function(t){function e(){return Zf(this,e),eh(this,e,arguments)}return nh(e,t),$f(e,[{key:"isCommunityResource",value:function(){return this.projectId===ah}}],[{key:"getWebSocketProvider",value:function(t,e){return new uh(t,e)}},{key:"getApiKey",value:function(t){var e={apiKey:ah,projectId:ah,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(ih.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),ih.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}},{key:"getUrl",value:function(t,e){var r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:ih.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}var n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:function(t,r){return e.projectId===ah&&Gs(),Promise.resolve(!0)}};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}}])}(xl);function ch(t){return(ch="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hh(n.key),n)}}function hh(t){var e=function(t,e){if("object"!=ch(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ch(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ch(e)?e:e+""}function ph(t,e,r){return e=dh(e),function(t,e){if(e&&("object"==ch(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],dh(t).constructor):e.apply(t,r))}function dh(t){return(dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mh(t,e){return(mh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var vh=function(t){function e(){return lh(this,e),ph(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mh(t,e)}(e,t),r=e,(n=[{key:"send",value:function(t,e){var r=this,n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);var o={request:n,resolve:null,reject:null},i=new Promise((function(t,e){o.resolve=t,o.reject=e}));return this._pendingBatch.push(o),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((function(){var t=r._pendingBatch;r._pendingBatch=null,r._pendingBatchAggregator=null;var e=t.map((function(t){return t.request}));return r.emit("debug",{action:"requestBatch",request:D(e),provider:r}),Ts(r.connection,JSON.stringify(e)).then((function(n){r.emit("debug",{action:"response",request:e,response:n,provider:r}),t.forEach((function(t,e){var r=n[e];if(r.error){var o=new Error(r.error.message);o.code=r.error.code,o.data=r.error.data,t.reject(o)}else t.resolve(r.result)}))}),(function(n){r.emit("debug",{action:"response",error:n,request:e,provider:r}),t.forEach((function(t){t.reject(n)}))}))}),10)),i}}])&&fh(r.prototype,n),o&&fh(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Wc);function yh(t){return(yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wh(n.key),n)}}function wh(t){var e=function(t,e){if("object"!=yh(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=yh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==yh(e)?e:e+""}function _h(t,e,r){return e=kh(e),function(t,e){if(e&&("object"==yh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],kh(t).constructor):e.apply(t,r))}function kh(t){return(kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Eh(t,e){return(Eh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var xh=new h.b("providers/5.7.2"),Ah=function(t){function e(){return gh(this,e),_h(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Eh(t,e)}(e,t),r=e,o=[{key:"getApiKey",value:function(t){return t&&"string"!=typeof t&&xh.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}},{key:"getUrl",value:function(t,e){xh.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");var r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:xh.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}],(n=null)&&bh(r.prototype,n),o&&bh(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(xl);function Oh(t){return(Oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ph(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jh(n.key),n)}}function jh(t){var e=function(t,e){if("object"!=Oh(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Oh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Oh(e)?e:e+""}function Th(t,e,r){return e=Nh(e),function(t,e){if(e&&("object"==Oh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Nh(t).constructor):e.apply(t,r))}function Nh(t){return(Nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ih(t,e){return(Ih=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Rh=new h.b("providers/5.7.2"),Lh=function(t){function e(){return Sh(this,e),Th(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ih(t,e)}(e,t),r=e,o=[{key:"getApiKey",value:function(t){var e={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==t?e.applicationId="62e1ad51b37b8e00394bda3b":"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?(e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey):t.applicationId?e.applicationId=t.applicationId:Rh.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}},{key:"getUrl",value:function(t,e){var r=null;switch(t?t.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:Rh.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}var n={headers:{},url:"https://".concat(r,"/v1/lb/").concat(e.applicationId)};return null!=e.applicationSecretKey&&(n.user="",n.password=e.applicationSecretKey),n}}],(n=[{key:"isCommunityResource",value:function(){return"62e1ad51b37b8e00394bda3b"===this.applicationId}}])&&Ph(r.prototype,n),o&&Ph(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(xl);function Ch(t){return(Ch="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bh(n.key),n)}}function Bh(t){var e=function(t,e){if("object"!=Ch(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ch(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ch(e)?e:e+""}function Fh(t,e,r){return e=Dh(e),function(t,e){if(e&&("object"==Ch(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Dh(t).constructor):e.apply(t,r))}function Dh(t){return(Dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Uh(t,e){return(Uh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var zh=new h.b("providers/5.7.2"),Gh=1;function Hh(t,e){var r="Web3LegacyFetcher";return function(t,n){var o=this,i={method:t,params:n,id:Gh++,jsonrpc:"2.0"};return new Promise((function(t,n){o.emit("debug",{action:"request",fetcher:r,request:D(i),provider:o}),e(i,(function(e,a){if(e)return o.emit("debug",{action:"response",fetcher:r,error:e,request:i,provider:o}),n(e);if(o.emit("debug",{action:"response",fetcher:r,request:i,response:a,provider:o}),a.error){var u=new Error(a.error.message);return u.code=a.error.code,u.data=a.error.data,n(u)}t(a.result)}))}))}}var qh=function(t){function e(t,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),null==t&&zh.throwArgumentError("missing provider","provider",t);var o=null,i=null,a=null;return"function"==typeof t?(o="unknown:",i=t):(!(o=t.host||t.path||"")&&t.isMetaMask&&(o="metamask"),a=t,t.request?(""===o&&(o="eip-1193:"),i=function(t){return function(e,r){var n=this;null==r&&(r=[]);var o={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:D(o),provider:this}),t.request(o).then((function(t){return n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:o,response:t,provider:n}),t}),(function(t){throw n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:o,error:t,provider:n}),t}))}}(t)):t.sendAsync?i=Hh(0,t.sendAsync.bind(t)):t.send?i=Hh(0,t.send.bind(t)):zh.throwArgumentError("unsupported provider","provider",t),o||(o="unknown:")),I(n=Fh(this,e,[o,r]),"jsonRpcFetchFunc",i),I(n,"provider",a),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Uh(t,e)}(e,t),r=e,(n=[{key:"send",value:function(t,e){return this.jsonRpcFetchFunc(t,e)}}])&&Mh(r.prototype,n),o&&Mh(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Wc),Kh=new h.b("providers/5.7.2");function Wh(t,e){if(null==t&&(t="homestead"),"string"==typeof t){var r=t.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new Wc(t);case"ws":case"wss":return new sl(t);default:Kh.throwArgumentError("unsupported URL scheme","network",t)}}var n=Du(t);return n&&n._defaultProvider||Kh.throwError("unsupported getDefaultProvider network",h.b.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),n._defaultProvider({FallbackProvider:Vf,AlchemyProvider:Bl,AnkrProvider:Vl,CloudflareProvider:sf,EtherscanProvider:Af,InfuraProvider:sh,JsonRpcProvider:Wc,NodesmithProvider:Ah,PocketProvider:Lh,Web3Provider:qh,IpcProvider:Jf},e)}var Qh=new RegExp("^bytes([0-9]+)$"),Vh=new RegExp("^(u?int)([0-9]*)$"),Jh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Yh=new h.b("solidity/5.7.0");function Zh(t,e){t.length!=e.length&&Yh.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);var r=[];return t.forEach((function(t,n){r.push(function t(e,r,n){switch(e){case"address":return n?Object(c.p)(r,32):Object(c.a)(r);case"string":return Ot(r);case"bytes":return Object(c.a)(r);case"bool":return r=r?"0x01":"0x00",n?Object(c.p)(r,32):Object(c.a)(r)}var o=e.match(Vh);if(o){var i=parseInt(o[2]||"256");return(o[2]&&String(i)!==o[2]||i%8!=0||0===i||i>256)&&Yh.throwArgumentError("invalid number type","type",e),n&&(i=256),r=w.from(r).toTwos(i),Object(c.p)(r,i/8)}if(o=e.match(Qh)){var a=parseInt(o[1]);return(String(a)!==o[1]||0===a||a>32)&&Yh.throwArgumentError("invalid bytes type","type",e),Object(c.a)(r).byteLength!==a&&Yh.throwArgumentError("invalid value for ".concat(e),"value",r),n?Object(c.a)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((o=e.match(Jh))&&Array.isArray(r)){var u=o[1];parseInt(o[2]||String(r.length))!=r.length&&Yh.throwArgumentError("invalid array length for ".concat(e),"value",r);var s=[];return r.forEach((function(e){s.push(t(u,e,!0))})),Object(c.b)(s)}return Yh.throwArgumentError("invalid type","type",e)}(t,e[n]))})),Object(c.i)(Object(c.b)(r))}function Xh(t,e){return $(Zh(t,e))}function $h(t,e){return Qi(Zh(t,e))}function tp(t,e){e||(e=function(t){return[parseInt(t,16)]});var r=0,n={};return t.split(",").forEach((function(t){var o=t.split(":");r+=parseInt(o[0],16),n[r]=e(o[1])})),n}function ep(t){var e=0;return t.split(",").map((function(t){var r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}}))}function rp(t,e){for(var r=0,n=0;n<e.length;n++){var o=e[n];if(t>=(r+=o.l)&&t<=r+o.h&&(t-r)%(o.d||1)==0){if(o.e&&-1!==o.e.indexOf(t-r))continue;return o}}return null}var np=ep("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),op="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(t){return parseInt(t,16)})),ip=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],ap=tp("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),up=tp("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),sp=tp("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");for(var e=[],r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e})),cp=ep("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function lp(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();var e,r=Nt(t);e=r.map((function(t){if(op.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];var e=function(t){var e=rp(t,ip);if(e)return[t+e.s];var r=ap[t];if(r)return r;var n=up[t];if(n)return[t+n[0]];var o=sp[t];return o||null}(t);return e||[t]})),(r=Nt(jt(r=e.reduce((function(t,e){return e.forEach((function(e){t.push(e)})),t}),[])),wt.NFKC)).forEach((function(t){if(rp(t,cp))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(t){if(rp(t,np))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=jt(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}function fp(t){var e=Ot(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(c.i)(Object(c.b)([e,Tu]).slice(0,32))}function hp(t){var e=Object(c.a)(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return Tt(e.slice(0,r))}var pp=new h.b("units/5.7.0"),dp=["wei","kwei","mwei","gwei","szabo","finney","ether"];function mp(t){var e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&pp.throwArgumentError("invalid value","value",t);var r=e[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var o="";for(2===e.length&&(o="."+(e[1]||"0"));o.length>2&&"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(var i=[];r.length;){if(r.length<=3){i.unshift(r);break}var a=r.length-3;i.unshift(r.substring(a)),r=r.substring(0,a)}return n+i.join(",")+o}function vp(t,e){if("string"==typeof e){var r=dp.indexOf(e);-1!==r&&(e=3*r)}return li(t,null!=e?e:18)}function yp(t,e){if("string"!=typeof t&&pp.throwArgumentError("value must be a string","value",t),"string"==typeof e){var r=dp.indexOf(e);-1!==r&&(e=3*r)}return fi(t,null!=e?e:18)}function gp(t){return vp(t,18)}function bp(t){return yp(t,18)}var wp="ethers/5.7.2",_p=new h.b(wp);try{var kp=window;null==kp._ethers&&(kp._ethers=s)}catch(t){}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return c}));var n=r(0),o=r(1),i=r(36),a=new o.b(i.a);var u=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")}(),s=u.crypto||u.msCrypto;function c(t){(t<=0||t>1024||t%1||t!=t)&&a.throwArgumentError("invalid length","length",t);var e=new Uint8Array(t);return s.getRandomValues(e),Object(n.a)(e)}s&&s.getRandomValues||(a.warn("WARNING: Missing strong random number source"),s={getRandomValues:function(t){return a.throwError("no secure random source avaialble",o.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(8))}])}));
|
|
60
|
+
*/!function(u,s){"use strict";"object"===a(t)&&t.exports?t.exports=s(r(28),r(29),r(30)):(o=[r(28),r(29),r(30)],void 0===(i="function"==typeof(n=s)?n.apply(e,o):n)||(t.exports=i))}(0,(function(t,e,r,n){"use strict";var o=n&&n.URI;function i(t,e){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof i))return r?n?new i(t,e):new i(t):new i;if(void 0===t){if(r)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&r)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}i.version="1.19.11";var u=i.prototype,s=Object.prototype.hasOwnProperty;function c(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function f(t){return"Array"===l(t)}function h(t,e){var r,n,o={};if("RegExp"===l(e))o=null;else if(f(e))for(r=0,n=e.length;r<n;r++)o[e[r]]=!0;else o[e]=!0;for(r=0,n=t.length;r<n;r++){(o&&void 0!==o[t[r]]||!o&&e.test(t[r]))&&(t.splice(r,1),n--,r--)}return t}function p(t,e){var r,n;if(f(e)){for(r=0,n=e.length;r<n;r++)if(!p(t,e[r]))return!1;return!0}var o=l(e);for(r=0,n=t.length;r<n;r++)if("RegExp"===o){if("string"==typeof t[r]&&t[r].match(e))return!0}else if(t[r]===e)return!0;return!1}function d(t,e){if(!f(t)||!f(e))return!1;if(t.length!==e.length)return!1;t.sort(),e.sort();for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0}function v(t){return t.replace(/^\/+|\/+$/g,"")}function y(t){return escape(t)}function m(t){return encodeURIComponent(t).replace(/[!'()*]/g,y).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return i.domAttributes[e]}},i.encode=m,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=m,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(t,e){var r=i.encode(t+"");return void 0===e&&(e=i.escapeQuerySpace),e?r.replace(/%20/g,"+"):r},i.decodeQuery=function(t,e){t+="",void 0===e&&(e=i.escapeQuerySpace);try{return i.decode(e?t.replace(/\+/g,"%20"):t)}catch(e){return t}};var g,b={encode:"encode",decode:"decode"},w=function(t,e){return function(r){try{return i[e](r+"").replace(i.characters[t][e].expression,(function(r){return i.characters[t][e].map[r]}))}catch(t){return r}}};for(g in b)i[g+"PathSegment"]=w("pathname",b[g]),i[g+"UrnPathSegment"]=w("urnpath",b[g]);var _=function(t,e,r){return function(n){var o;o=r?function(t){return i[e](i[r](t))}:i[e];for(var a=(n+"").split(t),u=0,s=a.length;u<s;u++)a[u]=o(a[u]);return a.join(t)}};function k(t){return function(e,r){return void 0===e?this._parts[t]||"":(this._parts[t]=e||null,this.build(!r),this)}}function E(t,e){return function(r,n){return void 0===r?this._parts[t]||"":(null!==r&&(r+="").charAt(0)===e&&(r=r.substring(1)),this._parts[t]=r,this.build(!n),this)}}i.decodePath=_("/","decodePathSegment"),i.decodeUrnPath=_(":","decodeUrnPathSegment"),i.recodePath=_("/","encodePathSegment","decode"),i.recodeUrnPath=_(":","encodeUrnPathSegment","decode"),i.encodeReserved=w("reserved","encode"),i.parse=function(t,e){var r;return e||(e={preventInvalidHostname:i.preventInvalidHostname}),(r=(t=(t=t.replace(i.leading_whitespace_expression,"")).replace(i.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(e.fragment=t.substring(r+1)||null,t=t.substring(0,r)),(r=t.indexOf("?"))>-1&&(e.query=t.substring(r+1)||null,t=t.substring(0,r)),"//"===(t=(t=t.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=i.parseAuthority(t,e)):(r=t.indexOf(":"))>-1&&(e.protocol=t.substring(0,r)||null,e.protocol&&!e.protocol.match(i.protocol_expression)?e.protocol=void 0:"//"===t.substring(r+1,r+3).replace(/\\/g,"/")?(t=t.substring(r+3),t=i.parseAuthority(t,e)):(t=t.substring(r+1),e.urn=!0)),e.path=t,e},i.parseHost=function(t,e){t||(t="");var r,n,o=(t=t.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=t.length),"["===t.charAt(0))r=t.indexOf("]"),e.hostname=t.substring(1,r)||null,e.port=t.substring(r+2,o)||null,"/"===e.port&&(e.port=null);else{var a=t.indexOf(":"),u=t.indexOf("/"),s=t.indexOf(":",a+1);-1!==s&&(-1===u||s<u)?(e.hostname=t.substring(0,o)||null,e.port=null):(n=t.substring(0,o).split(":"),e.hostname=n[0]||null,e.port=n[1]||null)}return e.hostname&&"/"!==t.substring(o).charAt(0)&&(o++,t="/"+t),e.preventInvalidHostname&&i.ensureValidHostname(e.hostname,e.protocol),e.port&&i.ensureValidPort(e.port),t.substring(o)||"/"},i.parseAuthority=function(t,e){return t=i.parseUserinfo(t,e),i.parseHost(t,e)},i.parseUserinfo=function(t,e){var r=t;-1!==t.indexOf("\\")&&(t=t.replace(/\\/g,"/"));var n,o=t.indexOf("/"),a=t.lastIndexOf("@",o>-1?o:t.length-1);return a>-1&&(-1===o||a<o)?(n=t.substring(0,a).split(":"),e.username=n[0]?i.decode(n[0]):null,n.shift(),e.password=n[0]?i.decode(n.join(":")):null,t=r.substring(a+1)):(e.username=null,e.password=null),t},i.parseQuery=function(t,e){if(!t)return{};if(!(t=t.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,o,a={},u=t.split("&"),c=u.length,l=0;l<c;l++)r=u[l].split("="),n=i.decodeQuery(r.shift(),e),o=r.length?i.decodeQuery(r.join("="),e):null,"__proto__"!==n&&(s.call(a,n)?("string"!=typeof a[n]&&null!==a[n]||(a[n]=[a[n]]),a[n].push(o)):a[n]=o);return a},i.build=function(t){var e="",r=!1;return t.protocol&&(e+=t.protocol+":"),t.urn||!e&&!t.hostname||(e+="//",r=!0),e+=i.buildAuthority(t)||"","string"==typeof t.path&&("/"!==t.path.charAt(0)&&r&&(e+="/"),e+=t.path),"string"==typeof t.query&&t.query&&(e+="?"+t.query),"string"==typeof t.fragment&&t.fragment&&(e+="#"+t.fragment),e},i.buildHost=function(t){var e="";return t.hostname?(i.ip6_expression.test(t.hostname)?e+="["+t.hostname+"]":e+=t.hostname,t.port&&(e+=":"+t.port),e):""},i.buildAuthority=function(t){return i.buildUserinfo(t)+i.buildHost(t)},i.buildUserinfo=function(t){var e="";return t.username&&(e+=i.encode(t.username)),t.password&&(e+=":"+i.encode(t.password)),e&&(e+="@"),e},i.buildQuery=function(t,e,r){var n,o,a,u,c="";for(o in t)if("__proto__"!==o&&s.call(t,o))if(f(t[o]))for(n={},a=0,u=t[o].length;a<u;a++)void 0!==t[o][a]&&void 0===n[t[o][a]+""]&&(c+="&"+i.buildQueryParameter(o,t[o][a],r),!0!==e&&(n[t[o][a]+""]=!0));else void 0!==t[o]&&(c+="&"+i.buildQueryParameter(o,t[o],r));return c.substring(1)},i.buildQueryParameter=function(t,e,r){return i.encodeQuery(t,r)+(null!==e?"="+i.encodeQuery(e,r):"")},i.addQuery=function(t,e,r){if("object"===a(e))for(var n in e)s.call(e,n)&&i.addQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===t[e])return void(t[e]=r);"string"==typeof t[e]&&(t[e]=[t[e]]),f(r)||(r=[r]),t[e]=(t[e]||[]).concat(r)}},i.setQuery=function(t,e,r){if("object"===a(e))for(var n in e)s.call(e,n)&&i.setQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");t[e]=void 0===r?null:r}},i.removeQuery=function(t,e,r){var n,o,u;if(f(e))for(n=0,o=e.length;n<o;n++)t[e[n]]=void 0;else if("RegExp"===l(e))for(u in t)e.test(u)&&(t[u]=void 0);else if("object"===a(e))for(u in e)s.call(e,u)&&i.removeQuery(t,u,e[u]);else{if("string"!=typeof e)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===l(r)?!f(t[e])&&r.test(t[e])?t[e]=void 0:t[e]=h(t[e],r):t[e]!==String(r)||f(r)&&1!==r.length?f(t[e])&&(t[e]=h(t[e],r)):t[e]=void 0:t[e]=void 0}},i.hasQuery=function(t,e,r,n){switch(l(e)){case"String":break;case"RegExp":for(var o in t)if(s.call(t,o)&&e.test(o)&&(void 0===r||i.hasQuery(t,o,r)))return!0;return!1;case"Object":for(var a in e)if(s.call(e,a)&&!i.hasQuery(t,a,e[a]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(r)){case"Undefined":return e in t;case"Boolean":return r===Boolean(f(t[e])?t[e].length:t[e]);case"Function":return!!r(t[e],e,t);case"Array":return!!f(t[e])&&(n?p:d)(t[e],r);case"RegExp":return f(t[e])?!!n&&p(t[e],r):Boolean(t[e]&&t[e].match(r));case"Number":r=String(r);case"String":return f(t[e])?!!n&&p(t[e],r):t[e]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var t=[],e=[],r=0,n=0;n<arguments.length;n++){var o=new i(arguments[n]);t.push(o);for(var a=o.segment(),u=0;u<a.length;u++)"string"==typeof a[u]&&e.push(a[u]),a[u]&&r++}if(!e.length||!r)return new i("");var s=new i("").segment(e);return""!==t[0].path()&&"/"!==t[0].path().slice(0,1)||s.path("/"+s.path()),s.normalize()},i.commonPath=function(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r<n;r++)if(t.charAt(r)!==e.charAt(r)){r--;break}return r<1?t.charAt(0)===e.charAt(0)&&"/"===t.charAt(0)?"/":"":("/"===t.charAt(r)&&"/"===e.charAt(r)||(r=t.substring(0,r).lastIndexOf("/")),t.substring(0,r+1))},i.withinString=function(t,e,r){r||(r={});var n=r.start||i.findUri.start,o=r.end||i.findUri.end,a=r.trim||i.findUri.trim,u=r.parens||i.findUri.parens,s=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var c=n.exec(t);if(!c)break;var l=c.index;if(r.ignoreHtml){var f=t.slice(Math.max(l-3,0),l);if(f&&s.test(f))continue}for(var h=l+t.slice(l).search(o),p=t.slice(l,h),d=-1;;){var v=u.exec(p);if(!v)break;var y=v.index+v[0].length;d=Math.max(d,y)}if(!((p=d>-1?p.slice(0,d)+p.slice(d).replace(a,""):p.replace(a,"")).length<=c[0].length||r.ignore&&r.ignore.test(p))){var m=e(p,l,h=l+p.length,t);void 0!==m?(m=String(m),t=t.slice(0,l)+m+t.slice(h),n.lastIndex=l+m.length):n.lastIndex=h}}return n.lastIndex=0,t},i.ensureValidHostname=function(e,r){var n=!!e,o=!1;if(!!r&&(o=p(i.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(e&&e.match(i.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(e).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&e>0&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},i.noConflict=function(t){if(t){var e={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(e.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(e.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(e.SecondLevelDomains=n.SecondLevelDomains.noConflict()),e}return n.URI===this&&(n.URI=o),this},u.build=function(t){return!0===t?this._deferred_build=!0:(void 0===t||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new i(this)},u.valueOf=u.toString=function(){return this.build(!1)._string},u.protocol=k("protocol"),u.username=k("username"),u.password=k("password"),u.hostname=k("hostname"),u.port=k("port"),u.query=E("query","?"),u.fragment=E("fragment","#"),u.search=function(t,e){var r=this.query(t,e);return"string"==typeof r&&r.length?"?"+r:r},u.hash=function(t,e){var r=this.fragment(t,e);return"string"==typeof r&&r.length?"#"+r:r},u.pathname=function(t,e){if(void 0===t||!0===t){var r=this._parts.path||(this._parts.hostname?"/":"");return t?(this._parts.urn?i.decodeUrnPath:i.decodePath)(r):r}return this._parts.urn?this._parts.path=t?i.recodeUrnPath(t):"":this._parts.path=t?i.recodePath(t):"/",this.build(!e),this},u.path=u.pathname,u.href=function(t,e){var r;if(void 0===t)return this.toString();this._string="",this._parts=i._parts();var n=t instanceof i,o="object"===a(t)&&(t.hostname||t.path||t.pathname);t.nodeName&&(t=t[i.getDomAttribute(t)]||"",o=!1);if(!n&&o&&void 0!==t.pathname&&(t=t.toString()),"string"==typeof t||t instanceof String)this._parts=i.parse(String(t),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var u=n?t._parts:t;for(r in u)"query"!==r&&s.call(this._parts,r)&&(this._parts[r]=u[r]);u.query&&this.query(u.query,!1)}return this.build(!e),this},u.is=function(t){var e=!1,n=!1,o=!1,a=!1,u=!1,s=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,n=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),u=(a=!(e=n||o))&&r&&r.has(this._parts.hostname),s=a&&i.idn_expression.test(this._parts.hostname),c=a&&i.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return a;case"sld":return u;case"ip":return e;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return o;case"idn":return s;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var x=u.protocol,A=u.port,O=u.hostname;u.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,t,e)},u.scheme=u.protocol,u.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(0===t&&(t=null),t&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),i.ensureValidPort(t))),A.call(this,t,e))},u.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(t,r))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=r.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(t,this._parts.protocol)}return O.call(this,t,e)},u.origin=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=i(t);return this.protocol(n.protocol()).authority(n.authority()).build(!e),this},u.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},u.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},u.userinfo=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=i.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==t[t.length-1]&&(t+="@"),i.parseUserinfo(t,this._parts),this.build(!e),this},u.resource=function(t,e){var r;return void 0===t?this.path()+this.search()+this.hash():(r=i.parse(t),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!e),this)},u.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,n),a=new RegExp("^"+c(o));if(t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&i.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,t),this.build(!e),this},u.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(e).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=t;else{var o=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,t)}return this.build(!e),this},u.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(n+1);return!0!==e&&r&&r.list[o.toLowerCase()]&&r.get(this._parts.hostname)||o}var i;if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]');i=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,t)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,t)}return this.build(!e),this},u.directory=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return t?i.decodePath(n):n}var o=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,o),u=new RegExp("^"+c(a));return this.is("relative")||(t||(t="/"),"/"!==t.charAt(0)&&(t="/"+t)),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=i.recodePath(t),this._parts.path=this._parts.path.replace(u,t),this.build(!e),this},u.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("string"!=typeof t){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return t?i.decodePathSegment(n):n}var o=!1;"/"===t.charAt(0)&&(t=t.substring(1)),t.match(/\.?\//)&&(o=!0);var a=new RegExp(c(this.filename())+"$");return t=i.recodePath(t),this._parts.path=this._parts.path.replace(a,t),o?this.normalizePath(e):this.build(!e),this},u.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,o=this.filename(),a=o.lastIndexOf(".");return-1===a?"":(r=o.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",t?i.decodePathSegment(n):n)}"."===t.charAt(0)&&(t=t.substring(1));var u,s=this.suffix();if(s)u=t?new RegExp(c(s)+"$"):new RegExp(c("."+s)+"$");else{if(!t)return this;this._parts.path+="."+i.recodePath(t)}return u&&(t=i.recodePath(t),this._parts.path=this._parts.path.replace(u,t)),this.build(!e),this},u.segment=function(t,e,r){var n=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),a=o.split(n);if(void 0!==t&&"number"!=typeof t&&(r=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw new Error('Bad segment "'+t+'", must be 0-based integer');if(i&&a.shift(),t<0&&(t=Math.max(a.length+t,0)),void 0===e)return void 0===t?a:a[t];if(null===t||void 0===a[t])if(f(e)){a=[];for(var u=0,s=e.length;u<s;u++)(e[u].length||a.length&&a[a.length-1].length)&&(a.length&&!a[a.length-1].length&&a.pop(),a.push(v(e[u])))}else(e||"string"==typeof e)&&(e=v(e),""===a[a.length-1]?a[a.length-1]=e:a.push(e));else e?a[t]=v(e):a.splice(t,1);return i&&a.unshift(""),this.path(a.join(n),r)},u.segmentCoded=function(t,e,r){var n,o,a;if("number"!=typeof t&&(r=e,e=t,t=void 0),void 0===e){if(f(n=this.segment(t,e,r)))for(o=0,a=n.length;o<a;o++)n[o]=i.decode(n[o]);else n=void 0!==n?i.decode(n):void 0;return n}if(f(e))for(o=0,a=e.length;o<a;o++)e[o]=i.encode(e[o]);else e="string"==typeof e||e instanceof String?i.encode(e):e;return this.segment(t,e,r)};var S=u.query;return u.query=function(t,e){if(!0===t)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof t){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=t.call(this,r);return this._parts.query=i.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this}return void 0!==t&&"string"!=typeof t?(this._parts.query=i.buildQuery(t,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this):S.call(this,t,e)},u.setQuery=function(t,e,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof t||t instanceof String)n[t]=void 0!==e?e:null;else{if("object"!==a(t))throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in t)s.call(t,o)&&(n[o]=t[o])}return this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof t&&(r=e),this.build(!r),this},u.addQuery=function(t,e,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(n,t,void 0===e?null:e),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof t&&(r=e),this.build(!r),this},u.removeQuery=function(t,e,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(n,t,e),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof t&&(r=e),this.build(!r),this},u.hasQuery=function(t,e,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(n,t,e,r)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},u.normalizeProtocol=function(t){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!t)),this},u.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},u.normalizePort=function(t){return"string"==typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!t)),this},u.normalizePath=function(t){var e,r=this._parts.path;if(!r)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!t),this;if("/"===this._parts.path)return this;var n,o,a="";for("/"!==(r=i.recodePath(r)).charAt(0)&&(e=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(a=r.substring(1).match(/^(\.\.\/)+/)||"")&&(a=a[0]);-1!==(n=r.search(/\/\.\.(\/|$)/));)0!==n?(-1===(o=r.substring(0,n).lastIndexOf("/"))&&(o=n),r=r.substring(0,o)+r.substring(n+3)):r=r.substring(3);return e&&this.is("relative")&&(r=a+r.substring(1)),this._parts.path=r,this.build(!t),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(t){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!t)),this},u.normalizeFragment=function(t){return this._parts.fragment||(this._parts.fragment=null,this.build(!t)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var t=i.encode,e=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=t,i.decode=e}return this},u.unicode=function(){var t=i.encode,e=i.decode;i.encode=m,i.decode=unescape;try{this.normalize()}finally{i.encode=t,i.decode=e}return this},u.readable=function(){var e=this.clone();e.username("").password("").normalize();var r="";if(e._parts.protocol&&(r+=e._parts.protocol+"://"),e._parts.hostname&&(e.is("punycode")&&t?(r+=t.toUnicode(e._parts.hostname),e._parts.port&&(r+=":"+e._parts.port)):r+=e.host()),e._parts.hostname&&e._parts.path&&"/"!==e._parts.path.charAt(0)&&(r+="/"),r+=e.path(!0),e._parts.query){for(var n="",o=0,a=e._parts.query.split("&"),u=a.length;o<u;o++){var s=(a[o]||"").split("=");n+="&"+i.decodeQuery(s[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==s[1]&&(n+="="+i.decodeQuery(s[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}r+="?"+n.substring(1)}return r+=i.decodeQuery(e.hash(),!0)},u.absoluteTo=function(t){var e,r,n,o=this.clone(),a=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(t instanceof i||(t=new i(t)),o._parts.protocol)return o;if(o._parts.protocol=t._parts.protocol,this._parts.hostname)return o;for(r=0;n=a[r];r++)o._parts[n]=t._parts[n];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(e=(e=t.directory())||(0===t.path().indexOf("/")?"/":""),o._parts.path=(e?e+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=t._parts.path,o._parts.query||(o._parts.query=t._parts.query)),o.build(),o},u.relativeTo=function(t){var e,r,n,o,a,u=this.clone().normalize();if(u._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(t=new i(t).normalize(),e=u._parts,r=t._parts,o=u.path(),a=t.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==a.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(e.protocol===r.protocol&&(e.protocol=null),e.username!==r.username||e.password!==r.password)return u.build();if(null!==e.protocol||null!==e.username||null!==e.password)return u.build();if(e.hostname!==r.hostname||e.port!==r.port)return u.build();if(e.hostname=null,e.port=null,o===a)return e.path="",u.build();if(!(n=i.commonPath(o,a)))return u.build();var s=r.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return e.path=s+e.path.substring(n.length)||"./",u.build()},u.equals=function(t){var e,r,n,o,a,u=this.clone(),c=new i(t),l={};if(u.normalize(),c.normalize(),u.toString()===c.toString())return!0;if(n=u.query(),o=c.query(),u.query(""),c.query(""),u.toString()!==c.toString())return!1;if(n.length!==o.length)return!1;for(a in e=i.parseQuery(n,this._parts.escapeQuerySpace),r=i.parseQuery(o,this._parts.escapeQuerySpace),e)if(s.call(e,a)){if(f(e[a])){if(!d(e[a],r[a]))return!1}else if(e[a]!==r[a])return!1;l[a]=!0}for(a in r)if(s.call(r,a)&&!l[a])return!1;return!0},u.preventInvalidHostname=function(t){return this._parts.preventInvalidHostname=!!t,this},u.duplicateQueryParameters=function(t){return this._parts.duplicateQueryParameters=!!t,this},u.escapeQuerySpace=function(t){return this._parts.escapeQuerySpace=!!t,this},i}))}).call(this,r(9)(t))},function(t,e,r){"use strict";r.r(e),r.d(e,"Deflate",(function(){return $e})),r.d(e,"Inflate",(function(){return nr})),r.d(e,"constants",(function(){return ur})),r.d(e,"default",(function(){return sr})),r.d(e,"deflate",(function(){return tr})),r.d(e,"deflateRaw",(function(){return er})),r.d(e,"gzip",(function(){return rr})),r.d(e,"inflate",(function(){return or})),r.d(e,"inflateRaw",(function(){return ir})),r.d(e,"ungzip",(function(){return ar}));function n(t){let e=t.length;for(;--e>=0;)t[e]=0}const o=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),i=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),u=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);n(s);const c=new Array(60);n(c);const l=new Array(512);n(l);const f=new Array(256);n(f);const h=new Array(29);n(h);const p=new Array(30);function d(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}let v,y,m;function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}n(p);const b=t=>t<256?l[t]:l[256+(t>>>7)],w=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},_=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},k=(t,e,r)=>{_(t,r[2*e],r[2*e+1])},E=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},x=(t,e,r)=>{const n=new Array(16);let o,i,a=0;for(o=1;o<=15;o++)a=a+r[o-1]<<1,n[o]=a;for(i=0;i<=e;i++){let e=t[2*i+1];0!==e&&(t[2*i]=E(n[e]++,e))}},A=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},O=t=>{t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=(t,e,r,n)=>{const o=2*e,i=2*r;return t[o]<t[i]||t[o]===t[i]&&n[e]<=n[r]},P=(t,e,r)=>{const n=t.heap[r];let o=r<<1;for(;o<=t.heap_len&&(o<t.heap_len&&S(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!S(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n},j=(t,e,r)=>{let n,a,u,s,c=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+c++],n+=(255&t.pending_buf[t.sym_buf+c++])<<8,a=t.pending_buf[t.sym_buf+c++],0===n?k(t,a,e):(u=f[a],k(t,u+256+1,e),s=o[u],0!==s&&(a-=h[u],_(t,a,s)),n--,u=b(n),k(t,u,r),s=i[u],0!==s&&(n-=p[u],_(t,n,s)))}while(c<t.sym_next);k(t,256,e)},T=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,i=e.stat_desc.elems;let a,u,s,c=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<i;a++)0!==r[2*a]?(t.heap[++t.heap_len]=c=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)s=t.heap[++t.heap_len]=c<2?++c:0,r[2*s]=1,t.depth[s]=0,t.opt_len--,o&&(t.static_len-=n[2*s+1]);for(e.max_code=c,a=t.heap_len>>1;a>=1;a--)P(t,r,a);s=i;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],P(t,r,1),u=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=u,r[2*s]=r[2*a]+r[2*u],t.depth[s]=(t.depth[a]>=t.depth[u]?t.depth[a]:t.depth[u])+1,r[2*a+1]=r[2*u+1]=s,t.heap[1]=s++,P(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,s=e.stat_desc.max_length;let c,l,f,h,p,d,v=0;for(h=0;h<=15;h++)t.bl_count[h]=0;for(r[2*t.heap[t.heap_max]+1]=0,c=t.heap_max+1;c<573;c++)l=t.heap[c],h=r[2*r[2*l+1]+1]+1,h>s&&(h=s,v++),r[2*l+1]=h,l>n||(t.bl_count[h]++,p=0,l>=u&&(p=a[l-u]),d=r[2*l],t.opt_len+=d*(h+p),i&&(t.static_len+=d*(o[2*l+1]+p)));if(0!==v){do{for(h=s-1;0===t.bl_count[h];)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[s]--,v-=2}while(v>0);for(h=s;0!==h;h--)for(l=t.bl_count[h];0!==l;)f=t.heap[--c],f>n||(r[2*f+1]!==h&&(t.opt_len+=(h-r[2*f+1])*r[2*f],r[2*f+1]=h),l--)}})(t,e),x(r,c,t.bl_count)},R=(t,e,r)=>{let n,o,i=-1,a=e[1],u=0,s=7,c=4;for(0===a&&(s=138,c=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)o=a,a=e[2*(n+1)+1],++u<s&&o===a||(u<c?t.bl_tree[2*o]+=u:0!==o?(o!==i&&t.bl_tree[2*o]++,t.bl_tree[32]++):u<=10?t.bl_tree[34]++:t.bl_tree[36]++,u=0,i=o,0===a?(s=138,c=3):o===a?(s=6,c=3):(s=7,c=4))},N=(t,e,r)=>{let n,o,i=-1,a=e[1],u=0,s=7,c=4;for(0===a&&(s=138,c=3),n=0;n<=r;n++)if(o=a,a=e[2*(n+1)+1],!(++u<s&&o===a)){if(u<c)do{k(t,o,t.bl_tree)}while(0!=--u);else 0!==o?(o!==i&&(k(t,o,t.bl_tree),u--),k(t,16,t.bl_tree),_(t,u-3,2)):u<=10?(k(t,17,t.bl_tree),_(t,u-3,3)):(k(t,18,t.bl_tree),_(t,u-11,7));u=0,i=o,0===a?(s=138,c=3):o===a?(s=6,c=3):(s=7,c=4)}};let I=!1;const L=(t,e,r,n)=>{_(t,0+(n?1:0),3),O(t),w(t,r),w(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r};var C={_tr_init:t=>{I||((()=>{let t,e,r,n,u;const g=new Array(16);for(r=0,n=0;n<28;n++)for(h[n]=r,t=0;t<1<<o[n];t++)f[r++]=n;for(f[r-1]=n,u=0,n=0;n<16;n++)for(p[n]=u,t=0;t<1<<i[n];t++)l[u++]=n;for(u>>=7;n<30;n++)for(p[n]=u<<7,t=0;t<1<<i[n]-7;t++)l[256+u++]=n;for(e=0;e<=15;e++)g[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,g[8]++;for(;t<=255;)s[2*t+1]=9,t++,g[9]++;for(;t<=279;)s[2*t+1]=7,t++,g[7]++;for(;t<=287;)s[2*t+1]=8,t++,g[8]++;for(x(s,287,g),t=0;t<30;t++)c[2*t+1]=5,c[2*t]=E(t,5);v=new d(s,o,257,286,15),y=new d(c,i,0,30,15),m=new d(new Array(0),a,0,19,7)})(),I=!0),t.l_desc=new g(t.dyn_ltree,v),t.d_desc=new g(t.dyn_dtree,y),t.bl_desc=new g(t.bl_tree,m),t.bi_buf=0,t.bi_valid=0,A(t)},_tr_stored_block:L,_tr_flush_block:(t,e,r,n)=>{let o,i,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),T(t,t.l_desc),T(t,t.d_desc),a=(t=>{let e;for(R(t,t.dyn_ltree,t.l_desc.max_code),R(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*u[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,i=t.static_len+3+7>>>3,i<=o&&(o=i)):o=i=r+5,r+4<=o&&-1!==e?L(t,e,r,n):4===t.strategy||i===o?(_(t,2+(n?1:0),3),j(t,s,c)):(_(t,4+(n?1:0),3),((t,e,r,n)=>{let o;for(_(t,e-257,5),_(t,r-1,5),_(t,n-4,4),o=0;o<n;o++)_(t,t.bl_tree[2*u[o]+1],3);N(t,t.dyn_ltree,e-1),N(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),j(t,t.dyn_ltree,t.dyn_dtree)),A(t),n&&O(t)},_tr_tally:(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(f[r]+256+1)]++,t.dyn_dtree[2*b(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{_(t,2,3),k(t,256,s),(t=>{16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var M=(t,e,r,n)=>{let o=65535&t|0,i=t>>>16&65535|0,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{o=o+e[n++]|0,i=i+o|0}while(--a);o%=65521,i%=65521}return o|i<<16|0};const B=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());var F=(t,e,r,n)=>{const o=B,i=n+r;t^=-1;for(let r=n;r<i;r++)t=t>>>8^o[255&(t^e[r])];return-1^t},D={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},U={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:z,_tr_stored_block:G,_tr_flush_block:H,_tr_tally:q,_tr_align:K}=C,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:Q,Z_FULL_FLUSH:V,Z_FINISH:J,Z_BLOCK:Y,Z_OK:Z,Z_STREAM_END:X,Z_STREAM_ERROR:$,Z_DATA_ERROR:tt,Z_BUF_ERROR:et,Z_DEFAULT_COMPRESSION:rt,Z_FILTERED:nt,Z_HUFFMAN_ONLY:ot,Z_RLE:it,Z_FIXED:at,Z_DEFAULT_STRATEGY:ut,Z_UNKNOWN:st,Z_DEFLATED:ct}=U,lt=(t,e)=>(t.msg=D[e],e),ft=t=>2*t-(t>4?9:0),ht=t=>{let e=t.length;for(;--e>=0;)t[e]=0},pt=t=>{let e,r,n,o=t.w_size;e=t.hash_size,n=e;do{r=t.head[--n],t.head[n]=r>=o?r-o:0}while(--e);e=o,n=e;do{r=t.prev[--n],t.prev[n]=r>=o?r-o:0}while(--e)};let dt=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const vt=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},yt=(t,e)=>{H(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,vt(t.strm)},mt=(t,e)=>{t.pending_buf[t.pending++]=e},gt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,r,n)=>{let o=t.avail_in;return o>n&&(o=n),0===o?0:(t.avail_in-=o,e.set(t.input.subarray(t.next_in,t.next_in+o),r),1===t.state.wrap?t.adler=M(t.adler,e,o,r):2===t.state.wrap&&(t.adler=F(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)},wt=(t,e)=>{let r,n,o=t.max_chain_length,i=t.strstart,a=t.prev_length,u=t.nice_match;const s=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,c=t.window,l=t.w_mask,f=t.prev,h=t.strstart+258;let p=c[i+a-1],d=c[i+a];t.prev_length>=t.good_match&&(o>>=2),u>t.lookahead&&(u=t.lookahead);do{if(r=e,c[r+a]===d&&c[r+a-1]===p&&c[r]===c[i]&&c[++r]===c[i+1]){i+=2,r++;do{}while(c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&i<h);if(n=258-(h-i),i=h-258,n>a){if(t.match_start=e,a=n,n>=u)break;p=c[i+a-1],d=c[i+a]}}}while((e=f[e&l])>s&&0!=--o);return a<=t.lookahead?a:t.lookahead},_t=t=>{const e=t.w_size;let r,n,o;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),pt(t),n+=e),0===t.strm.avail_in)break;if(r=bt(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=dt(t,t.ins_h,t.window[o+1]);t.insert&&(t.ins_h=dt(t,t.ins_h,t.window[o+3-1]),t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let r,n,o,i=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,a=0,u=t.strm.avail_in;do{if(r=65535,o=t.bi_valid+42>>3,t.strm.avail_out<o)break;if(o=t.strm.avail_out-o,n=t.strstart-t.block_start,r>n+t.strm.avail_in&&(r=n+t.strm.avail_in),r>o&&(r=o),r<i&&(0===r&&e!==J||e===W||r!==n+t.strm.avail_in))break;a=e===J&&r===n+t.strm.avail_in?1:0,G(t,0,0,a),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,vt(t.strm),n&&(n>r&&(n=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,r-=n),r&&(bt(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===a);return u-=t.strm.avail_in,u&&(u>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=u&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-u,t.strm.next_in),t.strstart),t.strstart+=u,t.insert+=u>t.w_size-t.insert?t.w_size-t.insert:u),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),a?4:e!==W&&e!==J&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(o=t.window_size-t.strstart,t.strm.avail_in>o&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,o+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),o>t.strm.avail_in&&(o=t.strm.avail_in),o&&(bt(t.strm,t.window,t.strstart,o),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.high_water<t.strstart&&(t.high_water=t.strstart),o=t.bi_valid+42>>3,o=t.pending_buf_size-o>65535?65535:t.pending_buf_size-o,i=o>t.w_size?t.w_size:o,n=t.strstart-t.block_start,(n>=i||(n||e===J)&&e!==W&&0===t.strm.avail_in&&n<=o)&&(r=n>o?o:n,a=e===J&&0===t.strm.avail_in&&r===n?1:0,G(t,t.block_start,r,a),t.block_start+=r,vt(t.strm)),a?3:1)},Et=(t,e)=>{let r,n;for(;;){if(t.lookahead<262){if(_t(t),t.lookahead<262&&e===W)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-262&&(t.match_length=wt(t,r)),t.match_length>=3)if(n=q(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=dt(t,t.ins_h,t.window[t.strstart+1]);else n=q(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===J?(yt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(yt(t,!1),0===t.strm.avail_out)?1:2},xt=(t,e)=>{let r,n,o;for(;;){if(t.lookahead<262){if(_t(t),t.lookahead<262&&e===W)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-262&&(t.match_length=wt(t,r),t.match_length<=5&&(t.strategy===nt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-3,n=q(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=o&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=q(t,0,t.window[t.strstart-1]),n&&yt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=q(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===J?(yt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(yt(t,!1),0===t.strm.avail_out)?1:2};function At(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}const Ot=[new At(0,0,0,0,kt),new At(4,4,8,4,Et),new At(4,5,16,8,Et),new At(4,6,32,32,Et),new At(4,4,16,16,xt),new At(8,16,32,32,xt),new At(8,16,128,128,xt),new At(8,32,128,256,xt),new At(32,128,258,1024,xt),new At(32,258,258,4096,xt)];function St(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ct,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ht(this.dyn_ltree),ht(this.dyn_dtree),ht(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ht(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ht(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Pt=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},jt=t=>{if(Pt(t))return lt(t,$);t.total_in=t.total_out=0,t.data_type=st;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,z(e),Z},Tt=t=>{const e=jt(t);var r;return e===Z&&((r=t.state).window_size=2*r.w_size,ht(r.head),r.max_lazy_match=Ot[r.level].max_lazy,r.good_match=Ot[r.level].good_length,r.nice_match=Ot[r.level].nice_length,r.max_chain_length=Ot[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},Rt=(t,e,r,n,o,i)=>{if(!t)return $;let a=1;if(e===rt&&(e=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>9||r!==ct||n<8||n>15||e<0||e>9||i<0||i>at||8===n&&1!==a)return lt(t,$);8===n&&(n=9);const u=new St;return t.state=u,u.strm=t,u.status=42,u.wrap=a,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new Uint8Array(2*u.w_size),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=3*(u.lit_bufsize-1),u.level=e,u.strategy=i,u.method=r,Tt(t)};var Nt={deflateInit:(t,e)=>Rt(t,e,ct,15,8,ut),deflateInit2:Rt,deflateReset:Tt,deflateResetKeep:jt,deflateSetHeader:(t,e)=>Pt(t)||2!==t.state.wrap?$:(t.state.gzhead=e,Z),deflate:(t,e)=>{if(Pt(t)||e>Y||e<0)return t?lt(t,$):$;const r=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===r.status&&e!==J)return lt(t,0===t.avail_out?et:$);const n=r.last_flush;if(r.last_flush=e,0!==r.pending){if(vt(t),0===t.avail_out)return r.last_flush=-1,Z}else if(0===t.avail_in&&ft(e)<=ft(n)&&e!==J)return lt(t,et);if(666===r.status&&0!==t.avail_in)return lt(t,et);if(42===r.status&&0===r.wrap&&(r.status=113),42===r.status){let e=ct+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=ot||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,gt(r,e),0!==r.strstart&&(gt(r,t.adler>>>16),gt(r,65535&t.adler)),t.adler=1,r.status=113,vt(t),0!==r.pending)return r.last_flush=-1,Z}if(57===r.status)if(t.adler=0,mt(r,31),mt(r,139),mt(r,8),r.gzhead)mt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),mt(r,255&r.gzhead.time),mt(r,r.gzhead.time>>8&255),mt(r,r.gzhead.time>>16&255),mt(r,r.gzhead.time>>24&255),mt(r,9===r.level?2:r.strategy>=ot||r.level<2?4:0),mt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(mt(r,255&r.gzhead.extra.length),mt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=F(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(mt(r,0),mt(r,0),mt(r,0),mt(r,0),mt(r,0),mt(r,9===r.level?2:r.strategy>=ot||r.level<2?4:0),mt(r,3),r.status=113,vt(t),0!==r.pending)return r.last_flush=-1,Z;if(69===r.status){if(r.gzhead.extra){let e=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let o=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+o),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>e&&(t.adler=F(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex+=o,vt(t),0!==r.pending)return r.last_flush=-1,Z;e=0,n-=o}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>e&&(t.adler=F(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=F(t.adler,r.pending_buf,r.pending-n,n)),vt(t),0!==r.pending)return r.last_flush=-1,Z;n=0}e=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,mt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=F(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=F(t.adler,r.pending_buf,r.pending-n,n)),vt(t),0!==r.pending)return r.last_flush=-1,Z;n=0}e=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,mt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=F(t.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(vt(t),0!==r.pending))return r.last_flush=-1,Z;mt(r,255&t.adler),mt(r,t.adler>>8&255),t.adler=0}if(r.status=113,vt(t),0!==r.pending)return r.last_flush=-1,Z}if(0!==t.avail_in||0!==r.lookahead||e!==W&&666!==r.status){let n=0===r.level?kt(r,e):r.strategy===ot?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(_t(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,r=q(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===J?(yt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(yt(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===it?((t,e)=>{let r,n,o,i;const a=t.window;for(;;){if(t.lookahead<=258){if(_t(t),t.lookahead<=258&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(o=t.strstart-1,n=a[o],n===a[++o]&&n===a[++o]&&n===a[++o])){i=t.strstart+258;do{}while(n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&o<i);t.match_length=258-(i-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=q(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=q(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===J?(yt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(yt(t,!1),0===t.strm.avail_out)?1:2})(r,e):Ot[r.level].func(r,e);if(3!==n&&4!==n||(r.status=666),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),Z;if(2===n&&(e===Q?K(r):e!==Y&&(G(r,0,0,!1),e===V&&(ht(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),vt(t),0===t.avail_out))return r.last_flush=-1,Z}return e!==J?Z:r.wrap<=0?X:(2===r.wrap?(mt(r,255&t.adler),mt(r,t.adler>>8&255),mt(r,t.adler>>16&255),mt(r,t.adler>>24&255),mt(r,255&t.total_in),mt(r,t.total_in>>8&255),mt(r,t.total_in>>16&255),mt(r,t.total_in>>24&255)):(gt(r,t.adler>>>16),gt(r,65535&t.adler)),vt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Z:X)},deflateEnd:t=>{if(Pt(t))return $;const e=t.state.status;return t.state=null,113===e?lt(t,tt):Z},deflateSetDictionary:(t,e)=>{let r=e.length;if(Pt(t))return $;const n=t.state,o=n.wrap;if(2===o||1===o&&42!==n.status||n.lookahead)return $;if(1===o&&(t.adler=M(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===o&&(ht(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const i=t.avail_in,a=t.next_in,u=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,_t(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=dt(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,_t(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=a,t.input=u,t.avail_in=i,n.wrap=o,Z},deflateInfo:"pako deflate (from Nodeca project)"};const It=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Lt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const e in r)It(r,e)&&(t[e]=r[e])}}return t},Ct=t=>{let e=0;for(let r=0,n=t.length;r<n;r++)e+=t[r].length;const r=new Uint8Array(e);for(let e=0,n=0,o=t.length;e<o;e++){let o=t[e];r.set(o,n),n+=o.length}return r};let Mt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Mt=!1}const Bt=new Uint8Array(256);for(let t=0;t<256;t++)Bt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Bt[254]=Bt[254]=1;var Ft=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,o,i,a=t.length,u=0;for(o=0;o<a;o++)r=t.charCodeAt(o),55296==(64512&r)&&o+1<a&&(n=t.charCodeAt(o+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),o++)),u+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(u),i=0,o=0;i<u;o++)r=t.charCodeAt(o),55296==(64512&r)&&o+1<a&&(n=t.charCodeAt(o+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[i++]=r:r<2048?(e[i++]=192|r>>>6,e[i++]=128|63&r):r<65536?(e[i++]=224|r>>>12,e[i++]=128|r>>>6&63,e[i++]=128|63&r):(e[i++]=240|r>>>18,e[i++]=128|r>>>12&63,e[i++]=128|r>>>6&63,e[i++]=128|63&r);return e},Dt=(t,e)=>{const r=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,o;const i=new Array(2*r);for(o=0,n=0;n<r;){let e=t[n++];if(e<128){i[o++]=e;continue}let a=Bt[e];if(a>4)i[o++]=65533,n+=a-1;else{for(e&=2===a?31:3===a?15:7;a>1&&n<r;)e=e<<6|63&t[n++],a--;a>1?i[o++]=65533:e<65536?i[o++]=e:(e-=65536,i[o++]=55296|e>>10&1023,i[o++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r})(i,o)},Ut=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let r=e-1;for(;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+Bt[t[r]]>e?r:e};var zt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Ht,Z_SYNC_FLUSH:qt,Z_FULL_FLUSH:Kt,Z_FINISH:Wt,Z_OK:Qt,Z_STREAM_END:Vt,Z_DEFAULT_COMPRESSION:Jt,Z_DEFAULT_STRATEGY:Yt,Z_DEFLATED:Zt}=U;function Xt(t){this.options=Lt({level:Jt,method:Zt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Yt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zt,this.strm.avail_out=0;let r=Nt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Qt)throw new Error(D[r]);if(e.header&&Nt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Ft(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=Nt.deflateSetDictionary(this.strm,t),r!==Qt)throw new Error(D[r]);this._dict_set=!0}}function $t(t,e){const r=new Xt(e);if(r.push(t,!0),r.err)throw r.msg||D[r.err];return r.result}Xt.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let o,i;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Wt:Ht,"string"==typeof t?r.input=Ft(t):"[object ArrayBuffer]"===Gt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(i===qt||i===Kt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(o=Nt.deflate(r,i),o===Vt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),o=Nt.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Qt;if(0!==r.avail_out){if(i>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Xt.prototype.onData=function(t){this.chunks.push(t)},Xt.prototype.onEnd=function(t){t===Qt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var te={Deflate:Xt,deflate:$t,deflateRaw:function(t,e){return(e=e||{}).raw=!0,$t(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,$t(t,e)},constants:U};var ee=function(t,e){let r,n,o,i,a,u,s,c,l,f,h,p,d,v,y,m,g,b,w,_,k,E,x,A;const O=t.state;r=t.next_in,x=t.input,n=r+(t.avail_in-5),o=t.next_out,A=t.output,i=o-(e-t.avail_out),a=o+(t.avail_out-257),u=O.dmax,s=O.wsize,c=O.whave,l=O.wnext,f=O.window,h=O.hold,p=O.bits,d=O.lencode,v=O.distcode,y=(1<<O.lenbits)-1,m=(1<<O.distbits)-1;t:do{p<15&&(h+=x[r++]<<p,p+=8,h+=x[r++]<<p,p+=8),g=d[h&y];e:for(;;){if(b=g>>>24,h>>>=b,p-=b,b=g>>>16&255,0===b)A[o++]=65535&g;else{if(!(16&b)){if(0==(64&b)){g=d[(65535&g)+(h&(1<<b)-1)];continue e}if(32&b){O.mode=16191;break t}t.msg="invalid literal/length code",O.mode=16209;break t}w=65535&g,b&=15,b&&(p<b&&(h+=x[r++]<<p,p+=8),w+=h&(1<<b)-1,h>>>=b,p-=b),p<15&&(h+=x[r++]<<p,p+=8,h+=x[r++]<<p,p+=8),g=v[h&m];r:for(;;){if(b=g>>>24,h>>>=b,p-=b,b=g>>>16&255,!(16&b)){if(0==(64&b)){g=v[(65535&g)+(h&(1<<b)-1)];continue r}t.msg="invalid distance code",O.mode=16209;break t}if(_=65535&g,b&=15,p<b&&(h+=x[r++]<<p,p+=8,p<b&&(h+=x[r++]<<p,p+=8)),_+=h&(1<<b)-1,_>u){t.msg="invalid distance too far back",O.mode=16209;break t}if(h>>>=b,p-=b,b=o-i,_>b){if(b=_-b,b>c&&O.sane){t.msg="invalid distance too far back",O.mode=16209;break t}if(k=0,E=f,0===l){if(k+=s-b,b<w){w-=b;do{A[o++]=f[k++]}while(--b);k=o-_,E=A}}else if(l<b){if(k+=s+l-b,b-=l,b<w){w-=b;do{A[o++]=f[k++]}while(--b);if(k=0,l<w){b=l,w-=b;do{A[o++]=f[k++]}while(--b);k=o-_,E=A}}}else if(k+=l-b,b<w){w-=b;do{A[o++]=f[k++]}while(--b);k=o-_,E=A}for(;w>2;)A[o++]=E[k++],A[o++]=E[k++],A[o++]=E[k++],w-=3;w&&(A[o++]=E[k++],w>1&&(A[o++]=E[k++]))}else{k=o-_;do{A[o++]=A[k++],A[o++]=A[k++],A[o++]=A[k++],w-=3}while(w>2);w&&(A[o++]=A[k++],w>1&&(A[o++]=A[k++]))}break}}break}}while(r<n&&o<a);w=p>>3,r-=w,p-=w<<3,h&=(1<<p)-1,t.next_in=r,t.next_out=o,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=o<a?a-o+257:257-(o-a),O.hold=h,O.bits=p};const re=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ne=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),oe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ie=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ae=(t,e,r,n,o,i,a,u)=>{const s=u.bits;let c,l,f,h,p,d,v=0,y=0,m=0,g=0,b=0,w=0,_=0,k=0,E=0,x=0,A=null;const O=new Uint16Array(16),S=new Uint16Array(16);let P,j,T,R=null;for(v=0;v<=15;v++)O[v]=0;for(y=0;y<n;y++)O[e[r+y]]++;for(b=s,g=15;g>=1&&0===O[g];g--);if(b>g&&(b=g),0===g)return o[i++]=20971520,o[i++]=20971520,u.bits=1,0;for(m=1;m<g&&0===O[m];m++);for(b<m&&(b=m),k=1,v=1;v<=15;v++)if(k<<=1,k-=O[v],k<0)return-1;if(k>0&&(0===t||1!==g))return-1;for(S[1]=0,v=1;v<15;v++)S[v+1]=S[v]+O[v];for(y=0;y<n;y++)0!==e[r+y]&&(a[S[e[r+y]]++]=y);if(0===t?(A=R=a,d=20):1===t?(A=re,R=ne,d=257):(A=oe,R=ie,d=0),x=0,y=0,v=m,p=i,w=b,_=0,f=-1,E=1<<b,h=E-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){P=v-_,a[y]+1<d?(j=0,T=a[y]):a[y]>=d?(j=R[a[y]-d],T=A[a[y]-d]):(j=96,T=0),c=1<<v-_,l=1<<w,m=l;do{l-=c,o[p+(x>>_)+l]=P<<24|j<<16|T|0}while(0!==l);for(c=1<<v-1;x&c;)c>>=1;if(0!==c?(x&=c-1,x+=c):x=0,y++,0==--O[v]){if(v===g)break;v=e[r+a[y]]}if(v>b&&(x&h)!==f){for(0===_&&(_=b),p+=m,w=v-_,k=1<<w;w+_<g&&(k-=O[w+_],!(k<=0));)w++,k<<=1;if(E+=1<<w,1===t&&E>852||2===t&&E>592)return 1;f=x&h,o[f]=b<<24|w<<16|p-i|0}}return 0!==x&&(o[p+x]=v-_<<24|64<<16|0),u.bits=b,0};const{Z_FINISH:ue,Z_BLOCK:se,Z_TREES:ce,Z_OK:le,Z_STREAM_END:fe,Z_NEED_DICT:he,Z_STREAM_ERROR:pe,Z_DATA_ERROR:de,Z_MEM_ERROR:ve,Z_BUF_ERROR:ye,Z_DEFLATED:me}=U,ge=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function we(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _e=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(_e(t))return pe;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},Ee=t=>{if(_e(t))return pe;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},xe=(t,e)=>{let r;if(_e(t))return pe;const n=t.state;return e<0?(r=0,e=-e):(r=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?pe:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Ee(t))},Ae=(t,e)=>{if(!t)return pe;const r=new we;t.state=r,r.strm=t,r.window=null,r.mode=16180;const n=xe(t,e);return n!==le&&(t.state=null),n};let Oe,Se,Pe=!0;const je=t=>{if(Pe){Oe=new Int32Array(512),Se=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ae(1,t.lens,0,288,Oe,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ae(2,t.lens,0,32,Se,0,t.work,{bits:5}),Pe=!1}t.lencode=Oe,t.lenbits=9,t.distcode=Se,t.distbits=5},Te=(t,e,r,n)=>{let o;const i=t.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),n>=i.wsize?(i.window.set(e.subarray(r-i.wsize,r),0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>n&&(o=n),i.window.set(e.subarray(r-n,r-n+o),i.wnext),(n-=o)?(i.window.set(e.subarray(r-n,r),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0};var Re={inflateReset:Ee,inflateReset2:xe,inflateResetKeep:ke,inflateInit:t=>Ae(t,15),inflateInit2:Ae,inflate:(t,e)=>{let r,n,o,i,a,u,s,c,l,f,h,p,d,v,y,m,g,b,w,_,k,E,x=0;const A=new Uint8Array(4);let O,S;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_e(t)||!t.output||!t.input&&0!==t.avail_in)return pe;r=t.state,16191===r.mode&&(r.mode=16192),a=t.next_out,o=t.output,s=t.avail_out,i=t.next_in,n=t.input,u=t.avail_in,c=r.hold,l=r.bits,f=u,h=s,E=le;t:for(;;)switch(r.mode){case 16180:if(0===r.wrap){r.mode=16192;break}for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(2&r.wrap&&35615===c){0===r.wbits&&(r.wbits=15),r.check=0,A[0]=255&c,A[1]=c>>>8&255,r.check=F(r.check,A,2,0),c=0,l=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=ge;break}if((15&c)!==me){t.msg="unknown compression method",r.mode=ge;break}if(c>>>=4,l-=4,k=8+(15&c),0===r.wbits&&(r.wbits=k),k>15||k>r.wbits){t.msg="invalid window size",r.mode=ge;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=512&c?16189:16191,c=0,l=0;break;case 16181:for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(r.flags=c,(255&r.flags)!==me){t.msg="unknown compression method",r.mode=ge;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=ge;break}r.head&&(r.head.text=c>>8&1),512&r.flags&&4&r.wrap&&(A[0]=255&c,A[1]=c>>>8&255,r.check=F(r.check,A,2,0)),c=0,l=0,r.mode=16182;case 16182:for(;l<32;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.head&&(r.head.time=c),512&r.flags&&4&r.wrap&&(A[0]=255&c,A[1]=c>>>8&255,A[2]=c>>>16&255,A[3]=c>>>24&255,r.check=F(r.check,A,4,0)),c=0,l=0,r.mode=16183;case 16183:for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.head&&(r.head.xflags=255&c,r.head.os=c>>8),512&r.flags&&4&r.wrap&&(A[0]=255&c,A[1]=c>>>8&255,r.check=F(r.check,A,2,0)),c=0,l=0,r.mode=16184;case 16184:if(1024&r.flags){for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),512&r.flags&&4&r.wrap&&(A[0]=255&c,A[1]=c>>>8&255,r.check=F(r.check,A,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(p=r.length,p>u&&(p=u),p&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(i,i+p),k)),512&r.flags&&4&r.wrap&&(r.check=F(r.check,n,p,i)),u-=p,i+=p,r.length-=p),r.length))break t;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===u)break t;p=0;do{k=n[i+p++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&p<u);if(512&r.flags&&4&r.wrap&&(r.check=F(r.check,n,p,i)),u-=p,i+=p,k)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===u)break t;p=0;do{k=n[i+p++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k))}while(k&&p<u);if(512&r.flags&&4&r.wrap&&(r.check=F(r.check,n,p,i)),u-=p,i+=p,k)break t}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;l<16;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(4&r.wrap&&c!==(65535&r.check)){t.msg="header crc mismatch",r.mode=ge;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=16191;break;case 16189:for(;l<32;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}t.adler=r.check=be(c),c=0,l=0,r.mode=16190;case 16190:if(0===r.havedict)return t.next_out=a,t.avail_out=s,t.next_in=i,t.avail_in=u,r.hold=c,r.bits=l,he;t.adler=r.check=1,r.mode=16191;case 16191:if(e===se||e===ce)break t;case 16192:if(r.last){c>>>=7&l,l-=7&l,r.mode=16206;break}for(;l<3;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}switch(r.last=1&c,c>>>=1,l-=1,3&c){case 0:r.mode=16193;break;case 1:if(je(r),r.mode=16199,e===ce){c>>>=2,l-=2;break t}break;case 2:r.mode=16196;break;case 3:t.msg="invalid block type",r.mode=ge}c>>>=2,l-=2;break;case 16193:for(c>>>=7&l,l-=7&l;l<32;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=ge;break}if(r.length=65535&c,c=0,l=0,r.mode=16194,e===ce)break t;case 16194:r.mode=16195;case 16195:if(p=r.length,p){if(p>u&&(p=u),p>s&&(p=s),0===p)break t;o.set(n.subarray(i,i+p),a),u-=p,i+=p,s-=p,a+=p,r.length-=p;break}r.mode=16191;break;case 16196:for(;l<14;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(r.nlen=257+(31&c),c>>>=5,l-=5,r.ndist=1+(31&c),c>>>=5,l-=5,r.ncode=4+(15&c),c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=ge;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;l<3;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.lens[P[r.have++]]=7&c,c>>>=3,l-=3}for(;r.have<19;)r.lens[P[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},E=ae(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,E){t.msg="invalid code lengths set",r.mode=ge;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;x=r.lencode[c&(1<<r.lenbits)-1],y=x>>>24,m=x>>>16&255,g=65535&x,!(y<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(g<16)c>>>=y,l-=y,r.lens[r.have++]=g;else{if(16===g){for(S=y+2;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(c>>>=y,l-=y,0===r.have){t.msg="invalid bit length repeat",r.mode=ge;break}k=r.lens[r.have-1],p=3+(3&c),c>>>=2,l-=2}else if(17===g){for(S=y+3;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}c>>>=y,l-=y,k=0,p=3+(7&c),c>>>=3,l-=3}else{for(S=y+7;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}c>>>=y,l-=y,k=0,p=11+(127&c),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=ge;break}for(;p--;)r.lens[r.have++]=k}}if(r.mode===ge)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=ge;break}if(r.lenbits=9,O={bits:r.lenbits},E=ae(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,E){t.msg="invalid literal/lengths set",r.mode=ge;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},E=ae(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,E){t.msg="invalid distances set",r.mode=ge;break}if(r.mode=16199,e===ce)break t;case 16199:r.mode=16200;case 16200:if(u>=6&&s>=258){t.next_out=a,t.avail_out=s,t.next_in=i,t.avail_in=u,r.hold=c,r.bits=l,ee(t,h),a=t.next_out,o=t.output,s=t.avail_out,i=t.next_in,n=t.input,u=t.avail_in,c=r.hold,l=r.bits,16191===r.mode&&(r.back=-1);break}for(r.back=0;x=r.lencode[c&(1<<r.lenbits)-1],y=x>>>24,m=x>>>16&255,g=65535&x,!(y<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(m&&0==(240&m)){for(b=y,w=m,_=g;x=r.lencode[_+((c&(1<<b+w)-1)>>b)],y=x>>>24,m=x>>>16&255,g=65535&x,!(b+y<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=y,l-=y,r.back+=y,r.length=g,0===m){r.mode=16205;break}if(32&m){r.back=-1,r.mode=16191;break}if(64&m){t.msg="invalid literal/length code",r.mode=ge;break}r.extra=15&m,r.mode=16201;case 16201:if(r.extra){for(S=r.extra;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;x=r.distcode[c&(1<<r.distbits)-1],y=x>>>24,m=x>>>16&255,g=65535&x,!(y<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(0==(240&m)){for(b=y,w=m,_=g;x=r.distcode[_+((c&(1<<b+w)-1)>>b)],y=x>>>24,m=x>>>16&255,g=65535&x,!(b+y<=l);){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=y,l-=y,r.back+=y,64&m){t.msg="invalid distance code",r.mode=ge;break}r.offset=g,r.extra=15&m,r.mode=16203;case 16203:if(r.extra){for(S=r.extra;l<S;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=ge;break}r.mode=16204;case 16204:if(0===s)break t;if(p=h-s,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=ge;break}p>r.wnext?(p-=r.wnext,d=r.wsize-p):d=r.wnext-p,p>r.length&&(p=r.length),v=r.window}else v=o,d=a-r.offset,p=r.length;p>s&&(p=s),s-=p,r.length-=p;do{o[a++]=v[d++]}while(--p);0===r.length&&(r.mode=16200);break;case 16205:if(0===s)break t;o[a++]=r.length,s--,r.mode=16200;break;case 16206:if(r.wrap){for(;l<32;){if(0===u)break t;u--,c|=n[i++]<<l,l+=8}if(h-=s,t.total_out+=h,r.total+=h,4&r.wrap&&h&&(t.adler=r.check=r.flags?F(r.check,o,h,a-h):M(r.check,o,h,a-h)),h=s,4&r.wrap&&(r.flags?c:be(c))!==r.check){t.msg="incorrect data check",r.mode=ge;break}c=0,l=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;l<32;){if(0===u)break t;u--,c+=n[i++]<<l,l+=8}if(4&r.wrap&&c!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=ge;break}c=0,l=0}r.mode=16208;case 16208:E=fe;break t;case ge:E=de;break t;case 16210:return ve;case 16211:default:return pe}return t.next_out=a,t.avail_out=s,t.next_in=i,t.avail_in=u,r.hold=c,r.bits=l,(r.wsize||h!==t.avail_out&&r.mode<ge&&(r.mode<16206||e!==ue))&&Te(t,t.output,t.next_out,h-t.avail_out),f-=t.avail_in,h-=t.avail_out,t.total_in+=f,t.total_out+=h,r.total+=h,4&r.wrap&&h&&(t.adler=r.check=r.flags?F(r.check,o,h,t.next_out-h):M(r.check,o,h,t.next_out-h)),t.data_type=r.bits+(r.last?64:0)+(16191===r.mode?128:0)+(16199===r.mode||16194===r.mode?256:0),(0===f&&0===h||e===ue)&&E===le&&(E=ye),E},inflateEnd:t=>{if(_e(t))return pe;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(_e(t))return pe;const r=t.state;return 0==(2&r.wrap)?pe:(r.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const r=e.length;let n,o,i;return _e(t)?pe:(n=t.state,0!==n.wrap&&16190!==n.mode?pe:16190===n.mode&&(o=1,o=M(o,e,r,0),o!==n.check)?de:(i=Te(t,e,r,r),i?(n.mode=16210,ve):(n.havedict=1,le)))},inflateInfo:"pako inflate (from Nodeca project)"};var Ne=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Ie=Object.prototype.toString,{Z_NO_FLUSH:Le,Z_FINISH:Ce,Z_OK:Me,Z_STREAM_END:Be,Z_NEED_DICT:Fe,Z_STREAM_ERROR:De,Z_DATA_ERROR:Ue,Z_MEM_ERROR:ze}=U;function Ge(t){this.options=Lt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zt,this.strm.avail_out=0;let r=Re.inflateInit2(this.strm,e.windowBits);if(r!==Me)throw new Error(D[r]);if(this.header=new Ne,Re.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Ft(e.dictionary):"[object ArrayBuffer]"===Ie.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Re.inflateSetDictionary(this.strm,e.dictionary),r!==Me)))throw new Error(D[r])}function He(t,e){const r=new Ge(e);if(r.push(t),r.err)throw r.msg||D[r.err];return r.result}Ge.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,o=this.options.dictionary;let i,a,u;if(this.ended)return!1;for(a=e===~~e?e:!0===e?Ce:Le,"[object ArrayBuffer]"===Ie.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),i=Re.inflate(r,a),i===Fe&&o&&(i=Re.inflateSetDictionary(r,o),i===Me?i=Re.inflate(r,a):i===Ue&&(i=Fe));r.avail_in>0&&i===Be&&r.state.wrap>0&&0!==t[r.next_in];)Re.inflateReset(r),i=Re.inflate(r,a);switch(i){case De:case Ue:case Fe:case ze:return this.onEnd(i),this.ended=!0,!1}if(u=r.avail_out,r.next_out&&(0===r.avail_out||i===Be))if("string"===this.options.to){let t=Ut(r.output,r.next_out),e=r.next_out-t,o=Dt(r.output,t);r.next_out=e,r.avail_out=n-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(o)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(i!==Me||0!==u){if(i===Be)return i=Re.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ge.prototype.onData=function(t){this.chunks.push(t)},Ge.prototype.onEnd=function(t){t===Me&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qe={Inflate:Ge,inflate:He,inflateRaw:function(t,e){return(e=e||{}).raw=!0,He(t,e)},ungzip:He,constants:U};const{Deflate:Ke,deflate:We,deflateRaw:Qe,gzip:Ve}=te,{Inflate:Je,inflate:Ye,inflateRaw:Ze,ungzip:Xe}=qe;var $e=Ke,tr=We,er=Qe,rr=Ve,nr=Je,or=Ye,ir=Ze,ar=Xe,ur=U,sr={Deflate:Ke,deflate:We,deflateRaw:Qe,gzip:Ve,Inflate:Je,inflate:Ye,inflateRaw:Ze,ungzip:Xe,constants:U}},function(t,e){},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";e.sha1=r(71),e.sha224=r(72),e.sha256=r(32),e.sha384=r(73),e.sha512=r(33)},function(t,e,r){"use strict";var n=r(7),o=r(13),i=r(31),a=n.rotl32,u=n.sum32,s=n.sum32_5,c=i.ft_1,l=o.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,l),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],l=this.h[2],h=this.h[3],p=this.h[4];for(n=0;n<r.length;n++){var d=~~(n/20),v=s(a(o,5),c(d,i,l,h),p,r[n],f[d]);p=h,h=l,l=a(i,30),i=o,o=v}this.h[0]=u(this.h[0],o),this.h[1]=u(this.h[1],i),this.h[2]=u(this.h[2],l),this.h[3]=u(this.h[3],h),this.h[4]=u(this.h[4],p)},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(7),o=r(32);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(i,o),t.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var n=r(7),o=r(33);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(i,o),t.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var n=r(7),o=r(13),i=n.rotl32,a=n.sum32,u=n.sum32_3,s=n.sum32_4,c=o.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function p(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(l,c),e.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],o=this.h[2],c=this.h[3],l=this.h[4],g=r,b=n,w=o,_=c,k=l,E=0;E<80;E++){var x=a(i(s(r,f(E,n,o,c),t[d[E]+e],h(E)),y[E]),l);r=l,l=c,c=i(o,10),o=n,n=x,x=a(i(s(g,f(79-E,b,w,_),t[v[E]+e],p(E)),m[E]),k),g=k,k=_,_=i(w,10),w=b,b=x}x=u(this.h[1],o,_),this.h[1]=u(this.h[2],c,k),this.h[2]=u(this.h[3],l,g),this.h[3]=u(this.h[4],r,b),this.h[4]=u(this.h[0],n,w),this.h[0]=x},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],v=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var n=r(7),o=r(12);function i(t,e,r){if(!(this instanceof i))return new i(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=i,i.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),o(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},i.prototype.update=function(t,e){return this.inner.update(t,e),this},i.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(o.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new i(o.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(77),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(8))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,o,i,a,u,s=1,c={},l=!1,f=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){d(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){d(t.data)},n=function(t){i.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,n=function(t){var e=f.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):n=function(t){setTimeout(d,0,t)}:(a="setImmediate$"+Math.random()+"$",u=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&d(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",u,!1):t.attachEvent("onmessage",u),n=function(e){t.postMessage(a+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var o={callback:t,args:e};return c[s]=o,n(s),s++},h.clearImmediate=p}function p(t){delete c[t]}function d(t){if(l)setTimeout(d,0,t);else{var e=c[t];if(e){l=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{p(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(8),r(20))},function(t,e,r){"use strict";r.r(e),r.d(e,"ethers",(function(){return s})),r.d(e,"Signer",(function(){return Gn})),r.d(e,"Wallet",(function(){return bu})),r.d(e,"VoidSigner",(function(){return Hn})),r.d(e,"getDefaultProvider",(function(){return Wh})),r.d(e,"providers",(function(){return i})),r.d(e,"BaseContract",(function(){return Wo})),r.d(e,"Contract",(function(){return Qo})),r.d(e,"ContractFactory",(function(){return Vo})),r.d(e,"BigNumber",(function(){return b})),r.d(e,"FixedNumber",(function(){return ci})),r.d(e,"constants",(function(){return o})),r.d(e,"errors",(function(){return h.a})),r.d(e,"logger",(function(){return _p})),r.d(e,"utils",(function(){return u})),r.d(e,"wordlists",(function(){return oa})),r.d(e,"version",(function(){return wp})),r.d(e,"Wordlist",(function(){return Vi}));var n={};r.r(n),r.d(n,"encode",(function(){return tt})),r.d(n,"decode",(function(){return nt}));var o={};r.r(o),r.d(o,"AddressZero",(function(){return ku})),r.d(o,"NegativeOne",(function(){return Le})),r.d(o,"Zero",(function(){return Ce})),r.d(o,"One",(function(){return Me})),r.d(o,"Two",(function(){return Be})),r.d(o,"WeiPerEther",(function(){return Fe})),r.d(o,"MaxUint256",(function(){return De})),r.d(o,"MinInt256",(function(){return Ue})),r.d(o,"MaxInt256",(function(){return ze})),r.d(o,"HashZero",(function(){return Eu})),r.d(o,"EtherSymbol",(function(){return xu}));var i={};r.r(i),r.d(i,"Provider",(function(){return Sn})),r.d(i,"BaseProvider",(function(){return dc})),r.d(i,"Resolver",(function(){return fc})),r.d(i,"UrlJsonRpcProvider",(function(){return bl})),r.d(i,"FallbackProvider",(function(){return Wf})),r.d(i,"AlchemyProvider",(function(){return Il})),r.d(i,"AlchemyWebSocketProvider",(function(){return Nl})),r.d(i,"AnkrProvider",(function(){return ql})),r.d(i,"CloudflareProvider",(function(){return nf})),r.d(i,"EtherscanProvider",(function(){return kf})),r.d(i,"InfuraProvider",(function(){return uh})),r.d(i,"InfuraWebSocketProvider",(function(){return ah})),r.d(i,"JsonRpcProvider",(function(){return Uc})),r.d(i,"JsonRpcBatchProvider",(function(){return vh})),r.d(i,"NodesmithProvider",(function(){return xh})),r.d(i,"PocketProvider",(function(){return Ih})),r.d(i,"StaticJsonRpcProvider",(function(){return gl})),r.d(i,"Web3Provider",(function(){return qh})),r.d(i,"WebSocketProvider",(function(){return rl})),r.d(i,"IpcProvider",(function(){return Qf})),r.d(i,"JsonRpcSigner",(function(){return Bc})),r.d(i,"getDefaultProvider",(function(){return Wh})),r.d(i,"getNetwork",(function(){return Nu})),r.d(i,"isCommunityResource",(function(){return Ns})),r.d(i,"isCommunityResourcable",(function(){return Rs})),r.d(i,"showThrottleMessage",(function(){return Ls})),r.d(i,"Formatter",(function(){return Ts}));var a={};r.r(a),r.d(a,"decode",(function(){return Iu})),r.d(a,"encode",(function(){return Lu}));var u={};r.r(u),r.d(u,"AbiCoder",(function(){return Vr})),r.d(u,"defaultAbiCoder",(function(){return Jr})),r.d(u,"Fragment",(function(){return Tr})),r.d(u,"ConstructorFragment",(function(){return Cr})),r.d(u,"ErrorFragment",(function(){return Fr})),r.d(u,"EventFragment",(function(){return Rr})),r.d(u,"FunctionFragment",(function(){return Mr})),r.d(u,"ParamType",(function(){return Pr})),r.d(u,"FormatTypes",(function(){return Or})),r.d(u,"checkResultErrors",(function(){return q})),r.d(u,"Logger",(function(){return h.b})),r.d(u,"RLP",(function(){return n})),r.d(u,"_fetchData",(function(){return ks})),r.d(u,"fetchJson",(function(){return Es})),r.d(u,"poll",(function(){return xs})),r.d(u,"checkProperties",(function(){return I})),r.d(u,"deepCopy",(function(){return B})),r.d(u,"defineReadOnly",(function(){return T})),r.d(u,"getStatic",(function(){return R})),r.d(u,"resolveProperties",(function(){return N})),r.d(u,"shallowCopy",(function(){return L})),r.d(u,"arrayify",(function(){return c.a})),r.d(u,"concat",(function(){return c.b})),r.d(u,"stripZeros",(function(){return c.o})),r.d(u,"zeroPad",(function(){return c.p})),r.d(u,"isBytes",(function(){return c.j})),r.d(u,"isBytesLike",(function(){return c.k})),r.d(u,"defaultPath",(function(){return va})),r.d(u,"HDNode",(function(){return ya})),r.d(u,"SigningKey",(function(){return Yn})),r.d(u,"Interface",(function(){return pn})),r.d(u,"LogDescription",(function(){return un})),r.d(u,"TransactionDescription",(function(){return sn})),r.d(u,"base58",(function(){return Mi})),r.d(u,"base64",(function(){return a})),r.d(u,"hexlify",(function(){return c.i})),r.d(u,"isHexString",(function(){return c.l})),r.d(u,"hexConcat",(function(){return c.c})),r.d(u,"hexStripZeros",(function(){return c.f})),r.d(u,"hexValue",(function(){return c.g})),r.d(u,"hexZeroPad",(function(){return c.h})),r.d(u,"hexDataLength",(function(){return c.d})),r.d(u,"hexDataSlice",(function(){return c.e})),r.d(u,"nameprep",(function(){return lp})),r.d(u,"_toEscapedUtf8String",(function(){return At})),r.d(u,"toUtf8Bytes",(function(){return Et})),r.d(u,"toUtf8CodePoints",(function(){return Pt})),r.d(u,"toUtf8String",(function(){return St})),r.d(u,"Utf8ErrorFuncs",(function(){return _t})),r.d(u,"formatBytes32String",(function(){return fp})),r.d(u,"parseBytes32String",(function(){return hp})),r.d(u,"dnsEncode",(function(){return fs})),r.d(u,"hashMessage",(function(){return hi})),r.d(u,"namehash",(function(){return ls})),r.d(u,"isValidName",(function(){return cs})),r.d(u,"id",(function(){return jt})),r.d(u,"_TypedDataEncoder",(function(){return Ri})),r.d(u,"getAddress",(function(){return ht})),r.d(u,"getIcapAddress",(function(){return dt})),r.d(u,"getContractAddress",(function(){return vt})),r.d(u,"getCreate2Address",(function(){return yt})),r.d(u,"isAddress",(function(){return pt})),r.d(u,"formatEther",(function(){return gp})),r.d(u,"parseEther",(function(){return bp})),r.d(u,"formatUnits",(function(){return yp})),r.d(u,"parseUnits",(function(){return mp})),r.d(u,"commify",(function(){return vp})),r.d(u,"computeHmac",(function(){return Hi})),r.d(u,"keccak256",(function(){return Y})),r.d(u,"ripemd160",(function(){return Ui})),r.d(u,"sha256",(function(){return zi})),r.d(u,"sha512",(function(){return Gi})),r.d(u,"randomBytes",(function(){return ka.a})),r.d(u,"shuffled",(function(){return Ef})),r.d(u,"solidityPack",(function(){return Zh})),r.d(u,"solidityKeccak256",(function(){return Xh})),r.d(u,"soliditySha256",(function(){return $h})),r.d(u,"splitSignature",(function(){return c.n})),r.d(u,"joinSignature",(function(){return c.m})),r.d(u,"accessListify",(function(){return co})),r.d(u,"parseTransaction",(function(){return yo})),r.d(u,"serializeTransaction",(function(){return po})),r.d(u,"TransactionTypes",(function(){return $n})),r.d(u,"getJsonWalletAddress",(function(){return au})),r.d(u,"computeAddress",(function(){return io})),r.d(u,"recoverAddress",(function(){return ao})),r.d(u,"computePublicKey",(function(){return Xn})),r.d(u,"recoverPublicKey",(function(){return Zn})),r.d(u,"verifyMessage",(function(){return wu})),r.d(u,"verifyTypedData",(function(){return _u})),r.d(u,"getAccountPath",(function(){return _a})),r.d(u,"mnemonicToEntropy",(function(){return ga})),r.d(u,"entropyToMnemonic",(function(){return ba})),r.d(u,"isValidMnemonic",(function(){return wa})),r.d(u,"mnemonicToSeed",(function(){return ma})),r.d(u,"SupportedAlgorithm",(function(){return Li})),r.d(u,"UnicodeNormalizationForm",(function(){return mt})),r.d(u,"Utf8ErrorReason",(function(){return gt})),r.d(u,"Indexed",(function(){return ln}));var s={};r.r(s),r.d(s,"Signer",(function(){return Gn})),r.d(s,"Wallet",(function(){return bu})),r.d(s,"VoidSigner",(function(){return Hn})),r.d(s,"getDefaultProvider",(function(){return Wh})),r.d(s,"providers",(function(){return i})),r.d(s,"BaseContract",(function(){return Wo})),r.d(s,"Contract",(function(){return Qo})),r.d(s,"ContractFactory",(function(){return Vo})),r.d(s,"BigNumber",(function(){return b})),r.d(s,"FixedNumber",(function(){return ci})),r.d(s,"constants",(function(){return o})),r.d(s,"errors",(function(){return h.a})),r.d(s,"logger",(function(){return _p})),r.d(s,"utils",(function(){return u})),r.d(s,"wordlists",(function(){return oa})),r.d(s,"version",(function(){return wp})),r.d(s,"Wordlist",(function(){return Vi}));var c=r(0),l=r(2),f=r.n(l),h=r(1);function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==p(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===p(i)?i:String(i)),n)}var o,i}var v=f.a.BN,y=new h.b("bignumber/5.7.0"),m={};var g=!1,b=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e!==m&&y.throwError("cannot call constructor directly; use BigNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}var e,r,n;return e=t,n=[{key:"from",value:function(e){if(e instanceof t)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new t(m,w(e)):e.match(/^-?[0-9]+$/)?new t(m,w(new v(e))):y.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&E("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&E("overflow","BigNumber.from",e),t.from(String(e));var r=e;if("bigint"==typeof r)return t.from(r.toString());if(Object(c.j)(r))return t.from(Object(c.i)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return t.from(n)}else{var o=r._hex;if(null==o&&"BigNumber"===r.type&&(o=r.hex),"string"==typeof o&&(Object(c.l)(o)||"-"===o[0]&&Object(c.l)(o.substring(1))))return t.from(o)}return y.throwArgumentError("invalid BigNumber value","value",e)}},{key:"isBigNumber",value:function(t){return!(!t||!t._isBigNumber)}}],(r=[{key:"fromTwos",value:function(t){return _(k(this).fromTwos(t))}},{key:"toTwos",value:function(t){return _(k(this).toTwos(t))}},{key:"abs",value:function(){return"-"===this._hex[0]?t.from(this._hex.substring(1)):this}},{key:"add",value:function(t){return _(k(this).add(k(t)))}},{key:"sub",value:function(t){return _(k(this).sub(k(t)))}},{key:"div",value:function(e){return t.from(e).isZero()&&E("division-by-zero","div"),_(k(this).div(k(e)))}},{key:"mul",value:function(t){return _(k(this).mul(k(t)))}},{key:"mod",value:function(t){var e=k(t);return e.isNeg()&&E("division-by-zero","mod"),_(k(this).umod(e))}},{key:"pow",value:function(t){var e=k(t);return e.isNeg()&&E("negative-power","pow"),_(k(this).pow(e))}},{key:"and",value:function(t){var e=k(t);return(this.isNegative()||e.isNeg())&&E("unbound-bitwise-result","and"),_(k(this).and(e))}},{key:"or",value:function(t){var e=k(t);return(this.isNegative()||e.isNeg())&&E("unbound-bitwise-result","or"),_(k(this).or(e))}},{key:"xor",value:function(t){var e=k(t);return(this.isNegative()||e.isNeg())&&E("unbound-bitwise-result","xor"),_(k(this).xor(e))}},{key:"mask",value:function(t){return(this.isNegative()||t<0)&&E("negative-width","mask"),_(k(this).maskn(t))}},{key:"shl",value:function(t){return(this.isNegative()||t<0)&&E("negative-width","shl"),_(k(this).shln(t))}},{key:"shr",value:function(t){return(this.isNegative()||t<0)&&E("negative-width","shr"),_(k(this).shrn(t))}},{key:"eq",value:function(t){return k(this).eq(k(t))}},{key:"lt",value:function(t){return k(this).lt(k(t))}},{key:"lte",value:function(t){return k(this).lte(k(t))}},{key:"gt",value:function(t){return k(this).gt(k(t))}},{key:"gte",value:function(t){return k(this).gte(k(t))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return k(this).isZero()}},{key:"toNumber",value:function(){try{return k(this).toNumber()}catch(t){E("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(t){}return y.throwError("this platform does not support BigInt",h.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?g||(g=!0,y.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?y.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",h.b.errors.UNEXPECTED_ARGUMENT,{}):y.throwError("BigNumber.toString does not accept parameters",h.b.errors.UNEXPECTED_ARGUMENT,{})),k(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(t){return{type:"BigNumber",hex:this.toHexString()}}}])&&d(e.prototype,r),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function w(t){if("string"!=typeof t)return w(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&y.throwArgumentError("invalid hex","value",t),"0x00"===(t=w(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function _(t){return b.from(w(t))}function k(t){var e=b.from(t).toHexString();return"-"===e[0]?new v("-"+e.substring(3),16):new v(e.substring(2),16)}function E(t,e,r){var n={fault:t,operation:e};return null!=r&&(n.value=r),y.throwError(t,h.b.errors.NUMERIC_FAULT,n)}function x(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==S(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===S(i)?i:String(i)),n)}var o,i}function A(t,e,r){return e&&x(t.prototype,e),r&&x(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function O(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */O=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==S(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var P=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},j=new h.b("properties/5.7.0");function T(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function R(t,e){for(var r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!==S(t.prototype))break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function N(t){return P(this,void 0,void 0,O().mark((function e(){var r,n;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.keys(t).map((function(e){var r=t[e];return Promise.resolve(r).then((function(t){return{key:e,value:t}}))})),e.next=3,Promise.all(r);case 3:return n=e.sent,e.abrupt("return",n.reduce((function(t,e){return t[e.key]=e.value,t}),{}));case 5:case"end":return e.stop()}}),e)})))}function I(t,e){t&&"object"===S(t)||j.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((function(r){e[r]||j.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}function L(t){var e={};for(var r in t)e[r]=t[r];return e}var C={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function M(t){if(function t(e){if(null==e||C[S(e)])return!0;if(Array.isArray(e)||"object"===S(e)){if(!Object.isFrozen(e))return!1;for(var r=Object.keys(e),n=0;n<r.length;n++){var o=null;try{o=e[r[n]]}catch(t){continue}if(!t(o))return!1}return!0}return j.throwArgumentError("Cannot deepCopy ".concat(S(e)),"object",e)}(t))return t;if(Array.isArray(t))return Object.freeze(t.map((function(t){return B(t)})));if("object"===S(t)){var e={};for(var r in t){var n=t[r];void 0!==n&&T(e,r,B(n))}return e}return j.throwArgumentError("Cannot deepCopy ".concat(S(t)),"object",t)}function B(t){return M(t)}var F=A((function t(e){for(var r in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e)this[r]=B(e[r])}));function D(t){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==D(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===D(i)?i:String(i)),n)}var o,i}function G(t,e,r){return e&&z(t.prototype,e),r&&z(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var H=new h.b("abi/5.7.0");function q(t){var e=[];return function t(r,n){if(Array.isArray(n))for(var o in n){var i=r.slice();i.push(o);try{t(i,n[o])}catch(t){e.push({path:i,error:t})}}}([],t),e}var K=function(){function t(e,r,n,o){U(this,t),this.name=e,this.type=r,this.localName=n,this.dynamic=o}return G(t,[{key:"_throwError",value:function(t,e){H.throwArgumentError(t,this.localName,e)}}]),t}(),W=function(){function t(e){U(this,t),T(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}return G(t,[{key:"data",get:function(){return Object(c.c)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(t){return this._data.push(t),this._dataLength+=t.length,t.length}},{key:"appendWriter",value:function(t){return this._writeData(Object(c.b)(t._data))}},{key:"writeBytes",value:function(t){var e=Object(c.a)(t),r=e.length%this.wordSize;return r&&(e=Object(c.b)([e,this._padding.slice(r)])),this._writeData(e)}},{key:"_getValue",value:function(t){var e=Object(c.a)(b.from(t));return e.length>this.wordSize&&H.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=Object(c.b)([this._padding.slice(e.length%this.wordSize),e])),e}},{key:"writeValue",value:function(t){return this._writeData(this._getValue(t))}},{key:"writeUpdatableValue",value:function(){var t=this,e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){t._data[e]=t._getValue(r)}}}]),t}(),Q=function(){function t(e,r,n,o){U(this,t),T(this,"_data",Object(c.a)(e)),T(this,"wordSize",r||32),T(this,"_coerceFunc",n),T(this,"allowLoose",o),this._offset=0}return G(t,[{key:"data",get:function(){return Object(c.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(e,r){return this._coerceFunc?this._coerceFunc(e,r):t.coerce(e,r)}},{key:"_peekBytes",value:function(t,e,r){var n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:H.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(e){return new t(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(t,e){var r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}},{key:"readValue",value:function(){return b.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(t,e){var r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}}]),t}(),V=r(35),J=r.n(V);function Y(t){return"0x"+J.a.keccak_256(Object(c.a)(t))}var Z=new h.b("rlp/5.7.0");function X(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function $(t,e,r){for(var n=0,o=0;o<r;o++)n=256*n+t[e+o];return n}function tt(t){return Object(c.i)(function t(e){if(Array.isArray(e)){var r=[];if(e.forEach((function(e){r=r.concat(t(e))})),r.length<=55)return r.unshift(192+r.length),r;var n=X(r.length);return n.unshift(247+n.length),n.concat(r)}Object(c.k)(e)||Z.throwArgumentError("RLP object must be BytesLike","object",e);var o=Array.prototype.slice.call(Object(c.a)(e));if(1===o.length&&o[0]<=127)return o;if(o.length<=55)return o.unshift(128+o.length),o;var i=X(o.length);return i.unshift(183+i.length),i.concat(o)}(t))}function et(t,e,r,n){for(var o=[];r<e+1+n;){var i=rt(t,r);o.push(i.result),(r+=i.consumed)>e+1+n&&Z.throwError("child data too short",h.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function rt(t,e){if(0===t.length&&Z.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),t[e]>=248){var r=t[e]-247;e+1+r>t.length&&Z.throwError("data short segment too short",h.b.errors.BUFFER_OVERRUN,{});var n=$(t,e+1,r);return e+1+r+n>t.length&&Z.throwError("data long segment too short",h.b.errors.BUFFER_OVERRUN,{}),et(t,e,e+1+r,r+n)}if(t[e]>=192){var o=t[e]-192;return e+1+o>t.length&&Z.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),et(t,e,e+1,o)}if(t[e]>=184){var i=t[e]-183;e+1+i>t.length&&Z.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{});var a=$(t,e+1,i);return e+1+i+a>t.length&&Z.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+i+a,result:Object(c.i)(t.slice(e+1+i,e+1+i+a))}}if(t[e]>=128){var u=t[e]-128;return e+1+u>t.length&&Z.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+u,result:Object(c.i)(t.slice(e+1,e+1+u))}}return{consumed:1,result:Object(c.i)(t[e])}}function nt(t){var e=Object(c.a)(t),r=rt(e,0);return r.consumed!==e.length&&Z.throwArgumentError("invalid rlp data","data",t),r.result}var ot=new h.b("address/5.7.0");function it(t){Object(c.l)(t,20)||ot.throwArgumentError("invalid address","address",t);for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);for(var o=Object(c.a)(Y(r)),i=0;i<40;i+=2)o[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&o[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var at={},ut=0;ut<10;ut++)at[String(ut)]=String(ut);for(var st=0;st<26;st++)at[String.fromCharCode(65+st)]=String(10+st);var ct,lt=Math.floor((ct=9007199254740991,Math.log10?Math.log10(ct):Math.log(ct)/Math.LN10));function ft(t){for(var e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((function(t){return at[t]})).join("");e.length>=lt;){var r=e.substring(0,lt);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function ht(t){var e,r=null;if("string"!=typeof t&&ot.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),r=it(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==t&&ot.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==ft(t)&&ot.throwArgumentError("bad icap checksum","address",t),e=t.substring(4),r=new v(e,36).toString(16);r.length<40;)r="0"+r;r=it("0x"+r)}else ot.throwArgumentError("invalid address","address",t);return r}function pt(t){try{return ht(t),!0}catch(t){}return!1}function dt(t){for(var e,r=(e=ht(t).substring(2),new v(e,16).toString(36)).toUpperCase();r.length<30;)r="0"+r;return"XE"+ft("XE00"+r)+r}function vt(t){var e=null;try{e=ht(t.from)}catch(e){ot.throwArgumentError("missing from address","transaction",t)}var r=Object(c.o)(Object(c.a)(b.from(t.nonce).toHexString()));return ht(Object(c.e)(Y(tt([e,r])),12))}function yt(t,e,r){return 32!==Object(c.d)(e)&&ot.throwArgumentError("salt must be 32 bytes","salt",e),32!==Object(c.d)(r)&&ot.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ht(Object(c.e)(Y(Object(c.b)(["0xff",ht(t),e,r])),12))}var mt,gt,bt=new h.b("strings/5.7.0");function wt(t,e,r,n,o){if(t===gt.BAD_PREFIX||t===gt.UNEXPECTED_CONTINUE){for(var i=0,a=e+1;a<r.length&&r[a]>>6==2;a++)i++;return i}return t===gt.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(mt||(mt={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(gt||(gt={}));var _t=Object.freeze({error:function(t,e,r,n,o){return bt.throwArgumentError("invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",r)},ignore:wt,replace:function(t,e,r,n,o){return t===gt.OVERLONG?(n.push(o),0):(n.push(65533),wt(t,e,r))}});function kt(t,e){null==e&&(e=_t.error),t=Object(c.a)(t);for(var r=[],n=0;n<t.length;){var o=t[n++];if(o>>7!=0){var i=null,a=null;if(192==(224&o))i=1,a=127;else if(224==(240&o))i=2,a=2047;else{if(240!=(248&o)){n+=e(128==(192&o)?gt.UNEXPECTED_CONTINUE:gt.BAD_PREFIX,n-1,t,r);continue}i=3,a=65535}if(n-1+i>=t.length)n+=e(gt.OVERRUN,n-1,t,r);else{for(var u=o&(1<<8-i-1)-1,s=0;s<i;s++){var l=t[n];if(128!=(192&l)){n+=e(gt.MISSING_CONTINUE,n,t,r),u=null;break}u=u<<6|63&l,n++}null!==u&&(u>1114111?n+=e(gt.OUT_OF_RANGE,n-1-i,t,r,u):u>=55296&&u<=57343?n+=e(gt.UTF16_SURROGATE,n-1-i,t,r,u):u<=a?n+=e(gt.OVERLONG,n-1-i,t,r,u):r.push(u))}}else r.push(o)}return r}function Et(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mt.current;e!=mt.current&&(bt.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n<t.length;n++){var o=t.charCodeAt(n);if(o<128)r.push(o);else if(o<2048)r.push(o>>6|192),r.push(63&o|128);else if(55296==(64512&o)){n++;var i=t.charCodeAt(n);if(n>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");var a=65536+((1023&o)<<10)+(1023&i);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(o>>12|224),r.push(o>>6&63|128),r.push(63&o|128)}return Object(c.a)(r)}function xt(t){var e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function At(t,e){return'"'+kt(t,e).map((function(t){if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?xt(t):xt(55296+((t-=65536)>>10&1023))+xt(56320+(1023&t))})).join("")+'"'}function Ot(t){return t.map((function(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t)))})).join("")}function St(t,e){return Ot(kt(t,e))}function Pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mt.current;return kt(Et(t,e))}function jt(t){return Y(Et(t))}function Tt(t){return(Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Tt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Tt(i)?i:String(i)),n)}var o,i}function Nt(t,e){return(Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function It(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ct(t);if(e){var o=Ct(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lt(this,r)}}function Lt(t,e){if(e&&("object"===Tt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ct(t){return(Ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Mt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nt(t,e)}(i,t);var e,r,n,o=It(i);function i(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,"address","address",t,!1)}return e=i,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(t,e){try{e=ht(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}},{key:"decode",value:function(t){return ht(Object(c.h)(t.readValue().toHexString(),20))}}])&&Rt(e.prototype,r),n&&Rt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(K);function Bt(t){return(Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Bt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Bt(i)?i:String(i)),n)}var o,i}function Dt(t,e){return(Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Gt(t);if(e){var o=Gt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zt(this,r)}}function zt(t,e){if(e&&("object"===Bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Gt(t){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ht=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dt(t,e)}(i,t);var e,r,n,o=Ut(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t.name,t.type,void 0,t.dynamic)).coder=t,e}return e=i,(r=[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(t,e){return this.coder.encode(t,e)}},{key:"decode",value:function(t){return this.coder.decode(t)}}])&&Ft(e.prototype,r),n&&Ft(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(K);function qt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Jt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Jt(i)?i:String(i)),n)}var o,i}function Kt(t,e){return(Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Vt(t);if(e){var o=Vt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Qt(this,r)}}function Qt(t,e){if(e&&("object"===Jt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Vt(t){return(Vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Jt(t){return(Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Yt=new h.b("abi/5.7.0");function Zt(t,e,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===Jt(r)){var o={};n=e.map((function(t){var e=t.localName;return e||Yt.throwError("cannot encode object for signature with missing names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),o[e]&&Yt.throwError("cannot encode object for signature with duplicate names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),o[e]=!0,r[e]}))}else Yt.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Yt.throwArgumentError("types/value length mismatch","tuple",r);var i=new W(t.wordSize),a=new W(t.wordSize),u=[];e.forEach((function(t,e){var r=n[e];if(t.dynamic){var o=a.length;t.encode(a,r);var s=i.writeUpdatableValue();u.push((function(t){s(t+o)}))}else t.encode(i,r)})),u.forEach((function(t){t(i.length)}));var s=t.appendWriter(i);return s+=t.appendWriter(a)}function Xt(t,e){var r=[],n=t.subReader(0);e.forEach((function(e){var o=null;if(e.dynamic){var i=t.readValue(),a=n.subReader(i.toNumber());try{o=e.decode(a)}catch(t){if(t.code===h.b.errors.BUFFER_OVERRUN)throw t;(o=t).baseType=e.name,o.name=e.localName,o.type=e.type}}else try{o=e.decode(t)}catch(t){if(t.code===h.b.errors.BUFFER_OVERRUN)throw t;(o=t).baseType=e.name,o.name=e.localName,o.type=e.type}null!=o&&r.push(o)}));var o=e.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach((function(t,e){var n=t.localName;if(n&&1===o[n]&&("length"===n&&(n="_length"),null==r[n])){var i=r[e];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw i}}):r[n]=i}}));for(var i=function(){var t=r[a];t instanceof Error&&Object.defineProperty(r,a,{enumerable:!0,get:function(){throw t}})},a=0;a<r.length;a++)i();return Object.freeze(r)}var $t=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kt(t,e)}(i,t);var e,r,n,o=Wt(i);function i(t,e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);var a=t.type+"["+(e>=0?e:"")+"]",u=-1===e||t.dynamic;return(n=o.call(this,"array",a,r,u)).coder=t,n.length=e,n}return e=i,(r=[{key:"defaultValue",value:function(){for(var t=this.coder.defaultValue(),e=[],r=0;r<this.length;r++)e.push(t);return e}},{key:"encode",value:function(t,e){Array.isArray(e)||this._throwError("expected array value",e);var r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),Yt.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],o=0;o<e.length;o++)n.push(this.coder);return Zt(t,n,e)}},{key:"decode",value:function(t){var e=this.length;-1===e&&32*(e=t.readValue().toNumber())>t._data.length&&Yt.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:t._data.length,count:e});for(var r=[],n=0;n<e;n++)r.push(new Ht(this.coder));return t.coerce(this.name,Xt(t,r))}}])&&qt(e.prototype,r),n&&qt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(K);function te(t){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==te(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===te(i)?i:String(i)),n)}var o,i}function re(t,e){return(re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ne(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ie(t);if(e){var o=ie(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return oe(this,r)}}function oe(t,e){if(e&&("object"===te(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ie(t){return(ie=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ae=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&re(t,e)}(i,t);var e,r,n,o=ne(i);function i(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,"bool","bool",t,!1)}return e=i,(r=[{key:"defaultValue",value:function(){return!1}},{key:"encode",value:function(t,e){return t.writeValue(e?1:0)}},{key:"decode",value:function(t){return t.coerce(this.type,!t.readValue().isZero())}}])&&ee(e.prototype,r),n&&ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(K);function ue(t){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function se(){return(se="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=ce(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function ce(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=me(t)););return t}function le(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==ue(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===ue(i)?i:String(i)),n)}var o,i}function he(t,e,r){return e&&fe(t.prototype,e),r&&fe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function pe(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&de(t,e)}function de(t,e){return(de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ve(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=me(t);if(e){var o=me(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ye(this,r)}}function ye(t,e){if(e&&("object"===ue(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function me(t){return(me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ge=function(t){pe(r,t);var e=ve(r);function r(t,n){return le(this,r),e.call(this,t,t,n,!0)}return he(r,[{key:"defaultValue",value:function(){return"0x"}},{key:"encode",value:function(t,e){e=Object(c.a)(e);var r=t.writeValue(e.length);return r+=t.writeBytes(e)}},{key:"decode",value:function(t){return t.readBytes(t.readValue().toNumber(),!0)}}]),r}(K),be=function(t){pe(r,t);var e=ve(r);function r(t){return le(this,r),e.call(this,"bytes",t)}return he(r,[{key:"decode",value:function(t){return t.coerce(this.name,Object(c.i)(se(me(r.prototype),"decode",this).call(this,t)))}}]),r}(ge);function we(t){return(we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==we(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==we(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===we(i)?i:String(i)),n)}var o,i}function ke(t,e){return(ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ee(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ae(t);if(e){var o=Ae(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return xe(this,r)}}function xe(t,e){if(e&&("object"===we(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ae(t){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Oe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ke(t,e)}(i,t);var e,r,n,o=Ee(i);function i(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);var n="bytes"+String(t);return(r=o.call(this,n,n,e,!1)).size=t,r}return e=i,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}},{key:"encode",value:function(t,e){var r=Object(c.a)(e);return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}},{key:"decode",value:function(t){return t.coerce(this.name,Object(c.i)(t.readBytes(this.size)))}}])&&_e(e.prototype,r),n&&_e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(K);function Se(t){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Se(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Se(i)?i:String(i)),n)}var o,i}function je(t,e){return(je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Te(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ne(t);if(e){var o=Ne(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Re(this,r)}}function Re(t,e){if(e&&("object"===Se(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ne(t){return(Ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ie=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&je(t,e)}(i,t);var e,r,n,o=Te(i);function i(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,"null","",t,!1)}return e=i,(r=[{key:"defaultValue",value:function(){return null}},{key:"encode",value:function(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}},{key:"decode",value:function(t){return t.readBytes(0),t.coerce(this.name,null)}}])&&Pe(e.prototype,r),n&&Pe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(K),Le=b.from(-1),Ce=b.from(0),Me=b.from(1),Be=b.from(2),Fe=b.from("1000000000000000000"),De=b.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Ue=b.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),ze=b.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Ge(t){return(Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function He(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Ge(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Ge(i)?i:String(i)),n)}var o,i}function qe(t,e){return(qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Qe(t);if(e){var o=Qe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return We(this,r)}}function We(t,e){if(e&&("object"===Ge(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Qe(t){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ve=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qe(t,e)}(i,t);var e,r,n,o=Ke(i);function i(t,e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);var a=(e?"int":"uint")+8*t;return(n=o.call(this,a,a,r,!1)).size=t,n.signed=e,n}return e=i,(r=[{key:"defaultValue",value:function(){return 0}},{key:"encode",value:function(t,e){var r=b.from(e),n=De.mask(8*t.wordSize);if(this.signed){var o=n.mask(8*this.size-1);(r.gt(o)||r.lt(o.add(Me).mul(Le)))&&this._throwError("value out-of-bounds",e)}else(r.lt(Ce)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(r)}},{key:"decode",value:function(t){var e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}])&&He(e.prototype,r),n&&He(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(K);function Je(t){return(Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ye(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Je(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Je(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Je(i)?i:String(i)),n)}var o,i}function Ze(){return(Ze="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Xe(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function Xe(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rr(t)););return t}function $e(t,e){return($e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=rr(t);if(e){var o=rr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return er(this,r)}}function er(t,e){if(e&&("object"===Je(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function rr(t){return(rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var nr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$e(t,e)}(i,t);var e,r,n,o=tr(i);function i(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,"string",t)}return e=i,(r=[{key:"defaultValue",value:function(){return""}},{key:"encode",value:function(t,e){return Ze(rr(i.prototype),"encode",this).call(this,t,Et(e))}},{key:"decode",value:function(t){return St(Ze(rr(i.prototype),"decode",this).call(this,t))}}])&&Ye(e.prototype,r),n&&Ye(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(ge);function or(t){return(or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==or(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===or(i)?i:String(i)),n)}var o,i}function ar(t,e){return(ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ur(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=cr(t);if(e){var o=cr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sr(this,r)}}function sr(t,e){if(e&&("object"===or(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function cr(t){return(cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var lr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ar(t,e)}(i,t);var e,r,n,o=ur(i);function i(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);var n=!1,a=[];t.forEach((function(t){t.dynamic&&(n=!0),a.push(t.type)}));var u="tuple("+a.join(",")+")";return(r=o.call(this,"tuple",u,e,n)).coders=t,r}return e=i,(r=[{key:"defaultValue",value:function(){var t=[];this.coders.forEach((function(e){t.push(e.defaultValue())}));var e=this.coders.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach((function(r,n){var o=r.localName;o&&1===e[o]&&("length"===o&&(o="_length"),null==t[o]&&(t[o]=t[n]))})),Object.freeze(t)}},{key:"encode",value:function(t,e){return Zt(t,this.coders,e)}},{key:"decode",value:function(t){return t.coerce(this.name,Xt(t,this.coders))}}])&&ir(e.prototype,r),n&&ir(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(K);function fr(t){return(fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hr(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pr(t,e)}function pr(t,e){return(pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function dr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=yr(t);if(e){var o=yr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return vr(this,r)}}function vr(t,e){if(e&&("object"===fr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function yr(t){return(yr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==fr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===fr(i)?i:String(i)),n)}var o,i}function br(t,e,r){return e&&gr(t.prototype,e),r&&gr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var wr=new h.b("abi/5.7.0"),_r={},kr={calldata:!0,memory:!0,storage:!0},Er={calldata:!0,memory:!0};function xr(t,e){if("bytes"===t||"string"===t){if(kr[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&Er[e])return!0;return(kr[e]||"payable"===e)&&wr.throwArgumentError("invalid modifier","name",e),!1}function Ar(t,e){for(var r in e)T(t,r,e[r])}var Or=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Sr=new RegExp(/^(.*)\[([0-9]*)\]$/),Pr=function(){function t(e,r){mr(this,t),e!==_r&&wr.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ar(this,r);var n=this.type.match(Sr);Ar(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:t.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return br(t,[{key:"format",value:function(t){if(t||(t=Or.sighash),Or[t]||wr.throwArgumentError("invalid format type","format",t),t===Or.json){var e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((function(e){return JSON.parse(e.format(t))}))),JSON.stringify(e)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(t),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==Or.sighash&&(r+=this.type),r+="("+this.components.map((function(e){return e.format(t)})).join(t===Or.full?", ":",")+")"):r+=this.type,t!==Or.sighash&&(!0===this.indexed&&(r+=" indexed"),t===Or.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(e,r){return"string"==typeof e?t.fromString(e,r):t.fromObject(e)}},{key:"fromObject",value:function(e){return t.isParamType(e)?e:new t(_r,{name:e.name||null,type:Dr(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(t.fromObject):null})}},{key:"fromString",value:function(e,r){return function(e){return t.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}(function(t,e){var r=t;function n(e){wr.throwArgumentError("unexpected character at position ".concat(e),"param",t)}function o(t){var r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},a=i,u=0;u<t.length;u++){var s=t[u];switch(s){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(u),a.state.allowType=!1,a.type=Dr(a.type),a.components=[o(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(e||n(u),a.indexed=!0,a.name=""),xr(a.type,a.name)&&(a.name=""),a.type=Dr(a.type);var c=a;(a=a.parent)||n(u),delete c.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(e||n(u),a.indexed=!0,a.name=""),xr(a.type,a.name)&&(a.name=""),a.type=Dr(a.type);var l=o(a.parent);a.parent.components.push(l),delete a.parent,a=l;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Dr(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(e||n(u),a.indexed&&n(u),a.indexed=!0,a.name=""):xr(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(u),a.type+=s,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(u),a.type+=s,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=s,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=s,delete a.state.allowArray):a.state.readArray?a.type+=s:n(u)}}return a.parent&&wr.throwArgumentError("unexpected eof","param",t),delete i.state,"indexed"===a.name?(e||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):xr(a.type,a.name)&&(a.name=""),i.type=Dr(i.type),i}(e,!!r))}},{key:"isParamType",value:function(t){return!(null==t||!t._isParamType)}}]),t}();function jr(t,e){return function(t){t=t.trim();for(var e=[],r="",n=0,o=0;o<t.length;o++){var i=t[o];","===i&&0===n?(e.push(r),r=""):(r+=i,"("===i?n++:")"===i&&-1===--n&&wr.throwArgumentError("unbalanced parenthesis","value",t))}r&&e.push(r);return e}(t).map((function(t){return Pr.fromString(t,e)}))}var Tr=function(){function t(e,r){mr(this,t),e!==_r&&wr.throwError("use a static from method",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ar(this,r),this._isFragment=!0,Object.freeze(this)}return br(t,null,[{key:"from",value:function(e){return t.isFragment(e)?e:"string"==typeof e?t.fromString(e):t.fromObject(e)}},{key:"fromObject",value:function(e){if(t.isFragment(e))return e;switch(e.type){case"function":return Mr.fromObject(e);case"event":return Rr.fromObject(e);case"constructor":return Cr.fromObject(e);case"error":return Fr.fromObject(e);case"fallback":case"receive":return null}return wr.throwArgumentError("invalid fragment object","value",e)}},{key:"fromString",value:function(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Rr.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?Mr.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?Cr.fromString(t.trim()):"error"===t.split(" ")[0]?Fr.fromString(t.substring(5).trim()):wr.throwArgumentError("unsupported fragment","value",t)}},{key:"isFragment",value:function(t){return!(!t||!t._isFragment)}}]),t}(),Rr=function(t){hr(r,t);var e=dr(r);function r(){return mr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Or.sighash),Or[t]||wr.throwArgumentError("invalid format type","format",t),t===Or.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==Or.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===Or.full?", ":",")+") ",t!==Or.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isEventFragment(t))return t;"event"!==t.type&&wr.throwArgumentError("invalid event object","value",t);var e={name:zr(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Pr.fromObject):[],type:"event"};return new r(_r,e)}},{key:"fromString",value:function(t){var e=t.match(Gr);e||wr.throwArgumentError("invalid event string","value",t);var n=!1;return e[3].split(" ").forEach((function(t){switch(t.trim()){case"anonymous":n=!0;break;case"":break;default:wr.warn("unknown modifier: "+t)}})),r.fromObject({name:e[1].trim(),anonymous:n,inputs:jr(e[2],!0),type:"event"})}},{key:"isEventFragment",value:function(t){return t&&t._isFragment&&"event"===t.type}}]),r}(Tr);function Nr(t,e){e.gas=null;var r=t.split("@");return 1!==r.length?(r.length>2&&wr.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||wr.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=b.from(r[1]),r[0]):t}function Ir(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((function(t){switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function Lr(t){var e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&wr.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&wr.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||wr.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&wr.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&wr.throwArgumentError("unable to determine stateMutability","value",t),e}var Cr=function(t){hr(r,t);var e=dr(r);function r(){return mr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Or.sighash),Or[t]||wr.throwArgumentError("invalid format type","format",t),t===Or.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((function(e){return JSON.parse(e.format(t))}))});t===Or.sighash&&wr.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var e="constructor("+this.inputs.map((function(e){return e.format(t)})).join(t===Or.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isConstructorFragment(t))return t;"constructor"!==t.type&&wr.throwArgumentError("invalid constructor object","value",t);var e=Lr(t);e.constant&&wr.throwArgumentError("constructor cannot be constant","value",t);var n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Pr.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?b.from(t.gas):null};return new r(_r,n)}},{key:"fromString",value:function(t){var e={type:"constructor"},n=(t=Nr(t,e)).match(Gr);return n&&"constructor"===n[1].trim()||wr.throwArgumentError("invalid constructor string","value",t),e.inputs=jr(n[2].trim(),!1),Ir(n[3].trim(),e),r.fromObject(e)}},{key:"isConstructorFragment",value:function(t){return t&&t._isFragment&&"constructor"===t.type}}]),r}(Tr),Mr=function(t){hr(r,t);var e=dr(r);function r(){return mr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Or.sighash),Or[t]||wr.throwArgumentError("invalid format type","format",t),t===Or.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((function(e){return JSON.parse(e.format(t))})),outputs:this.outputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==Or.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===Or.full?", ":",")+") ",t!==Or.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((function(e){return e.format(t)})).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isFunctionFragment(t))return t;"function"!==t.type&&wr.throwArgumentError("invalid function object","value",t);var e=Lr(t),n={type:t.type,name:zr(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(Pr.fromObject):[],outputs:t.outputs?t.outputs.map(Pr.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?b.from(t.gas):null};return new r(_r,n)}},{key:"fromString",value:function(t){var e={type:"function"},n=(t=Nr(t,e)).split(" returns ");n.length>2&&wr.throwArgumentError("invalid function string","value",t);var o=n[0].match(Gr);if(o||wr.throwArgumentError("invalid function signature","value",t),e.name=o[1].trim(),e.name&&zr(e.name),e.inputs=jr(o[2],!1),Ir(o[3].trim(),e),n.length>1){var i=n[1].match(Gr);""==i[1].trim()&&""==i[3].trim()||wr.throwArgumentError("unexpected tokens","value",t),e.outputs=jr(i[2],!1)}else e.outputs=[];return r.fromObject(e)}},{key:"isFunctionFragment",value:function(t){return t&&t._isFragment&&"function"===t.type}}]),r}(Cr);function Br(t){var e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||wr.throwArgumentError("cannot specify user defined ".concat(e," error"),"fragment",t),t}var Fr=function(t){hr(r,t);var e=dr(r);function r(){return mr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Or.sighash),Or[t]||wr.throwArgumentError("invalid format type","format",t),t===Or.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==Or.sighash&&(e+="error "),(e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===Or.full?", ":",")+") ").trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isErrorFragment(t))return t;"error"!==t.type&&wr.throwArgumentError("invalid error object","value",t);var e={type:t.type,name:zr(t.name),inputs:t.inputs?t.inputs.map(Pr.fromObject):[]};return Br(new r(_r,e))}},{key:"fromString",value:function(t){var e={type:"error"},n=t.match(Gr);return n||wr.throwArgumentError("invalid error signature","value",t),e.name=n[1].trim(),e.name&&zr(e.name),e.inputs=jr(n[2],!1),Br(r.fromObject(e))}},{key:"isErrorFragment",value:function(t){return t&&t._isFragment&&"error"===t.type}}]),r}(Tr);function Dr(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}var Ur=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function zr(t){return t&&t.match(Ur)||wr.throwArgumentError('invalid identifier "'.concat(t,'"'),"value",t),t}var Gr=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Hr(t){return(Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Hr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Hr(i)?i:String(i)),n)}var o,i}var Kr=new h.b("abi/5.7.0"),Wr=new RegExp(/^bytes([0-9]*)$/),Qr=new RegExp(/^(u?int)([0-9]*)$/),Vr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),T(this,"coerceFunc",e||null)}var e,r,n;return e=t,(r=[{key:"_getCoder",value:function(t){var e=this;switch(t.baseType){case"address":return new Mt(t.name);case"bool":return new ae(t.name);case"string":return new nr(t.name);case"bytes":return new be(t.name);case"array":return new $t(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new lr((t.components||[]).map((function(t){return e._getCoder(t)})),t.name);case"":return new Ie(t.name)}var r=t.type.match(Qr);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&Kr.throwArgumentError("invalid "+r[1]+" bit length","param",t),new Ve(n/8,"int"===r[1],t.name)}if(r=t.type.match(Wr)){var o=parseInt(r[1]);return(0===o||o>32)&&Kr.throwArgumentError("invalid bytes length","param",t),new Oe(o,t.name)}return Kr.throwArgumentError("invalid type","type",t.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(t,e){return new Q(t,this._getWordSize(),this.coerceFunc,e)}},{key:"_getWriter",value:function(){return new W(this._getWordSize())}},{key:"getDefaultValue",value:function(t){var e=this,r=t.map((function(t){return e._getCoder(Pr.from(t))}));return new lr(r,"_").defaultValue()}},{key:"encode",value:function(t,e){var r=this;t.length!==e.length&&Kr.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var n=t.map((function(t){return r._getCoder(Pr.from(t))})),o=new lr(n,"_"),i=this._getWriter();return o.encode(i,e),i.data}},{key:"decode",value:function(t,e,r){var n=this,o=t.map((function(t){return n._getCoder(Pr.from(t))}));return new lr(o,"_").decode(this._getReader(Object(c.a)(e),r))}}])&&qr(e.prototype,r),n&&qr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Jr=new Vr;function Yr(t){return(Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Yr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Yr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Yr(i)?i:String(i)),n)}var o,i}function Xr(t,e,r){return e&&Zr(t.prototype,e),r&&Zr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&en(t,e)}function en(t,e){return(en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function rn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=on(t);if(e){var o=on(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return nn(this,r)}}function nn(t,e){if(e&&("object"===Yr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function on(t){return(on=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var an=new h.b("abi/5.7.0"),un=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r)}(F),sn=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r)}(F),cn=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r)}(F),ln=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r,null,[{key:"isIndexed",value:function(t){return!(!t||!t._isIndexed)}}]),r}(F),fn={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function hn(t,e){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(t));return r.error=e,r}var pn=function(){function t(e){var r=this;$r(this,t);T(this,"fragments",("string"==typeof e?JSON.parse(e):e).map((function(t){return Tr.from(t)})).filter((function(t){return null!=t}))),T(this,"_abiCoder",R(this instanceof t?this.constructor:void 0,"getAbiCoder")()),T(this,"functions",{}),T(this,"errors",{}),T(this,"events",{}),T(this,"structs",{}),this.fragments.forEach((function(t){var e=null;switch(t.type){case"constructor":return r.deploy?void an.warn("duplicate definition - constructor"):void T(r,"deploy",t);case"function":e=r.functions;break;case"event":e=r.events;break;case"error":e=r.errors;break;default:return}var n=t.format();e[n]?an.warn("duplicate definition - "+n):e[n]=t})),this.deploy||T(this,"deploy",Cr.from({payable:!1,type:"constructor"})),T(this,"_isInterface",!0)}return Xr(t,[{key:"format",value:function(t){t||(t=Or.full),t===Or.sighash&&an.throwArgumentError("interface does not support formatting sighash","format",t);var e=this.fragments.map((function(e){return e.format(t)}));return t===Or.json?JSON.stringify(e.map((function(t){return JSON.parse(t)}))):e}},{key:"getFunction",value:function(t){if(Object(c.l)(t)){for(var e in this.functions)if(t===this.getSighash(e))return this.functions[e];an.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){var r=t.trim(),n=Object.keys(this.functions).filter((function(t){return t.split("(")[0]===r}));return 0===n.length?an.throwArgumentError("no matching function","name",r):n.length>1&&an.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var o=this.functions[Mr.fromString(t).format()];return o||an.throwArgumentError("no matching function","signature",t),o}},{key:"getEvent",value:function(t){if(Object(c.l)(t)){var e=t.toLowerCase();for(var r in this.events)if(e===this.getEventTopic(r))return this.events[r];an.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){var n=t.trim(),o=Object.keys(this.events).filter((function(t){return t.split("(")[0]===n}));return 0===o.length?an.throwArgumentError("no matching event","name",n):o.length>1&&an.throwArgumentError("multiple matching events","name",n),this.events[o[0]]}var i=this.events[Rr.fromString(t).format()];return i||an.throwArgumentError("no matching event","signature",t),i}},{key:"getError",value:function(t){if(Object(c.l)(t)){var e=R(this.constructor,"getSighash");for(var r in this.errors){if(t===e(this.errors[r]))return this.errors[r]}an.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){var n=t.trim(),o=Object.keys(this.errors).filter((function(t){return t.split("(")[0]===n}));return 0===o.length?an.throwArgumentError("no matching error","name",n):o.length>1&&an.throwArgumentError("multiple matching errors","name",n),this.errors[o[0]]}var i=this.errors[Mr.fromString(t).format()];return i||an.throwArgumentError("no matching error","signature",t),i}},{key:"getSighash",value:function(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return R(this.constructor,"getSighash")(t)}},{key:"getEventTopic",value:function(t){return"string"==typeof t&&(t=this.getEvent(t)),R(this.constructor,"getEventTopic")(t)}},{key:"_decodeParams",value:function(t,e){return this._abiCoder.decode(t,e)}},{key:"_encodeParams",value:function(t,e){return this._abiCoder.encode(t,e)}},{key:"encodeDeploy",value:function(t){return this._encodeParams(this.deploy.inputs,t||[])}},{key:"decodeErrorResult",value:function(t,e){"string"==typeof t&&(t=this.getError(t));var r=Object(c.a)(e);return Object(c.i)(r.slice(0,4))!==this.getSighash(t)&&an.throwArgumentError("data signature does not match error ".concat(t.name,"."),"data",Object(c.i)(r)),this._decodeParams(t.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(t,e){return"string"==typeof t&&(t=this.getError(t)),Object(c.i)(Object(c.b)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}},{key:"decodeFunctionData",value:function(t,e){"string"==typeof t&&(t=this.getFunction(t));var r=Object(c.a)(e);return Object(c.i)(r.slice(0,4))!==this.getSighash(t)&&an.throwArgumentError("data signature does not match function ".concat(t.name,"."),"data",Object(c.i)(r)),this._decodeParams(t.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Object(c.i)(Object(c.b)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}},{key:"decodeFunctionResult",value:function(t,e){"string"==typeof t&&(t=this.getFunction(t));var r=Object(c.a)(e),n=null,o="",i=null,a=null,u=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(f){}break;case 4:var s=Object(c.i)(r.slice(0,4)),l=fn[s];if(l)i=this._abiCoder.decode(l.inputs,r.slice(4)),a=l.name,u=l.signature,l.reason&&(n=i[0]),"Error"===a?o="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(i[0])):"Panic"===a&&(o="; VM Exception while processing transaction: reverted with panic code ".concat(i[0]));else try{var f=this.getError(s);i=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,u=f.format()}catch(f){}}return an.throwError("call revert exception"+o,h.b.errors.CALL_EXCEPTION,{method:t.format(),data:Object(c.i)(e),errorArgs:i,errorName:a,errorSignature:u,reason:n})}},{key:"encodeFunctionResult",value:function(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Object(c.i)(this._abiCoder.encode(t.outputs,e||[]))}},{key:"encodeFilterTopics",value:function(t,e){var r=this;"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&an.throwError("too many arguments for "+t.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});var n=[];t.anonymous||n.push(this.getEventTopic(t));var o=function(t,e){return"string"===t.type?jt(e):"bytes"===t.type?Y(Object(c.i)(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=b.from(e).toHexString()),"address"===t.type&&r._abiCoder.encode(["address"],[e]),Object(c.h)(Object(c.i)(e),32))};for(e.forEach((function(e,r){var i=t.inputs[r];i.indexed?null==e?n.push(null):"array"===i.baseType||"tuple"===i.baseType?an.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,e):Array.isArray(e)?n.push(e.map((function(t){return o(i,t)}))):n.push(o(i,e)):null!=e&&an.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(t,e){var r=this;"string"==typeof t&&(t=this.getEvent(t));var n=[],o=[],i=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&an.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach((function(t,a){var u=e[a];if(t.indexed)if("string"===t.type)n.push(jt(u));else if("bytes"===t.type)n.push(Y(u));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([t.type],[u]))}else o.push(t),i.push(u)})),{data:this._abiCoder.encode(o,i),topics:n}}},{key:"decodeEventLog",value:function(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){var n=this.getEventTopic(t);Object(c.l)(r[0],32)&&r[0].toLowerCase()===n||an.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var o=[],i=[],a=[];t.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(o.push(Pr.fromObject({type:"bytes32",name:t.name})),a.push(!0)):(o.push(t),a.push(!1)):(i.push(t),a.push(!1))}));var u=null!=r?this._abiCoder.decode(o,Object(c.b)(r)):null,s=this._abiCoder.decode(i,e,!0),l=[],f=0,p=0;t.inputs.forEach((function(t,e){if(t.indexed)if(null==u)l[e]=new ln({_isIndexed:!0,hash:null});else if(a[e])l[e]=new ln({_isIndexed:!0,hash:u[p++]});else try{l[e]=u[p++]}catch(t){l[e]=t}else try{l[e]=s[f++]}catch(t){l[e]=t}if(t.name&&null==l[t.name]){var r=l[e];r instanceof Error?Object.defineProperty(l,t.name,{enumerable:!0,get:function(){throw hn("property ".concat(JSON.stringify(t.name)),r)}}):l[t.name]=r}}));for(var d=function(t){var e=l[t];e instanceof Error&&Object.defineProperty(l,t,{enumerable:!0,get:function(){throw hn("index ".concat(t),e)}})},v=0;v<l.length;v++)d(v);return Object.freeze(l)}},{key:"parseTransaction",value:function(t){var e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new sn({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:b.from(t.value||"0")}):null}},{key:"parseLog",value:function(t){var e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new un({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}},{key:"parseError",value:function(t){var e=Object(c.i)(t),r=this.getError(e.substring(0,10).toLowerCase());return r?new cn({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}}],[{key:"getAbiCoder",value:function(){return Jr}},{key:"getAddress",value:function(t){return ht(t)}},{key:"getSighash",value:function(t){return Object(c.e)(jt(t.format()),0,4)}},{key:"getEventTopic",value:function(t){return jt(t.format())}},{key:"isInterface",value:function(t){return!(!t||!t._isInterface)}}]),t}();function dn(t){return(dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */vn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==dn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function yn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==dn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===dn(i)?i:String(i)),n)}var o,i}function gn(t,e,r){return e&&mn(t.prototype,e),r&&mn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wn(t,e)}function wn(t,e){return(wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function _n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=En(t);if(e){var o=En(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return kn(this,r)}}function kn(t,e){if(e&&("object"===dn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function En(t){return(En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xn=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},An=new h.b("abstract-provider/5.7.0"),On=function(t){bn(r,t);var e=_n(r);function r(){return yn(this,r),e.apply(this,arguments)}return gn(r,null,[{key:"isForkEvent",value:function(t){return!(!t||!t._isForkEvent)}}]),r}(F),Sn=function(){function t(){yn(this,t),An.checkAbstract(this instanceof t?this.constructor:void 0,t),T(this,"_isProvider",!0)}return gn(t,[{key:"getFeeData",value:function(){return xn(this,void 0,void 0,vn().mark((function t(){var e,r,n,o,i,a;return vn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,N({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((function(t){return null}))});case 2:return e=t.sent,r=e.block,n=e.gasPrice,o=null,i=null,a=null,r&&r.baseFeePerGas&&(o=r.baseFeePerGas,a=b.from("1500000000"),i=r.baseFeePerGas.mul(2).add(a)),t.abrupt("return",{lastBaseFeePerGas:o,maxFeePerGas:i,maxPriorityFeePerGas:a,gasPrice:n});case 8:case"end":return t.stop()}}),t,this)})))}},{key:"addListener",value:function(t,e){return this.on(t,e)}},{key:"removeListener",value:function(t,e){return this.off(t,e)}}],[{key:"isProvider",value:function(t){return!(!t||!t._isProvider)}}]),t}();function Pn(t){return(Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jn(t,e){return(jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Tn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=In(t);if(e){var o=In(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Rn(this,r)}}function Rn(t,e){if(e&&("object"===Pn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Nn(t)}function Nn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function In(t){return(In=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ln(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ln=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==Pn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Cn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Pn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Pn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Pn(i)?i:String(i)),n)}var o,i}function Bn(t,e,r){return e&&Mn(t.prototype,e),r&&Mn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Fn=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Dn=new h.b("abstract-signer/5.7.0"),Un=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],zn=[h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED],Gn=function(){function t(){Cn(this,t),Dn.checkAbstract(this instanceof t?this.constructor:void 0,t),T(this,"_isSigner",!0)}return Bn(t,[{key:"getBalance",value:function(t){return Fn(this,void 0,void 0,Ln().mark((function e(){return Ln().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getBalance"),e.next=3,this.provider.getBalance(this.getAddress(),t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionCount",value:function(t){return Fn(this,void 0,void 0,Ln().mark((function e(){return Ln().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getTransactionCount"),e.next=3,this.provider.getTransactionCount(this.getAddress(),t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGas",value:function(t){return Fn(this,void 0,void 0,Ln().mark((function e(){var r;return Ln().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("estimateGas"),e.next=3,N(this.checkTransaction(t));case 3:return r=e.sent,e.next=6,this.provider.estimateGas(r);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"call",value:function(t,e){return Fn(this,void 0,void 0,Ln().mark((function r(){var n;return Ln().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this._checkProvider("call"),r.next=3,N(this.checkTransaction(t));case 3:return n=r.sent,r.next=6,this.provider.call(n,e);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sendTransaction",value:function(t){return Fn(this,void 0,void 0,Ln().mark((function e(){var r,n;return Ln().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("sendTransaction"),e.next=3,this.populateTransaction(t);case 3:return r=e.sent,e.next=6,this.signTransaction(r);case 6:return n=e.sent,e.next=9,this.provider.sendTransaction(n);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)})))}},{key:"getChainId",value:function(){return Fn(this,void 0,void 0,Ln().mark((function t(){var e;return Ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getChainId"),t.next=3,this.provider.getNetwork();case 3:return e=t.sent,t.abrupt("return",e.chainId);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"getGasPrice",value:function(){return Fn(this,void 0,void 0,Ln().mark((function t(){return Ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getGasPrice"),t.next=3,this.provider.getGasPrice();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getFeeData",value:function(){return Fn(this,void 0,void 0,Ln().mark((function t(){return Ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getFeeData"),t.next=3,this.provider.getFeeData();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"resolveName",value:function(t){return Fn(this,void 0,void 0,Ln().mark((function e(){return Ln().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("resolveName"),e.next=3,this.provider.resolveName(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"checkTransaction",value:function(t){for(var e in t)-1===Un.indexOf(e)&&Dn.throwArgumentError("invalid transaction key: "+e,"transaction",t);var r=L(t);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then((function(e){return e[0].toLowerCase()!==e[1].toLowerCase()&&Dn.throwArgumentError("from address mismatch","transaction",t),e[0]})),r}},{key:"populateTransaction",value:function(t){return Fn(this,void 0,void 0,Ln().mark((function e(){var r,n,o,i,a=this;return Ln().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N(this.checkTransaction(t));case 2:if(null!=(r=e.sent).to&&(r.to=Promise.resolve(r.to).then((function(t){return Fn(a,void 0,void 0,Ln().mark((function e(){var r;return Ln().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this.resolveName(t);case 4:return null==(r=e.sent)&&Dn.throwArgumentError("provided ENS name resolves to null","tx.to",t),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)})))})),r.to.catch((function(t){}))),n=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas,null==r.gasPrice||2!==r.type&&!n?0!==r.type&&1!==r.type||!n||Dn.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):Dn.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas){e.next=10;break}r.type=2,e.next=18;break;case 10:if(0!==r.type&&1!==r.type){e.next=14;break}null==r.gasPrice&&(r.gasPrice=this.getGasPrice()),e.next=18;break;case 14:return e.next=16,this.getFeeData();case 16:o=e.sent,null==r.type?null!=o.maxFeePerGas&&null!=o.maxPriorityFeePerGas?(r.type=2,null!=r.gasPrice?(i=r.gasPrice,delete r.gasPrice,r.maxFeePerGas=i,r.maxPriorityFeePerGas=i):(null==r.maxFeePerGas&&(r.maxFeePerGas=o.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))):null!=o.gasPrice?(n&&Dn.throwError("network does not support EIP-1559",h.b.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=o.gasPrice),r.type=0):Dn.throwError("failed to get consistent fee data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=o.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas));case 18:return null==r.nonce&&(r.nonce=this.getTransactionCount("pending")),null==r.gasLimit&&(r.gasLimit=this.estimateGas(r).catch((function(t){if(zn.indexOf(t.code)>=0)throw t;return Dn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(e){return 0!==e[1]&&e[0]!==e[1]&&Dn.throwArgumentError("chainId address mismatch","transaction",t),e[0]})),e.next=23,N(r);case 23:return e.abrupt("return",e.sent);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"_checkProvider",value:function(t){this.provider||Dn.throwError("missing provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}}],[{key:"isSigner",value:function(t){return!(!t||!t._isSigner)}}]),t}(),Hn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jn(t,e)}(r,t);var e=Tn(r);function r(t,n){var o;return Cn(this,r),T(Nn(o=e.call(this)),"address",t),T(Nn(o),"provider",n||null),o}return Bn(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(t,e){return Promise.resolve().then((function(){Dn.throwError(t,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})}))}},{key:"signMessage",value:function(t){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(t){return new r(this.address,t)}}]),r}(Gn),qn=r(34);function Kn(t){return(Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Kn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Kn(i)?i:String(i)),n)}var o,i}var Qn=new h.b("signing-key/5.7.0"),Vn=null;function Jn(){return Vn||(Vn=new qn.a("secp256k1")),Vn}var Yn=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),T(this,"curve","secp256k1"),T(this,"privateKey",Object(c.i)(e)),32!==Object(c.d)(this.privateKey)&&Qn.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=Jn().keyFromPrivate(Object(c.a)(this.privateKey));T(this,"publicKey","0x"+r.getPublic(!1,"hex")),T(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),T(this,"_isSigningKey",!0)}var e,r,n;return e=t,n=[{key:"isSigningKey",value:function(t){return!(!t||!t._isSigningKey)}}],(r=[{key:"_addPoint",value:function(t){var e=Jn().keyFromPublic(Object(c.a)(this.publicKey)),r=Jn().keyFromPublic(Object(c.a)(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(t){var e=Jn().keyFromPrivate(Object(c.a)(this.privateKey)),r=Object(c.a)(t);32!==r.length&&Qn.throwArgumentError("bad digest length","digest",t);var n=e.sign(r,{canonical:!0});return Object(c.n)({recoveryParam:n.recoveryParam,r:Object(c.h)("0x"+n.r.toString(16),32),s:Object(c.h)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(t){var e=Jn().keyFromPrivate(Object(c.a)(this.privateKey)),r=Jn().keyFromPublic(Object(c.a)(Xn(t)));return Object(c.h)("0x"+e.derive(r.getPublic()).toString(16),32)}}])&&Wn(e.prototype,r),n&&Wn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Zn(t,e){var r=Object(c.n)(e),n={r:Object(c.a)(r.r),s:Object(c.a)(r.s)};return"0x"+Jn().recoverPubKey(Object(c.a)(t),n,r.recoveryParam).encode("hex",!1)}function Xn(t,e){var r=Object(c.a)(t);if(32===r.length){var n=new Yn(r);return e?"0x"+Jn().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?e?Object(c.i)(r):"0x"+Jn().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+Jn().keyFromPublic(r).getPublic(!0,"hex"):Object(c.i)(r):Qn.throwArgumentError("invalid public or private key","key","[REDACTED]")}var $n,to=new h.b("transactions/5.7.0");function eo(t){return"0x"===t?null:ht(t)}function ro(t){return"0x"===t?Ce:b.from(t)}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}($n||($n={}));var no=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],oo={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function io(t){var e=Xn(t);return ht(Object(c.e)(Y(Object(c.e)(e,1)),12))}function ao(t,e){return io(Zn(Object(c.a)(t),e))}function uo(t,e){var r=Object(c.o)(b.from(t).toHexString());return r.length>32&&to.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function so(t,e){return{address:ht(t),storageKeys:(e||[]).map((function(e,r){return 32!==Object(c.d)(e)&&to.throwArgumentError("invalid access list storageKey","accessList[".concat(t,":").concat(r,"]"),e),e.toLowerCase()}))}}function co(t){if(Array.isArray(t))return t.map((function(t,e){return Array.isArray(t)?(t.length>2&&to.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(e,"]"),t),so(t[0],t[1])):so(t.address,t.storageKeys)}));var e=Object.keys(t).map((function(e){var r=t[e].reduce((function(t,e){return t[e]=!0,t}),{});return so(e,Object.keys(r).sort())}));return e.sort((function(t,e){return t.address.localeCompare(e.address)})),e}function lo(t){return co(t).map((function(t){return[t.address,t.storageKeys]}))}function fo(t,e){if(null!=t.gasPrice){var r=b.from(t.gasPrice),n=b.from(t.maxFeePerGas||0);r.eq(n)||to.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var o=[uo(t.chainId||0,"chainId"),uo(t.nonce||0,"nonce"),uo(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),uo(t.maxFeePerGas||0,"maxFeePerGas"),uo(t.gasLimit||0,"gasLimit"),null!=t.to?ht(t.to):"0x",uo(t.value||0,"value"),t.data||"0x",lo(t.accessList||[])];if(e){var i=Object(c.n)(e);o.push(uo(i.recoveryParam,"recoveryParam")),o.push(Object(c.o)(i.r)),o.push(Object(c.o)(i.s))}return Object(c.c)(["0x02",tt(o)])}function ho(t,e){var r=[uo(t.chainId||0,"chainId"),uo(t.nonce||0,"nonce"),uo(t.gasPrice||0,"gasPrice"),uo(t.gasLimit||0,"gasLimit"),null!=t.to?ht(t.to):"0x",uo(t.value||0,"value"),t.data||"0x",lo(t.accessList||[])];if(e){var n=Object(c.n)(e);r.push(uo(n.recoveryParam,"recoveryParam")),r.push(Object(c.o)(n.r)),r.push(Object(c.o)(n.s))}return Object(c.c)(["0x01",tt(r)])}function po(t,e){if(null==t.type||0===t.type)return null!=t.accessList&&to.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),function(t,e){I(t,oo);var r=[];no.forEach((function(e){var n=t[e.name]||[],o={};e.numeric&&(o.hexPad="left"),n=Object(c.a)(Object(c.i)(n,o)),e.length&&n.length!==e.length&&n.length>0&&to.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=Object(c.o)(n)).length>e.maxLength&&to.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),r.push(Object(c.i)(n))}));var n=0;if(null!=t.chainId?"number"!=typeof(n=t.chainId)&&to.throwArgumentError("invalid transaction.chainId","transaction",t):e&&!Object(c.k)(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),0!==n&&(r.push(Object(c.i)(n)),r.push("0x"),r.push("0x")),!e)return tt(r);var o=Object(c.n)(e),i=27+o.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),i+=2*n+8,o.v>28&&o.v!==i&&to.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):o.v!==i&&to.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(Object(c.i)(i)),r.push(Object(c.o)(Object(c.a)(o.r))),r.push(Object(c.o)(Object(c.a)(o.s))),tt(r)}(t,e);switch(t.type){case 1:return ho(t,e);case 2:return fo(t,e)}return to.throwError("unsupported transaction type: ".concat(t.type),h.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function vo(t,e,r){try{var n=ro(e[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");t.v=n}catch(t){to.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Object(c.h)(e[1],32),t.s=Object(c.h)(e[2],32);try{var o=Y(r(t));t.from=ao(o,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function yo(t){var e=Object(c.a)(t);if(e[0]>127)return function(t){var e=nt(t);9!==e.length&&6!==e.length&&to.throwArgumentError("invalid raw transaction","rawTransaction",t);var r={nonce:ro(e[0]).toNumber(),gasPrice:ro(e[1]),gasLimit:ro(e[2]),to:eo(e[3]),value:ro(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=b.from(e[6]).toNumber()}catch(t){return r}if(r.r=Object(c.h)(e[7],32),r.s=Object(c.h)(e[8],32),b.from(r.r).isZero()&&b.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);var n=r.v-27,o=e.slice(0,6);0!==r.chainId&&(o.push(Object(c.i)(r.chainId)),o.push("0x"),o.push("0x"),n-=2*r.chainId+8);var i=Y(tt(o));try{r.from=ao(i,{r:Object(c.i)(r.r),s:Object(c.i)(r.s),recoveryParam:n})}catch(t){}r.hash=Y(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){var e=nt(t.slice(1));8!==e.length&&11!==e.length&&to.throwArgumentError("invalid component count for transaction type: 1","payload",Object(c.i)(t));var r={type:1,chainId:ro(e[0]).toNumber(),nonce:ro(e[1]).toNumber(),gasPrice:ro(e[2]),gasLimit:ro(e[3]),to:eo(e[4]),value:ro(e[5]),data:e[6],accessList:co(e[7])};return 8===e.length||(r.hash=Y(t),vo(r,e.slice(8),ho)),r}(e);case 2:return function(t){var e=nt(t.slice(1));9!==e.length&&12!==e.length&&to.throwArgumentError("invalid component count for transaction type: 2","payload",Object(c.i)(t));var r=ro(e[2]),n=ro(e[3]),o={type:2,chainId:ro(e[0]).toNumber(),nonce:ro(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:ro(e[4]),to:eo(e[5]),value:ro(e[6]),data:e[7],accessList:co(e[8])};return 9===e.length||(o.hash=Y(t),vo(o,e.slice(9),fo)),o}(e)}return to.throwError("unsupported transaction type: ".concat(e[0]),h.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}function mo(t){return function(t){if(Array.isArray(t))return go(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return go(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return go(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function go(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bo(){return(bo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=wo(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function wo(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Oo(t)););return t}function _o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ko(t,e)}function ko(t,e){return(ko=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Eo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Oo(t);if(e){var o=Oo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return xo(this,r)}}function xo(t,e){if(e&&("object"===To(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ao(t)}function Ao(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Oo(t){return(Oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function So(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Po(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==To(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==To(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===To(i)?i:String(i)),n)}var o,i}function jo(t,e,r){return e&&Po(t.prototype,e),r&&Po(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function To(t){return(To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ro(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ro=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==To(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var No=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Io=new h.b("contracts/5.7.0"),Lo={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function Co(t,e){return No(this,void 0,void 0,Ro().mark((function r(){var n,o;return Ro().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e;case 2:return"string"!=typeof(n=r.sent)&&Io.throwArgumentError("invalid address or ENS name","name",n),r.prev=4,r.abrupt("return",ht(n));case 8:r.prev=8,r.t0=r.catch(4);case 10:return t||Io.throwError("a provider or signer is needed to resolve ENS names",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),r.next=13,t.resolveName(n);case 13:return null==(o=r.sent)&&Io.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r.abrupt("return",o);case 16:case"end":return r.stop()}}),r,null,[[4,8]])})))}function Mo(t,e,r){return No(this,void 0,void 0,Ro().mark((function n(){return Ro().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=4;break}return n.next=3,Promise.all(r.map((function(r,n){return Mo(t,Array.isArray(e)?e[n]:e[r.name],r)})));case 3:return n.abrupt("return",n.sent);case 4:if("address"!==r.type){n.next=8;break}return n.next=7,Co(t,e);case 7:return n.abrupt("return",n.sent);case 8:if("tuple"!==r.type){n.next=12;break}return n.next=11,Mo(t,e,r.components);case 11:return n.abrupt("return",n.sent);case 12:if("array"!==r.baseType){n.next=18;break}if(Array.isArray(e)){n.next=15;break}return n.abrupt("return",Promise.reject(Io.makeError("invalid value for array",h.b.errors.INVALID_ARGUMENT,{argument:"value",value:e})));case 15:return n.next=17,Promise.all(e.map((function(e){return Mo(t,e,r.arrayChildren)})));case 17:return n.abrupt("return",n.sent);case 18:return n.abrupt("return",e);case 19:case"end":return n.stop()}}),n)})))}function Bo(t,e,r){return No(this,void 0,void 0,Ro().mark((function n(){var o,i,a,u,s,l,f,p,d,v,y=this;return Ro().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o={},r.length===e.inputs.length+1&&"object"===To(r[r.length-1])&&(o=L(r.pop())),Io.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?o.from?o.from=N({override:Co(t.signer,o.from),signer:t.signer.getAddress()}).then((function(t){return No(y,void 0,void 0,Ro().mark((function e(){return Ro().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ht(t.signer)!==t.override&&Io.throwError("Contract with a Signer cannot override from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.abrupt("return",t.override);case 2:case"end":return e.stop()}}),e)})))})):o.from=t.signer.getAddress():o.from&&(o.from=Co(t.provider,o.from)),n.next=6,N({args:Mo(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:N(o)||{}});case 6:if(i=n.sent,a=t.interface.encodeFunctionData(e,i.args),u={data:a,to:i.address},null!=(s=i.overrides).nonce&&(u.nonce=b.from(s.nonce).toNumber()),null!=s.gasLimit&&(u.gasLimit=b.from(s.gasLimit)),null!=s.gasPrice&&(u.gasPrice=b.from(s.gasPrice)),null!=s.maxFeePerGas&&(u.maxFeePerGas=b.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(u.maxPriorityFeePerGas=b.from(s.maxPriorityFeePerGas)),null!=s.from&&(u.from=s.from),null!=s.type&&(u.type=s.type),null!=s.accessList&&(u.accessList=co(s.accessList)),null==u.gasLimit&&null!=e.gas){for(l=21e3,f=Object(c.a)(a),p=0;p<f.length;p++)l+=4,f[p]&&(l+=64);u.gasLimit=b.from(e.gas).add(l)}return s.value&&((d=b.from(s.value)).isZero()||e.payable||Io.throwError("non-payable method cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:o.value}),u.value=d),s.customData&&(u.customData=L(s.customData)),s.ccipReadEnabled&&(u.ccipReadEnabled=!!s.ccipReadEnabled),delete o.nonce,delete o.gasLimit,delete o.gasPrice,delete o.from,delete o.value,delete o.type,delete o.accessList,delete o.maxFeePerGas,delete o.maxPriorityFeePerGas,delete o.customData,delete o.ccipReadEnabled,(v=Object.keys(o).filter((function(t){return null!=o[t]}))).length&&Io.throwError("cannot override ".concat(v.map((function(t){return JSON.stringify(t)})).join(",")),h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:v}),n.abrupt("return",u);case 36:case"end":return n.stop()}}),n)})))}function Fo(t,e){var r=e.wait.bind(e);e.wait=function(e){return r(e).then((function(e){return e.events=e.logs.map((function(r){var n=B(r),o=null;try{o=t.interface.parseLog(r)}catch(t){}return o&&(n.args=o.args,n.decode=function(e,r){return t.interface.decodeEventLog(o.eventFragment,e,r)},n.event=o.name,n.eventSignature=o.signature),n.removeListener=function(){return t.provider},n.getBlock=function(){return t.provider.getBlock(e.blockHash)},n.getTransaction=function(){return t.provider.getTransaction(e.transactionHash)},n.getTransactionReceipt=function(){return Promise.resolve(e)},n})),e}))}}function Do(t,e,r){var n=t.signer||t.provider;return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return No(this,void 0,void 0,Ro().mark((function o(){var a,u,s,c,l;return Ro().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a=void 0,i.length!==e.inputs.length+1||"object"!==To(i[i.length-1])){o.next=9;break}if(null==(u=L(i.pop())).blockTag){o.next=7;break}return o.next=6,u.blockTag;case 6:a=o.sent;case 7:delete u.blockTag,i.push(u);case 9:if(null==t.deployTransaction){o.next=12;break}return o.next=12,t._deployed(a);case 12:return o.next=14,Bo(t,e,i);case 14:return s=o.sent,o.next=17,n.call(s,a);case 17:return c=o.sent,o.prev=18,l=t.interface.decodeFunctionResult(e,c),r&&1===e.outputs.length&&(l=l[0]),o.abrupt("return",l);case 24:throw o.prev=24,o.t0=o.catch(18),o.t0.code===h.b.errors.CALL_EXCEPTION&&(o.t0.address=t.address,o.t0.args=i,o.t0.transaction=s),o.t0;case 28:case"end":return o.stop()}}),o,null,[[18,24]])})))}}function Uo(t,e,r){return e.constant?Do(t,e,r):function(t,e){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return No(this,void 0,void 0,Ro().mark((function r(){var o,i;return Ro().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.signer||Io.throwError("sending a transaction requires a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null==t.deployTransaction){r.next=4;break}return r.next=4,t._deployed();case 4:return r.next=6,Bo(t,e,n);case 6:return o=r.sent,r.next=9,t.signer.sendTransaction(o);case 9:return i=r.sent,Fo(t,i),r.abrupt("return",i);case 12:case"end":return r.stop()}}),r)})))}}(t,e)}function zo(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((function(t){return Array.isArray(t)?t.join("|"):t})).join(":"):""):"*"}var Go=function(){function t(e,r){So(this,t),T(this,"tag",e),T(this,"filter",r),this._listeners=[]}return jo(t,[{key:"addListener",value:function(t,e){this._listeners.push({listener:t,once:e})}},{key:"removeListener",value:function(t){var e=!1;this._listeners=this._listeners.filter((function(r){return!(!e&&r.listener===t)||(e=!0,!1)}))}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"listeners",value:function(){return this._listeners.map((function(t){return t.listener}))}},{key:"listenerCount",value:function(){return this._listeners.length}},{key:"run",value:function(t){var e=this,r=this.listenerCount();return this._listeners=this._listeners.filter((function(r){var n=t.slice();return setTimeout((function(){r.listener.apply(e,n)}),0),!r.once})),r}},{key:"prepareEvent",value:function(t){}},{key:"getEmit",value:function(t){return[t]}}]),t}(),Ho=function(t){_o(r,t);var e=Eo(r);function r(){return So(this,r),e.call(this,"error",null)}return jo(r)}(Go),qo=function(t){_o(r,t);var e=Eo(r);function r(t,n,o,i){var a;So(this,r);var u={address:t},s=n.getEventTopic(o);return i?(s!==i[0]&&Io.throwArgumentError("topic mismatch","topics",i),u.topics=i.slice()):u.topics=[s],T(Ao(a=e.call(this,zo(u),u)),"address",t),T(Ao(a),"interface",n),T(Ao(a),"fragment",o),a}return jo(r,[{key:"prepareEvent",value:function(t){var e=this;bo(Oo(r.prototype),"prepareEvent",this).call(this,t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=function(t,r){return e.interface.decodeEventLog(e.fragment,t,r)};try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}},{key:"getEmit",value:function(t){var e=q(t.args);if(e.length)throw e[0].error;var r=(t.args||[]).slice();return r.push(t),r}}]),r}(Go),Ko=function(t){_o(r,t);var e=Eo(r);function r(t,n){var o;return So(this,r),T(Ao(o=e.call(this,"*",{address:t})),"address",t),T(Ao(o),"interface",n),o}return jo(r,[{key:"prepareEvent",value:function(t){var e=this;bo(Oo(r.prototype),"prepareEvent",this).call(this,t);try{var n=this.interface.parseLog(t);t.event=n.name,t.eventSignature=n.signature,t.decode=function(t,r){return e.interface.decodeEventLog(n.eventFragment,t,r)},t.args=n.args}catch(t){}}}]),r}(Go),Wo=function(){function t(e,r,n){var o=this;So(this,t),T(this,"interface",R(this instanceof t?this.constructor:void 0,"getInterface")(r)),null==n?(T(this,"provider",null),T(this,"signer",null)):Gn.isSigner(n)?(T(this,"provider",n.provider||null),T(this,"signer",n)):Sn.isProvider(n)?(T(this,"provider",n),T(this,"signer",null)):Io.throwArgumentError("invalid signer or provider","signerOrProvider",n),T(this,"callStatic",{}),T(this,"estimateGas",{}),T(this,"functions",{}),T(this,"populateTransaction",{}),T(this,"filters",{});var i={};if(Object.keys(this.interface.events).forEach((function(t){var e=o.interface.events[t];T(o.filters,t,(function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return{address:o.address,topics:o.interface.encodeFilterTopics(e,r)}})),i[e.name]||(i[e.name]=[]),i[e.name].push(t)})),Object.keys(i).forEach((function(t){var e=i[t];1===e.length?T(o.filters,t,o.filters[e[0]]):Io.warn("Duplicate definition of ".concat(t," (").concat(e.join(", "),")"))})),T(this,"_runningEvents",{}),T(this,"_wrappedEmits",{}),null==e&&Io.throwArgumentError("invalid contract address or ENS name","addressOrName",e),T(this,"address",e),this.provider)T(this,"resolvedAddress",Co(this.provider,e));else try{T(this,"resolvedAddress",Promise.resolve(ht(e)))}catch(t){Io.throwError("provider is required to use ENS name as contract address",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((function(t){}));var a={},u={};Object.keys(this.interface.functions).forEach((function(t){var e=o.interface.functions[t];if(u[t])Io.warn("Duplicate ABI entry for ".concat(JSON.stringify(t)));else{u[t]=!0;var r=e.name;a["%".concat(r)]||(a["%".concat(r)]=[]),a["%".concat(r)].push(t),null==o[t]&&T(o,t,Uo(o,e,!0)),null==o.functions[t]&&T(o.functions,t,Uo(o,e,!1)),null==o.callStatic[t]&&T(o.callStatic,t,Do(o,e,!0)),null==o.populateTransaction[t]&&T(o.populateTransaction,t,function(t,e){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return Bo(t,e,n)}}(o,e)),null==o.estimateGas[t]&&T(o.estimateGas,t,function(t,e){var r=t.signer||t.provider;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return No(this,void 0,void 0,Ro().mark((function n(){var i;return Ro().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r||Io.throwError("estimate require a provider or signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),n.next=3,Bo(t,e,o);case 3:return i=n.sent,n.next=6,r.estimateGas(i);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))}}(o,e))}})),Object.keys(a).forEach((function(t){var e=a[t];if(!(e.length>1)){t=t.substring(1);var r=e[0];try{null==o[t]&&T(o,t,o[r])}catch(t){}null==o.functions[t]&&T(o.functions,t,o.functions[r]),null==o.callStatic[t]&&T(o.callStatic,t,o.callStatic[r]),null==o.populateTransaction[t]&&T(o.populateTransaction,t,o.populateTransaction[r]),null==o.estimateGas[t]&&T(o.estimateGas,t,o.estimateGas[r])}}))}return jo(t,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(t){var e=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return e})):this._deployedPromise=this.provider.getCode(this.address,t).then((function(t){return"0x"===t&&Io.throwError("contract not deployed",h.b.errors.UNSUPPORTED_OPERATION,{contractAddress:e.address,operation:"getDeployed"}),e}))),this._deployedPromise}},{key:"fallback",value:function(t){var e=this;this.signer||Io.throwError("sending a transactions require a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=L(t||{});return["from","to"].forEach((function(t){null!=r[t]&&Io.throwError("cannot override "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})})),r.to=this.resolvedAddress,this.deployed().then((function(){return e.signer.sendTransaction(r)}))}},{key:"connect",value:function(t){"string"==typeof t&&(t=new Hn(t,this.provider));var e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&T(e,"deployTransaction",this.deployTransaction),e}},{key:"attach",value:function(t){return new this.constructor(t,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}},{key:"_getRunningEvent",value:function(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new Ho);if("event"===t)return this._normalizeRunningEvent(new Go("event",null));if("*"===t)return this._normalizeRunningEvent(new Ko(this.address,this.interface));var e=this.interface.getEvent(t);return this._normalizeRunningEvent(new qo(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{var r=t.topics[0];if("string"!=typeof r)throw new Error("invalid topic");var n=this.interface.getEvent(r);return this._normalizeRunningEvent(new qo(this.address,this.interface,n,t.topics))}catch(t){}var o={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new Go(zo(o),o))}return this._normalizeRunningEvent(new Ko(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];var e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}},{key:"_wrapEvent",value:function(t,e,r){var n=this,o=B(e);return o.removeListener=function(){r&&(t.removeListener(r),n._checkRunningEvents(t))},o.getBlock=function(){return n.provider.getBlock(e.blockHash)},o.getTransaction=function(){return n.provider.getTransaction(e.transactionHash)},o.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(e.transactionHash)},t.prepareEvent(o),o}},{key:"_addEventListener",value:function(t,e,r){var n=this;if(this.provider||Io.throwError("events require a provider or a signer with a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){var o=function(r){var o=n._wrapEvent(t,r,e);if(null==o.decodeError)try{var i=t.getEmit(o);n.emit.apply(n,[t.filter].concat(mo(i)))}catch(t){o.decodeError=t.error}null!=t.filter&&n.emit("event",o),null!=o.decodeError&&n.emit("error",o.decodeError,o)};this._wrappedEmits[t.tag]=o,null!=t.filter&&this.provider.on(t.filter,o)}}},{key:"queryFilter",value:function(t,e,r){var n=this,o=this._getRunningEvent(t),i=L(o.filter);return"string"==typeof e&&Object(c.l)(e,32)?(null!=r&&Io.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((function(t){return t.map((function(t){return n._wrapEvent(o,t,null)}))}))}},{key:"on",value:function(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}},{key:"once",value:function(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}},{key:"emit",value:function(t){if(!this.provider)return!1;for(var e=this._getRunningEvent(t),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=e.run(n)>0;return this._checkRunningEvents(e),i}},{key:"listenerCount",value:function(t){var e=this;return this.provider?null==t?Object.keys(this._runningEvents).reduce((function(t,r){return t+e._runningEvents[r].listenerCount()}),0):this._getRunningEvent(t).listenerCount():0}},{key:"listeners",value:function(t){if(!this.provider)return[];if(null==t){var e=[];for(var r in this._runningEvents)this._runningEvents[r].listeners().forEach((function(t){e.push(t)}));return e}return this._getRunningEvent(t).listeners()}},{key:"removeAllListeners",value:function(t){if(!this.provider)return this;if(null==t){for(var e in this._runningEvents){var r=this._runningEvents[e];r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(t);return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(t,e){if(!this.provider)return this;var r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(t,e){return this.off(t,e)}}],[{key:"getContractAddress",value:function(t){return vt(t)}},{key:"getInterface",value:function(t){return pn.isInterface(t)?t:new pn(t)}},{key:"isIndexed",value:function(t){return ln.isIndexed(t)}}]),t}(),Qo=function(t){_o(r,t);var e=Eo(r);function r(){return So(this,r),e.apply(this,arguments)}return jo(r)}(Wo),Vo=function(){function t(e,r,n){So(this,t);var o=null;"0x"!==(o="string"==typeof r?r:Object(c.j)(r)?Object(c.i)(r):r&&"string"==typeof r.object?r.object:"!").substring(0,2)&&(o="0x"+o),(!Object(c.l)(o)||o.length%2)&&Io.throwArgumentError("invalid bytecode","bytecode",r),n&&!Gn.isSigner(n)&&Io.throwArgumentError("invalid signer","signer",n),T(this,"bytecode",o),T(this,"interface",R(this instanceof t?this.constructor:void 0,"getInterface")(e)),T(this,"signer",n||null)}return jo(t,[{key:"getDeployTransaction",value:function(){for(var t={},e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length===this.interface.deploy.inputs.length+1&&"object"===To(r[r.length-1]))for(var o in t=L(r.pop()))if(!Lo[o])throw new Error("unknown transaction override "+o);if(["data","from","to"].forEach((function(e){null!=t[e]&&Io.throwError("cannot override "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value){var i=b.from(t.value);i.isZero()||this.interface.deploy.payable||Io.throwError("non-payable constructor cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return Io.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=Object(c.i)(Object(c.b)([this.bytecode,this.interface.encodeDeploy(r)])),t}},{key:"deploy",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return No(this,void 0,void 0,Ro().mark((function t(){var r,n,o,i,a,u;return Ro().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},e.length===this.interface.deploy.inputs.length+1&&(r=e.pop()),Io.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.next=5,Mo(this.signer,e,this.interface.deploy.inputs);case 5:return(n=t.sent).push(r),o=this.getDeployTransaction.apply(this,mo(n)),t.next=10,this.signer.sendTransaction(o);case 10:return i=t.sent,a=R(this.constructor,"getContractAddress")(i),Fo(u=R(this.constructor,"getContract")(a,this.interface,this.signer),i),T(u,"deployTransaction",i),t.abrupt("return",u);case 16:case"end":return t.stop()}}),t,this)})))}},{key:"attach",value:function(t){return this.constructor.getContract(t,this.interface,this.signer)}},{key:"connect",value:function(t){return new this.constructor(this.interface,this.bytecode,t)}}],[{key:"fromSolidity",value:function(t,e){null==t&&Io.throwError("missing compiler output",h.b.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));var r=t.abi,n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}},{key:"getInterface",value:function(t){return Qo.getInterface(t)}},{key:"getContractAddress",value:function(t){return vt(t)}},{key:"getContract",value:function(t,e,r){return new Qo(t,e,r)}}]),t}();function Jo(t){return(Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Jo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Jo(i)?i:String(i)),n)}var o,i}function Xo(t,e,r){return e&&Zo(t.prototype,e),r&&Zo(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var $o=new h.b("bignumber/5.7.0"),ti={},ei=b.from(0),ri=b.from(-1);function ni(t,e,r,n){var o={fault:e,operation:r};return void 0!==n&&(o.value=n),$o.throwError(t,h.b.errors.NUMERIC_FAULT,o)}for(var oi="0";oi.length<256;)oi+=oi;function ii(t){if("number"!=typeof t)try{t=b.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+oi.substring(0,t):$o.throwArgumentError("invalid decimal size","decimals",t)}function ai(t,e){null==e&&(e=0);var r=ii(e),n=(t=b.from(t)).lt(ei);n&&(t=t.mul(ri));for(var o=t.mod(r).toString();o.length<r.length-1;)o="0"+o;o=o.match(/^([0-9]*[1-9]|0)(0*)/)[1];var i=t.div(r).toString();return t=1===r.length?i:i+"."+o,n&&(t="-"+t),t}function ui(t,e){null==e&&(e=0);var r=ii(e);"string"==typeof t&&t.match(/^-?[0-9.]+$/)||$o.throwArgumentError("invalid decimal value","value",t);var n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&&$o.throwArgumentError("missing value","value",t);var o=t.split(".");o.length>2&&$o.throwArgumentError("too many decimal points","value",t);var i=o[0],a=o[1];for(i||(i="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&ni("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";var u=b.from(i),s=b.from(a),c=u.mul(r).add(s);return n&&(c=c.mul(ri)),c}var si=function(){function t(e,r,n,o){Yo(this,t),e!==ti&&$o.throwError("cannot use FixedFormat constructor; use FixedFormat.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=o,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(o),this._multiplier=ii(o),Object.freeze(this)}return Xo(t,null,[{key:"from",value:function(e){if(e instanceof t)return e;"number"==typeof e&&(e="fixed128x".concat(e));var r=!0,n=128,o=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)r=!1;else{var i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||$o.throwArgumentError("invalid fixed format","format",e),r="u"!==i[1],n=parseInt(i[2]),o=parseInt(i[3])}else if(e){var a=function(t,r,n){return null==e[t]?n:(Jo(e[t])!==r&&$o.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t])};r=a("signed","boolean",r),n=a("width","number",n),o=a("decimals","number",o)}return n%8&&$o.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),o>80&&$o.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",o),new t(ti,r,n,o)}}]),t}(),ci=function(){function t(e,r,n,o){Yo(this,t),e!==ti&&$o.throwError("cannot use FixedNumber constructor; use FixedNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=o,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}return Xo(t,[{key:"_checkFormat",value:function(t){this.format.name!==t.format.name&&$o.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}},{key:"addUnsafe",value:function(e){this._checkFormat(e);var r=ui(this._value,this.format.decimals),n=ui(e._value,e.format.decimals);return t.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(e){this._checkFormat(e);var r=ui(this._value,this.format.decimals),n=ui(e._value,e.format.decimals);return t.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(e){this._checkFormat(e);var r=ui(this._value,this.format.decimals),n=ui(e._value,e.format.decimals);return t.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(e){this._checkFormat(e);var r=ui(this._value,this.format.decimals),n=ui(e._value,e.format.decimals);return t.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var e=this.toString().split(".");1===e.length&&e.push("0");var r=t.from(e[0],this.format),n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(li.toFormat(r.format))),r}},{key:"ceiling",value:function(){var e=this.toString().split(".");1===e.length&&e.push("0");var r=t.from(e[0],this.format),n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(li.toFormat(r.format))),r}},{key:"round",value:function(e){null==e&&(e=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(e<0||e>80||e%1)&&$o.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;var n=t.from("1"+oi.substring(0,e),this.format),o=fi.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(o).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(t){if(null==t)return this._hex;t%8&&$o.throwArgumentError("invalid byte width","width",t);var e=b.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return Object(c.h)(e,t/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(e){return t.fromString(this._value,e)}}],[{key:"fromValue",value:function(e,r,n){return null!=n||null==r||function(t){return null!=t&&(b.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||Object(c.l)(t)||"bigint"==typeof t||Object(c.j)(t))}(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),t.fromString(ai(e,r),si.from(n))}},{key:"fromString",value:function(e,r){null==r&&(r="fixed");var n=si.from(r),o=ui(e,n.decimals);!n.signed&&o.lt(ei)&&ni("unsigned value cannot be negative","overflow","value",e);var i=null;n.signed?i=o.toTwos(n.width).toHexString():(i=o.toHexString(),i=Object(c.h)(i,n.width/8));var a=ai(o,n.decimals);return new t(ti,i,a,n)}},{key:"fromBytes",value:function(e,r){null==r&&(r="fixed");var n=si.from(r);if(Object(c.a)(e).length>n.width/8)throw new Error("overflow");var o=b.from(e);n.signed&&(o=o.fromTwos(n.width));var i=o.toTwos((n.signed?0:1)+n.width).toHexString(),a=ai(o,n.decimals);return new t(ti,i,a,n)}},{key:"from",value:function(e,r){if("string"==typeof e)return t.fromString(e,r);if(Object(c.j)(e))return t.fromBytes(e,r);try{return t.fromValue(e,0,r)}catch(t){if(t.code!==h.b.errors.INVALID_ARGUMENT)throw t}return $o.throwArgumentError("invalid FixedNumber value","value",e)}},{key:"isFixedNumber",value:function(t){return!(!t||!t._isFixedNumber)}}]),t}(),li=ci.from(1),fi=ci.from("0.5");function hi(t){return"string"==typeof t&&(t=Et(t)),Y(Object(c.b)([Et("Ethereum Signed Message:\n"),Et(String(t.length)),t]))}function pi(t){return(pi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function di(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */di=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==pi(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function vi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==pi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==pi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===pi(i)?i:String(i)),n)}var o,i}var yi=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},mi=new h.b("hash/5.7.0"),gi=new Uint8Array(32);gi.fill(0);var bi=b.from(-1),wi=b.from(0),_i=b.from(1),ki=b.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Ei=Object(c.h)(_i.toHexString(),32),xi=Object(c.h)(wi.toHexString(),32),Ai={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Oi=["name","version","chainId","verifyingContract","salt"];function Si(t){return function(e){return"string"!=typeof e&&mi.throwArgumentError("invalid domain value for ".concat(JSON.stringify(t)),"domain.".concat(t),e),e}}var Pi={name:Si("name"),version:Si("version"),chainId:function(t){try{return b.from(t).toString()}catch(t){}return mi.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return ht(t).toLowerCase()}catch(t){}return mi.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{var e=Object(c.a)(t);if(32!==e.length)throw new Error("bad length");return Object(c.i)(e)}catch(t){}return mi.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function ji(t){var e=t.match(/^(u?)int(\d*)$/);if(e){var r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&mi.throwArgumentError("invalid numeric width","type",t);var o=ki.mask(r?n-1:n),i=r?o.add(_i).mul(bi):wi;return function(e){var r=b.from(e);return(r.lt(i)||r.gt(o))&&mi.throwArgumentError("value out-of-bounds for ".concat(t),"value",e),Object(c.h)(r.toTwos(256).toHexString(),32)}}var a=t.match(/^bytes(\d+)$/);if(a){var u=parseInt(a[1]);return(0===u||u>32||a[1]!==String(u))&&mi.throwArgumentError("invalid bytes width","type",t),function(e){return Object(c.a)(e).length!==u&&mi.throwArgumentError("invalid length for ".concat(t),"value",e),function(t){var e=Object(c.a)(t),r=e.length%32;return r?Object(c.c)([e,gi.slice(r)]):Object(c.i)(e)}(e)}}switch(t){case"address":return function(t){return Object(c.h)(ht(t),32)};case"bool":return function(t){return t?Ei:xi};case"bytes":return function(t){return Y(t)};case"string":return function(t){return jt(t)}}return null}function Ti(t,e){return"".concat(t,"(").concat(e.map((function(t){var e=t.name;return t.type+" "+e})).join(","),")")}var Ri=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),T(this,"types",Object.freeze(B(e))),T(this,"_encoderCache",{}),T(this,"_types",{});var r={},n={},o={};Object.keys(e).forEach((function(t){r[t]={},n[t]=[],o[t]={}}));var i=function(t){var o={};e[t].forEach((function(i){o[i.name]&&mi.throwArgumentError("duplicate variable name ".concat(JSON.stringify(i.name)," in ").concat(JSON.stringify(t)),"types",e),o[i.name]=!0;var a=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===t&&mi.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",e),ji(a)||(n[a]||mi.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",e),n[a].push(t),r[t][a]=!0)}))};for(var a in e)i(a);var u=Object.keys(n).filter((function(t){return 0===n[t].length}));for(var s in 0===u.length?mi.throwArgumentError("missing primary type","types",e):u.length>1&&mi.throwArgumentError("ambiguous primary types or unused types: ".concat(u.map((function(t){return JSON.stringify(t)})).join(", ")),"types",e),T(this,"primaryType",u[0]),function t(i,a){a[i]&&mi.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",e),a[i]=!0,Object.keys(r[i]).forEach((function(e){n[e]&&(t(e,a),Object.keys(a).forEach((function(t){o[t][e]=!0})))})),delete a[i]}(this.primaryType,{}),o){var c=Object.keys(o[s]);c.sort(),this._types[s]=Ti(s,e[s])+c.map((function(t){return Ti(t,e[t])})).join("")}}var e,r,n;return e=t,n=[{key:"from",value:function(e){return new t(e)}},{key:"getPrimaryType",value:function(e){return t.from(e).primaryType}},{key:"hashStruct",value:function(e,r,n){return t.from(r).hashStruct(e,n)}},{key:"hashDomain",value:function(e){var r=[];for(var n in e){var o=Ai[n];o||mi.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",e),r.push({name:n,type:o})}return r.sort((function(t,e){return Oi.indexOf(t.name)-Oi.indexOf(e.name)})),t.hashStruct("EIP712Domain",{EIP712Domain:r},e)}},{key:"encode",value:function(e,r,n){return Object(c.c)(["0x1901",t.hashDomain(e),t.from(r).hash(n)])}},{key:"hash",value:function(e,r,n){return Y(t.encode(e,r,n))}},{key:"resolveNames",value:function(e,r,n,o){return yi(this,void 0,void 0,di().mark((function i(){var a,u,s;return di().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:e=L(e),a={},e.verifyingContract&&!Object(c.l)(e.verifyingContract,20)&&(a[e.verifyingContract]="0x"),(u=t.from(r)).visit(n,(function(t,e){return"address"!==t||Object(c.l)(e,20)||(a[e]="0x"),e})),i.t0=di().keys(a);case 6:if((i.t1=i.t0()).done){i.next=13;break}return s=i.t1.value,i.next=10,o(s);case 10:a[s]=i.sent,i.next=6;break;case 13:return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=u.visit(n,(function(t,e){return"address"===t&&a[e]?a[e]:e})),i.abrupt("return",{domain:e,value:n});case 16:case"end":return i.stop()}}),i)})))}},{key:"getPayload",value:function(e,r,n){t.hashDomain(e);var o={},i=[];Oi.forEach((function(t){var r=e[t];null!=r&&(o[t]=Pi[t](r),i.push({name:t,type:Ai[t]}))}));var a=t.from(r),u=L(r);return u.EIP712Domain?mi.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):u.EIP712Domain=i,a.encode(n),{types:u,domain:o,primaryType:a.primaryType,message:a.visit(n,(function(t,e){if(t.match(/^bytes(\d*)/))return Object(c.i)(Object(c.a)(e));if(t.match(/^u?int/))return b.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&mi.throwArgumentError("invalid string","value",e),e}return mi.throwArgumentError("unsupported type","type",t)}))}}}],(r=[{key:"getEncoder",value:function(t){var e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}},{key:"_getEncoder",value:function(t){var e=this,r=ji(t);if(r)return r;var n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var o=n[1],i=this.getEncoder(o),a=parseInt(n[3]);return function(t){a>=0&&t.length!==a&&mi.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);var r=t.map(i);return e._types[o]&&(r=r.map(Y)),Y(Object(c.c)(r))}}var u=this.types[t];if(u){var s=jt(this._types[t]);return function(t){var r=u.map((function(r){var n=r.name,o=r.type,i=e.getEncoder(o)(t[n]);return e._types[o]?Y(i):i}));return r.unshift(s),Object(c.c)(r)}}return mi.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"encodeType",value:function(t){var e=this._types[t];return e||mi.throwArgumentError("unknown type: ".concat(JSON.stringify(t)),"name",t),e}},{key:"encodeData",value:function(t,e){return this.getEncoder(t)(e)}},{key:"hashStruct",value:function(t,e){return Y(this.encodeData(t,e))}},{key:"encode",value:function(t){return this.encodeData(this.primaryType,t)}},{key:"hash",value:function(t){return this.hashStruct(this.primaryType,t)}},{key:"_visit",value:function(t,e,r){var n=this;if(ji(t))return r(t,e);var o=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(o){var i=o[1],a=parseInt(o[3]);return a>=0&&e.length!==a&&mi.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((function(t){return n._visit(i,t,r)}))}var u=this.types[t];return u?u.reduce((function(t,o){var i=o.name,a=o.type;return t[i]=n._visit(a,e[i],r),t}),{}):mi.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"visit",value:function(t,e){return this._visit(this.primaryType,t,e)}}])&&vi(e.prototype,r),n&&vi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ni(t){return(Ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ii(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Ni(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Ni(i)?i:String(i)),n)}var o,i}var Li,Ci=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),T(this,"alphabet",e),T(this,"base",e.length),T(this,"_alphabetMap",{}),T(this,"_leader",e.charAt(0));for(var r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}var e,r,n;return e=t,(r=[{key:"encode",value:function(t){var e=Object(c.a)(t);if(0===e.length)return"";for(var r=[0],n=0;n<e.length;++n){for(var o=e[n],i=0;i<r.length;++i)o+=r[i]<<8,r[i]=o%this.base,o=o/this.base|0;for(;o>0;)r.push(o%this.base),o=o/this.base|0}for(var a="",u=0;0===e[u]&&u<e.length-1;++u)a+=this._leader;for(var s=r.length-1;s>=0;--s)a+=this.alphabet[r[s]];return a}},{key:"decode",value:function(t){if("string"!=typeof t)throw new TypeError("Expected String");var e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(var r=0;r<t.length;r++){var n=this._alphabetMap[t[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");for(var o=n,i=0;i<e.length;++i)o+=e[i]*this.base,e[i]=255&o,o>>=8;for(;o>0;)e.push(255&o),o>>=8}for(var a=0;t[a]===this._leader&&a<t.length-1;++a)e.push(0);return Object(c.a)(new Uint8Array(e.reverse()))}}])&&Ii(e.prototype,r),n&&Ii(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Mi=(new Ci("abcdefghijklmnopqrstuvwxyz234567"),new Ci("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),Bi=r(4),Fi=r.n(Bi);!function(t){t.sha256="sha256",t.sha512="sha512"}(Li||(Li={}));var Di=new h.b("sha2/5.7.0");function Ui(t){return"0x"+Fi.a.ripemd160().update(Object(c.a)(t)).digest("hex")}function zi(t){return"0x"+Fi.a.sha256().update(Object(c.a)(t)).digest("hex")}function Gi(t){return"0x"+Fi.a.sha512().update(Object(c.a)(t)).digest("hex")}function Hi(t,e,r){return Li[t]||Di.throwError("unsupported algorithm "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+Fi.a.hmac(Fi.a[t],Object(c.a)(e)).update(Object(c.a)(r)).digest("hex")}function qi(t,e,r,n,o){var i;t=Object(c.a)(t),e=Object(c.a)(e);var a,u,s=1,l=new Uint8Array(n),f=new Uint8Array(e.length+4);f.set(e);for(var h=1;h<=s;h++){f[e.length]=h>>24&255,f[e.length+1]=h>>16&255,f[e.length+2]=h>>8&255,f[e.length+3]=255&h;var p=Object(c.a)(Hi(o,t,f));i||(i=p.length,u=new Uint8Array(i),a=n-((s=Math.ceil(n/i))-1)*i),u.set(p);for(var d=1;d<r;d++){p=Object(c.a)(Hi(o,t,p));for(var v=0;v<i;v++)u[v]^=p[v]}var y=(h-1)*i,m=h===s?a:i;l.set(Object(c.a)(u).slice(0,m),y)}return Object(c.i)(l)}function Ki(t){return(Ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Ki(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ki(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Ki(i)?i:String(i)),n)}var o,i}var Qi=new h.b("wordlists/5.7.0"),Vi=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Qi.checkAbstract(this instanceof t?this.constructor:void 0,t),T(this,"locale",e)}var e,r,n;return e=t,n=[{key:"check",value:function(t){for(var e=[],r=0;r<2048;r++){var n=t.getWord(r);if(r!==t.getWordIndex(n))return"0x";e.push(n)}return jt(e.join("\n")+"\n")}},{key:"register",value:function(t,e){e||(e=t.locale)}}],(r=[{key:"split",value:function(t){return t.toLowerCase().split(/ +/g)}},{key:"join",value:function(t){return t.join(" ")}}])&&Wi(e.prototype,r),n&&Wi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ji(t){return(Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Ji(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ji(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Ji(i)?i:String(i)),n)}var o,i}function Zi(t,e){return(Zi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ta(t);if(e){var o=ta(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $i(this,r)}}function $i(t,e){if(e&&("object"===Ji(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ta(t){return(ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ea=null;function ra(t){if(null==ea&&(ea="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==Vi.check(t)))throw ea=null,new Error("BIP39 Wordlist for en (English) FAILED")}var na=new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zi(t,e)}(i,t);var e,r,n,o=Xi(i);function i(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,"en")}return e=i,(r=[{key:"getWord",value:function(t){return ra(this),ea[t]}},{key:"getWordIndex",value:function(t){return ra(this),ea.indexOf(t)}}])&&Yi(e.prototype,r),n&&Yi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Vi));Vi.register(na);var oa={en:na};function ia(t){return(ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==ia(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ia(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===ia(i)?i:String(i)),n)}var o,i}var ua=new h.b("hdnode/5.7.0"),sa=b.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ca=Et("Bitcoin seed");function la(t){return(1<<t)-1<<8-t}function fa(t){return Object(c.h)(Object(c.i)(t),32)}function ha(t){return Mi.encode(Object(c.b)([t,Object(c.e)(zi(zi(t)),0,4)]))}function pa(t){if(null==t)return oa.en;if("string"==typeof t){var e=oa[t];return null==e&&ua.throwArgumentError("unknown locale","wordlist",t),e}return t}var da={},va="m/44'/60'/0'/0/0",ya=function(){function t(e,r,n,o,i,a,u,s){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e!==da)throw new Error("HDNode constructor cannot be called directly");if(r){var l=new Yn(r);T(this,"privateKey",l.privateKey),T(this,"publicKey",l.compressedPublicKey)}else T(this,"privateKey",null),T(this,"publicKey",Object(c.i)(n));T(this,"parentFingerprint",o),T(this,"fingerprint",Object(c.e)(Ui(zi(this.publicKey)),0,4)),T(this,"address",io(this.publicKey)),T(this,"chainCode",i),T(this,"index",a),T(this,"depth",u),null==s?(T(this,"mnemonic",null),T(this,"path",null)):"string"==typeof s?(T(this,"mnemonic",null),T(this,"path",s)):(T(this,"mnemonic",s),T(this,"path",s.path))}var e,r,n;return e=t,n=[{key:"_fromSeed",value:function(e,r){var n=Object(c.a)(e);if(n.length<16||n.length>64)throw new Error("invalid seed");var o=Object(c.a)(Hi(Li.sha512,ca,n));return new t(da,fa(o.slice(0,32)),null,"0x00000000",fa(o.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(e,r,n){return e=ba(ga(e,n=pa(n)),n),t._fromSeed(ma(e,r),{phrase:e,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(e){return t._fromSeed(e,null)}},{key:"fromExtendedKey",value:function(e){var r=Mi.decode(e);82===r.length&&ha(r.slice(0,78))===e||ua.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],o=Object(c.i)(r.slice(5,9)),i=parseInt(Object(c.i)(r.slice(9,13)).substring(2),16),a=Object(c.i)(r.slice(13,45)),u=r.slice(45,78);switch(Object(c.i)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new t(da,null,Object(c.i)(u),o,a,i,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new t(da,Object(c.i)(u.slice(1)),null,o,a,i,n,null)}return ua.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}],(r=[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!");return ha(Object(c.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(c.i)(this.depth),this.parentFingerprint,Object(c.h)(Object(c.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(c.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new t(da,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(e){if(e>4294967295)throw new Error("invalid index - "+String(e));var r=this.path;r&&(r+="/"+(2147483647&e));var n=new Uint8Array(37);if(2147483648&e){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Object(c.a)(this.privateKey),1),r&&(r+="'")}else n.set(Object(c.a)(this.publicKey));for(var o=24;o>=0;o-=8)n[33+(o>>3)]=e>>24-o&255;var i=Object(c.a)(Hi(Li.sha512,this.chainCode,n)),a=i.slice(0,32),u=i.slice(32),s=null,l=null;this.privateKey?s=fa(b.from(a).add(this.privateKey).mod(sa)):l=new Yn(Object(c.i)(a))._addPoint(this.publicKey);var f=r,h=this.mnemonic;return h&&(f=Object.freeze({phrase:h.phrase,path:r,locale:h.locale||"en"})),new t(da,s,l,this.fingerprint,fa(u),e,this.depth+1,f)}},{key:"derivePath",value:function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var r=this,n=0;n<e.length;n++){var o=e[n];if(o.match(/^[0-9]+'$/)){var i=parseInt(o.substring(0,o.length-1));if(i>=2147483648)throw new Error("invalid path index - "+o);r=r._derive(2147483648+i)}else{if(!o.match(/^[0-9]+$/))throw new Error("invalid path component - "+o);var a=parseInt(o);if(a>=2147483648)throw new Error("invalid path index - "+o);r=r._derive(a)}}return r}}])&&aa(e.prototype,r),n&&aa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ma(t,e){e||(e="");var r=Et("mnemonic"+e,mt.NFKD);return qi(Et(t,mt.NFKD),r,2048,64,"sha512")}function ga(t,e){e=pa(e),ua.checkNormalize();var r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=Object(c.a)(new Uint8Array(Math.ceil(11*r.length/8))),o=0,i=0;i<r.length;i++){var a=e.getWordIndex(r[i].normalize("NFKD"));if(-1===a)throw new Error("invalid mnemonic");for(var u=0;u<11;u++)a&1<<10-u&&(n[o>>3]|=1<<7-o%8),o++}var s=32*r.length/3,l=la(r.length/3);if((Object(c.a)(zi(n.slice(0,s/8)))[0]&l)!==(n[n.length-1]&l))throw new Error("invalid checksum");return Object(c.i)(n.slice(0,s/8))}function ba(t,e){if(e=pa(e),(t=Object(c.a)(t)).length%4!=0||t.length<16||t.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,o=0;o<t.length;o++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&(1<<8-n)-1),n+=3);var i=t.length/4,a=Object(c.a)(zi(t))[0]&la(i);return r[r.length-1]<<=i,r[r.length-1]|=a>>8-i,e.join(r.map((function(t){return e.getWord(t)})))}function wa(t,e){try{return ga(t,e),!0}catch(t){}return!1}function _a(t){return("number"!=typeof t||t<0||t>=2147483648||t%1)&&ua.throwArgumentError("invalid account index","index",t),"m/44'/60'/".concat(t,"'/0/0")}var ka=r(79),Ea=r(6),xa=r.n(Ea),Aa=r(14),Oa=r.n(Aa);function Sa(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Object(c.a)(t)}function Pa(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function ja(t){return"string"==typeof t?Et(t,mt.NFKC):Object(c.a)(t)}function Ta(t,e){for(var r=t,n=e.toLowerCase().split("/"),o=0;o<n.length;o++){var i=null;for(var a in r)if(a.toLowerCase()===n[o]){i=r[a];break}if(null===i)return null;r=i}return r}function Ra(t){var e=Object(c.a)(t);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var r=Object(c.i)(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}function Na(t){return(Na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ia(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ia=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==Na(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function La(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ca(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Na(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Na(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Na(i)?i:String(i)),n)}var o,i}function Ma(t,e){return(Ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ba(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Da(t);if(e){var o=Da(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Fa(this,r)}}function Fa(t,e){if(e&&("object"===Na(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Da(t){return(Da=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ua=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},za=new h.b("json-wallets/5.7.0");function Ga(t){return null!=t&&t.mnemonic&&t.mnemonic.phrase}var Ha=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ma(t,e)}(i,t);var e,r,n,o=Ba(i);function i(){return La(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"isKeystoreAccount",value:function(t){return!(!t||!t._isKeystoreAccount)}}])&&Ca(e.prototype,r),n&&Ca(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(F);function qa(t,e){var r=Sa(Ta(t,"crypto/ciphertext"));if(Object(c.i)(Y(Object(c.b)([e.slice(16,32),r]))).substring(2)!==Ta(t,"crypto/mac").toLowerCase())throw new Error("invalid password");var n=function(t,e,r){if("aes-128-ctr"===Ta(t,"crypto/cipher")){var n=Sa(Ta(t,"crypto/cipherparams/iv")),o=new xa.a.Counter(n),i=new xa.a.ModeOfOperation.ctr(e,o);return Object(c.a)(i.decrypt(r))}return null}(t,e.slice(0,16),r);n||za.throwError("unsupported cipher",h.b.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var o=e.slice(32,64),i=io(n);if(t.address){var a=t.address.toLowerCase();if("0x"!==a.substring(0,2)&&(a="0x"+a),ht(a)!==i)throw new Error("address mismatch")}var u={_isKeystoreAccount:!0,address:i,privateKey:Object(c.i)(n)};if("0.1"===Ta(t,"x-ethers/version")){var s=Sa(Ta(t,"x-ethers/mnemonicCiphertext")),l=Sa(Ta(t,"x-ethers/mnemonicCounter")),f=new xa.a.Counter(l),p=new xa.a.ModeOfOperation.ctr(o,f),d=Ta(t,"x-ethers/path")||va,v=Ta(t,"x-ethers/locale")||"en",y=Object(c.a)(p.decrypt(s));try{var m=ba(y,v),g=ya.fromMnemonic(m,null,v).derivePath(d);if(g.privateKey!=u.privateKey)throw new Error("mnemonic mismatch");u.mnemonic=g.mnemonic}catch(t){if(t.code!==h.b.errors.INVALID_ARGUMENT||"wordlist"!==t.argument)throw t}}return new Ha(u)}function Ka(t,e,r,n,o){return Object(c.a)(qi(t,e,r,n,o))}function Wa(t,e,r,n,o){return Promise.resolve(Ka(t,e,r,n,o))}function Qa(t,e,r,n,o){var i=ja(e),a=Ta(t,"crypto/kdf");if(a&&"string"==typeof a){var u=function(t,e){return za.throwArgumentError("invalid key-derivation function parameters",t,e)};if("scrypt"===a.toLowerCase()){var s=Sa(Ta(t,"crypto/kdfparams/salt")),c=parseInt(Ta(t,"crypto/kdfparams/n")),l=parseInt(Ta(t,"crypto/kdfparams/r")),f=parseInt(Ta(t,"crypto/kdfparams/p"));c&&l&&f||u("kdf",a),0!=(c&c-1)&&u("N",c);var h=parseInt(Ta(t,"crypto/kdfparams/dklen"));return 32!==h&&u("dklen",h),n(i,s,c,l,f,64,o)}if("pbkdf2"===a.toLowerCase()){var p=Sa(Ta(t,"crypto/kdfparams/salt")),d=null,v=Ta(t,"crypto/kdfparams/prf");"hmac-sha256"===v?d="sha256":"hmac-sha512"===v?d="sha512":u("prf",v);var y=parseInt(Ta(t,"crypto/kdfparams/c")),m=parseInt(Ta(t,"crypto/kdfparams/dklen"));return 32!==m&&u("dklen",m),r(i,p,y,m,d)}}return za.throwArgumentError("unsupported key-derivation function","kdf",a)}function Va(t){return(Va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ja(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ya(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Va(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Va(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Va(i)?i:String(i)),n)}var o,i}function Za(t,e){return(Za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=tu(t);if(e){var o=tu(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $a(this,r)}}function $a(t,e){if(e&&("object"===Va(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function tu(t){return(tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var eu=new h.b("json-wallets/5.7.0"),ru=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Za(t,e)}(i,t);var e,r,n,o=Xa(i);function i(){return Ja(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"isCrowdsaleAccount",value:function(t){return!(!t||!t._isCrowdsaleAccount)}}])&&Ya(e.prototype,r),n&&Ya(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(F);function nu(t,e){var r=JSON.parse(t);e=ja(e);var n=ht(Ta(r,"ethaddr")),o=Sa(Ta(r,"encseed"));o&&o.length%16==0||eu.throwArgumentError("invalid encseed","json",t);for(var i=Object(c.a)(qi(e,e,2e3,32,"sha256")).slice(0,16),a=o.slice(0,16),u=o.slice(16),s=new xa.a.ModeOfOperation.cbc(i,a),l=xa.a.padding.pkcs7.strip(Object(c.a)(s.decrypt(u))),f="",h=0;h<l.length;h++)f+=String.fromCharCode(l[h]);var p=Y(Et(f));return new ru({_isCrowdsaleAccount:!0,address:n,privateKey:p})}function ou(t){var e=null;try{e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function iu(t){var e=null;try{e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}function au(t){if(ou(t))try{return ht(JSON.parse(t).ethaddr)}catch(t){return null}if(iu(t))try{return ht(JSON.parse(t).address)}catch(t){return null}return null}function uu(t,e,r){if(ou(t)){r&&r(0);var n=nu(t,e);return r&&r(1),Promise.resolve(n)}return iu(t)?function(t,e,r){return Ua(this,void 0,void 0,Ia().mark((function n(){var o,i;return Ia().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=JSON.parse(t),n.next=3,Qa(o,e,Wa,Oa.a.scrypt,r);case 3:return i=n.sent,n.abrupt("return",qa(o,i));case 5:case"end":return n.stop()}}),n)})))}(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function su(t,e){if(ou(t))return nu(t,e);if(iu(t))return function(t,e){var r=JSON.parse(t);return qa(r,Qa(r,e,Ka,Oa.a.syncScrypt))}(t,e);throw new Error("invalid JSON wallet")}function cu(t){return(cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lu(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */lu=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==cu(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function fu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==cu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==cu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===cu(i)?i:String(i)),n)}var o,i}function hu(t,e){return(hu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function pu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=yu(t);if(e){var o=yu(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return du(this,r)}}function du(t,e){if(e&&("object"===cu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return vu(t)}function vu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yu(t){return(yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var mu=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},gu=new h.b("wallet/5.7.0");var bu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hu(t,e)}(i,t);var e,r,n,o=pu(i);function i(t,e){var r,n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),r=o.call(this),null!=(n=t)&&Object(c.l)(n.privateKey,32)&&null!=n.address){var a=new Yn(t.privateKey);if(T(vu(r),"_signingKey",(function(){return a})),T(vu(r),"address",io(r.publicKey)),r.address!==ht(t.address)&&gu.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(t){var e=t.mnemonic;return e&&e.phrase}(t)){var u=t.mnemonic;T(vu(r),"_mnemonic",(function(){return{phrase:u.phrase,path:u.path||va,locale:u.locale||"en"}}));var s=r.mnemonic;io(ya.fromMnemonic(s.phrase,null,s.locale).derivePath(s.path).privateKey)!==r.address&&gu.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else T(vu(r),"_mnemonic",(function(){return null}))}else{if(Yn.isSigningKey(t))"secp256k1"!==t.curve&&gu.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),T(vu(r),"_signingKey",(function(){return t}));else{"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t);var l=new Yn(t);T(vu(r),"_signingKey",(function(){return l}))}T(vu(r),"_mnemonic",(function(){return null})),T(vu(r),"address",io(r.publicKey))}return e&&!Sn.isProvider(e)&&gu.throwArgumentError("invalid provider","provider",e),T(vu(r),"provider",e||null),r}return e=i,n=[{key:"createRandom",value:function(t){var e=Object(ka.a)(16);t||(t={}),t.extraEntropy&&(e=Object(c.a)(Object(c.e)(Y(Object(c.b)([e,t.extraEntropy])),0,16)));var r=ba(e,t.locale);return i.fromMnemonic(r,t.path,t.locale)}},{key:"fromEncryptedJson",value:function(t,e,r){return uu(t,e,r).then((function(t){return new i(t)}))}},{key:"fromEncryptedJsonSync",value:function(t,e){return new i(su(t,e))}},{key:"fromMnemonic",value:function(t,e,r){return e||(e=va),new i(ya.fromMnemonic(t,null,r).derivePath(e))}}],(r=[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(t){return new i(this,t)}},{key:"signTransaction",value:function(t){var e=this;return N(t).then((function(r){null!=r.from&&(ht(r.from)!==e.address&&gu.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete r.from);var n=e._signingKey().signDigest(Y(po(r)));return po(r,n)}))}},{key:"signMessage",value:function(t){return mu(this,void 0,void 0,lu().mark((function e(){return lu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(c.m)(this._signingKey().signDigest(hi(t))));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"_signTypedData",value:function(t,e,r){return mu(this,void 0,void 0,lu().mark((function n(){var o,i=this;return lu().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Ri.resolveNames(t,e,r,(function(t){return null==i.provider&&gu.throwError("cannot resolve ENS names without a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:t}),i.provider.resolveName(t)}));case 2:return o=n.sent,n.abrupt("return",Object(c.m)(this._signingKey().signDigest(Ri.hash(o.domain,e,o.value))));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"encrypt",value:function(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e||(e={}),function(t,e,r,n){try{if(ht(t.address)!==io(t.privateKey))throw new Error("address/privateKey mismatch");if(Ga(t)){var o=t.mnemonic;if(ya.fromMnemonic(o.phrase,null,o.locale).derivePath(o.path||va).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(t){return Promise.reject(t)}"function"!=typeof r||n||(n=r,r={}),r||(r={});var i=Object(c.a)(t.privateKey),a=ja(e),u=null,s=null,l=null;if(Ga(t)){var f=t.mnemonic;u=Object(c.a)(ga(f.phrase,f.locale||"en")),s=f.path||va,l=f.locale||"en"}var h=r.client;h||(h="ethers.js");var p=null;p=r.salt?Object(c.a)(r.salt):Object(ka.a)(32);var d=null;if(r.iv){if(16!==(d=Object(c.a)(r.iv)).length)throw new Error("invalid iv")}else d=Object(ka.a)(16);var v=null;if(r.uuid){if(16!==(v=Object(c.a)(r.uuid)).length)throw new Error("invalid uuid")}else v=Object(ka.a)(16);var y=1<<17,m=8,g=1;return r.scrypt&&(r.scrypt.N&&(y=r.scrypt.N),r.scrypt.r&&(m=r.scrypt.r),r.scrypt.p&&(g=r.scrypt.p)),Oa.a.scrypt(a,p,y,m,g,64,n).then((function(e){var r=(e=Object(c.a)(e)).slice(0,16),n=e.slice(16,32),o=e.slice(32,64),a=new xa.a.Counter(d),f=new xa.a.ModeOfOperation.ctr(r,a),b=Object(c.a)(f.encrypt(i)),w=Y(Object(c.b)([n,b])),_={address:t.address.substring(2).toLowerCase(),id:Ra(v),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Object(c.i)(d).substring(2)},ciphertext:Object(c.i)(b).substring(2),kdf:"scrypt",kdfparams:{salt:Object(c.i)(p).substring(2),n:y,dklen:32,p:g,r:m},mac:w.substring(2)}};if(u){var k=Object(ka.a)(16),E=new xa.a.Counter(k),x=new xa.a.ModeOfOperation.ctr(o,E),A=Object(c.a)(x.encrypt(u)),O=new Date,S=O.getUTCFullYear()+"-"+Pa(O.getUTCMonth()+1,2)+"-"+Pa(O.getUTCDate(),2)+"T"+Pa(O.getUTCHours(),2)+"-"+Pa(O.getUTCMinutes(),2)+"-"+Pa(O.getUTCSeconds(),2)+".0Z";_["x-ethers"]={client:h,gethFilename:"UTC--"+S+"--"+_.address,mnemonicCounter:Object(c.i)(k).substring(2),mnemonicCiphertext:Object(c.i)(A).substring(2),path:s,locale:l,version:"0.1"}}return JSON.stringify(_)}))}(this,t,e,r)}}])&&fu(e.prototype,r),n&&fu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Gn);function wu(t,e){return ao(hi(t),e)}function _u(t,e,r,n){return ao(Ri.hash(t,e,r),n)}var ku="0x0000000000000000000000000000000000000000",Eu="0x0000000000000000000000000000000000000000000000000000000000000000",xu="Ξ",Au=new h.b("networks/5.7.1");function Ou(t){var e=function(e,r){null==r&&(r={});var n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){try{var o=new e.PocketProvider(t,r.pocket);o.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(o.network.name)&&n.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{var i=new e.AnkrProvider(t,r.ankr);i.network&&-1===["ropsten"].indexOf(i.network.name)&&n.push(i)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){var a=1;return null!=r.quorum?a=r.quorum:"homestead"===t&&(a=2),new e.FallbackProvider(n,a)}return n[0]};return e.renetwork=function(t){return Ou(t)},e}function Su(t,e){var r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return Su(t,e)},r}var Pu={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Ou("homestead")},ju={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Ou("ropsten")},Tu={chainId:63,name:"classicMordor",_defaultProvider:Su("https://www.ethercluster.com/mordor","classicMordor")},Ru={unspecified:{chainId:0,name:"unspecified"},homestead:Pu,mainnet:Pu,morden:{chainId:2,name:"morden"},ropsten:ju,testnet:ju,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Ou("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Ou("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Ou("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Ou("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Su("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Tu,classicTestnet:Tu,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Su("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Ou("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Ou("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Nu(t){if(null==t)return null;if("number"==typeof t){for(var e in Ru){var r=Ru[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var n=Ru[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var o=Ru[t.name];if(!o)return"number"!=typeof t.chainId&&Au.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==o.chainId&&Au.throwArgumentError("network chainId mismatch","network",t);var i,a=t._defaultProvider||null;return null==a&&o._defaultProvider&&(a=(i=o._defaultProvider)&&"function"==typeof i.renetwork?o._defaultProvider.renetwork(t):o._defaultProvider),{name:t.name,chainId:o.chainId,ensAddress:t.ensAddress||o.ensAddress||null,_defaultProvider:a}}function Iu(t){t=atob(t);for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r));return Object(c.a)(e)}function Lu(t){t=Object(c.a)(t);for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Cu(t,e){null==e&&(e=1);var r=[],n=r.forEach;return function t(e,o){n.call(e,(function(e){o>0&&Array.isArray(e)?t(e,o-1):r.push(e)}))}(t,e),r}function Mu(t){return function(t){var e=0;return function(){return t[e++]}}(function(t){var e=0;function r(){return t[e++]<<8|t[e++]}for(var n=r(),o=1,i=[0,1],a=1;a<n;a++)i.push(o+=r());var u=r(),s=e;e+=u;var c=0,l=0;function f(){return 0==c&&(l=l<<8|t[e++],c=8),l>>--c&1}for(var h=Math.pow(2,31),p=h>>>1,d=p>>1,v=h-1,y=0,m=0;m<31;m++)y=y<<1|f();for(var g=[],b=0,w=h;;){for(var _=Math.floor(((y-b+1)*o-1)/w),k=0,E=n;E-k>1;){var x=k+E>>>1;_<i[x]?E=x:k=x}if(0==k)break;g.push(k);for(var A=b+Math.floor(w*i[k]/o),O=b+Math.floor(w*i[k+1]/o)-1;0==((A^O)&p);)y=y<<1&v|f(),A=A<<1&v,O=O<<1&v|1;for(;A&~O&d;)y=y&p|y<<1&v>>>1|f(),A=A<<1^p,O=(O^p)<<1|p|1;b=A,w=1+O-A}var S=n-4;return g.map((function(e){switch(e-S){case 3:return S+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return S+256+(t[s++]<<8|t[s++]);case 1:return S+t[s++];default:return e-1}}))}(t))}function Bu(t){return 1&t?~t>>1:t>>1}function Fu(t,e){for(var r=Array(t),n=0,o=-1;n<t;n++)r[n]=o+=1+e();return r}function Du(t,e){for(var r=Array(t),n=0,o=0;n<t;n++)r[n]=o+=Bu(e());return r}function Uu(t,e){for(var r=Fu(t(),t),n=t(),o=Fu(n,t),i=function(t,e){for(var r=Array(t),n=0;n<t;n++)r[n]=1+e();return r}(n,t),a=0;a<n;a++)for(var u=0;u<i[a];u++)r.push(o[a]+u);return e?r.map((function(t){return e[t]})):r}function zu(t,e,r){for(var n=Array(t).fill(void 0).map((function(){return[]})),o=0;o<e;o++)Du(t,r).forEach((function(t,e){return n[e].push(t)}));return n}function Gu(t,e){var r=1+e(),n=e(),o=function(t){for(var e=[];;){var r=t();if(0==r)break;e.push(r)}return e}(e);return Cu(zu(o.length,1+t,e).map((function(t,e){var i=t[0],a=t.slice(1);return Array(o[e]).fill(void 0).map((function(t,e){var o=e*n;return[i+e*r,a.map((function(t){return t+o}))]}))})))}function Hu(t,e){return zu(1+e(),1+t,e).map((function(t){return[t[0],t.slice(1)]}))}function qu(t){return function(t){if(Array.isArray(t))return Wu(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ku(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ku(t,e){if(t){if("string"==typeof t)return Wu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wu(t,e):void 0}}function Wu(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Qu,Vu,Ju=Mu(Iu("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Yu=new Set(Uu(Ju)),Zu=new Set(Uu(Ju)),Xu=function(t){for(var e=[];;){var r=t();if(0==r)break;e.push(Gu(r,t))}for(;;){var n=t()-1;if(n<0)break;e.push(Hu(n,t))}return function(t){for(var e={},r=0;r<t.length;r++){var n=t[r];e[n[0]]=n[1]}return e}(Cu(e))}(Ju),$u=(Vu=Uu(Qu=Ju).sort((function(t,e){return t-e})),function t(){for(var e=[];;){var r=Uu(Qu,Vu);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((function(t,e){return e.set.size-t.set.size}));var n=Qu();return{branches:e,valid:n%3,fe0f:!!(1&(n=n/3|0)),save:1==(n>>=1),check:2==n}}());function ts(t){return Pt(t)}function es(t){return t.filter((function(t){return 65039!=t}))}function rs(t){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ku(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t.split("."));try{for(r.s();!(e=r.n()).done;){var n=e.value,o=ts(n);try{for(var i=o.lastIndexOf(95)-1;i>=0;i--)if(95!==o[i])throw new Error("underscore only allowed at start");if(o.length>=4&&o.every((function(t){return t<128}))&&45===o[2]&&45===o[3])throw new Error("invalid label extension")}catch(t){throw new Error('Invalid label "'.concat(n,'": ').concat(t.message))}}}catch(t){r.e(t)}finally{r.f()}return t}function ns(t){return rs(function(t,e){var r=ts(t).reverse(),n=[];for(;r.length;){var o=os(r);if(o)n.push.apply(n,qu(e(o)));else{var i=r.pop();if(Yu.has(i))n.push(i);else if(!Zu.has(i)){var a=Xu[i];if(!a)throw new Error("Disallowed codepoint: 0x".concat(i.toString(16).toUpperCase()));n.push.apply(n,qu(a))}}}return rs((u=String.fromCodePoint.apply(String,n),u.normalize("NFC")));var u}(t,es))}function os(t,e){var r,n,o,i=$u,a=[],u=t.length;e&&(e.length=0);for(var s=function(){var s=t[--u];if(!(i=null===(r=i.branches.find((function(t){return t.set.has(s)})))||void 0===r?void 0:r.node))return"break";if(i.save)o=s;else if(i.check&&s===o)return"break";a.push(s),i.fe0f&&(a.push(65039),u>0&&65039==t[u-1]&&u--),i.valid&&(n=a.slice(),2==i.valid&&n.splice(1,1),e&&e.push.apply(e,qu(t.slice(u).reverse())),t.length=u)};u;){if("break"===s())break}return n}var is=new h.b("hash/5.7.0"),as=new Uint8Array(32);function us(t){if(0===t.length)throw new Error("invalid ENS name; empty component");return t}function ss(t){var e=Et(ns(t)),r=[];if(0===t.length)return r;for(var n=0,o=0;o<e.length;o++){46===e[o]&&(r.push(us(e.slice(n,o))),n=o+1)}if(n>=e.length)throw new Error("invalid ENS name; empty component");return r.push(us(e.slice(n))),r}function cs(t){try{return 0!==ss(t).length}catch(t){}return!1}function ls(t){"string"!=typeof t&&is.throwArgumentError("invalid ENS name; not a string","name",t);for(var e=as,r=ss(t);r.length;)e=Y(Object(c.b)([e,Y(r.pop())]));return Object(c.i)(e)}function fs(t){return Object(c.i)(Object(c.b)(ss(t).map((function(t){if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e}))))+"00"}as.fill(0);function hs(t){return(hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ps(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ps=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==hs(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var ds=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};function vs(t,e){return ds(this,void 0,void 0,ps().mark((function r(){var n,o,i,a,u;return ps().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e&&(e={}),n={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0},!0!==e.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=e.fetchOptions&&((o=e.fetchOptions).mode&&(n.mode=o.mode),o.cache&&(n.cache=o.cache),o.credentials&&(n.credentials=o.credentials),o.redirect&&(n.redirect=o.redirect),o.referrer&&(n.referrer=o.referrer)),r.next=7,fetch(t,n);case 7:return i=r.sent,r.next=10,i.arrayBuffer();case 10:return a=r.sent,u={},i.headers.forEach?i.headers.forEach((function(t,e){u[e.toLowerCase()]=t})):i.headers.keys().forEach((function(t){u[t.toLowerCase()]=i.headers.get(t)})),r.abrupt("return",{headers:u,statusCode:i.status,statusMessage:i.statusText,body:Object(c.a)(new Uint8Array(a))});case 14:case"end":return r.stop()}}),r)})))}function ys(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ys=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==ms(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ms(t){return(ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var gs=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},bs=new h.b("web/5.7.1");function ws(t){return new Promise((function(e){setTimeout(e,t)}))}function _s(t,e){if(null==t)return null;if("string"==typeof t)return t;if(Object(c.k)(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return St(t)}catch(t){}return Object(c.i)(t)}return t}function ks(t,e,r){var n="object"===ms(t)&&null!=t.throttleLimit?t.throttleLimit:12;bs.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);var o="object"===ms(t)?t.throttleCallback:null,i="object"===ms(t)&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;bs.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);var a="object"===ms(t)&&!!t.errorPassThrough,u={},s=null,c={method:"GET"},l=!1,f=12e4;if("string"==typeof t)s=t;else if("object"===ms(t)){if(null!=t&&null!=t.url||bs.throwArgumentError("missing URL","connection.url",t),s=t.url,"number"==typeof t.timeout&&t.timeout>0&&(f=t.timeout),t.headers)for(var p in t.headers)u[p.toLowerCase()]={key:p,value:String(t.headers[p])},["if-none-match","if-modified-since"].indexOf(p.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==s.substring(0,6)&&!0!==t.allowInsecureAuthentication&&bs.throwError("basic authentication requires a secure https url",h.b.errors.INVALID_ARGUMENT,{argument:"url",url:s,user:t.user,password:"[REDACTED]"});var d=t.user+":"+t.password;u.authorization={key:"Authorization",value:"Basic "+Lu(Et(d))}}null!=t.skipFetchSetup&&(c.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(c.fetchOptions=L(t.fetchOptions))}var v,y=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),m=s?s.match(y):null;if(m)try{var g={statusCode:200,statusMessage:"OK",headers:{"content-type":m[1]||"text/plain"},body:m[2]?Iu(m[3]):(v=m[3],Et(v.replace(/%([0-9a-f][0-9a-f])/gi,(function(t,e){return String.fromCharCode(parseInt(e,16))}))))},b=g.body;return r&&(b=r(g.body,g)),Promise.resolve(b)}catch(t){bs.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:_s(m[1],m[2]),error:t,requestBody:null,requestMethod:"GET",url:s})}e&&(c.method="POST",c.body=e,null==u["content-type"]&&(u["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==u["content-length"]&&(u["content-length"]={key:"Content-Length",value:String(e.length)}));var w={};Object.keys(u).forEach((function(t){var e=u[t];w[e.key]=e.value})),c.headers=w;var _,k=(_=null,{promise:new Promise((function(t,e){f&&(_=setTimeout((function(){null!=_&&(_=null,e(bs.makeError("timeout",h.b.errors.TIMEOUT,{requestBody:_s(c.body,w["content-type"]),requestMethod:c.method,timeout:f,url:s})))}),f))})),cancel:function(){null!=_&&(clearTimeout(_),_=null)}}),E=function(){return gs(this,void 0,void 0,ys().mark((function t(){var e,u,f,p,d,v,y,m,g,b;return ys().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<n)){t.next=65;break}return u=null,t.prev=3,t.next=6,vs(s,c);case 6:if(u=t.sent,!(e<n)){t.next=28;break}if(301!==u.statusCode&&302!==u.statusCode){t.next=15;break}if(f=u.headers.location||"","GET"!==c.method||!f.match(/^https:/)){t.next=13;break}return s=u.headers.location,t.abrupt("continue",62);case 13:t.next=28;break;case 15:if(429!==u.statusCode){t.next=28;break}if(p=!0,!o){t.next=21;break}return t.next=20,o(e,s);case 20:p=t.sent;case 21:if(!p){t.next=28;break}return d=0,v=u.headers["retry-after"],d="string"==typeof v&&v.match(/^[1-9][0-9]*$/)?1e3*parseInt(v):i*parseInt(String(Math.random()*Math.pow(2,e))),t.next=27,ws(d);case 27:return t.abrupt("continue",62);case 28:t.next=34;break;case 30:t.prev=30,t.t0=t.catch(3),null==(u=t.t0.response)&&(k.cancel(),bs.throwError("missing response",h.b.errors.SERVER_ERROR,{requestBody:_s(c.body,w["content-type"]),requestMethod:c.method,serverError:t.t0,url:s}));case 34:if(y=u.body,l&&304===u.statusCode?y=null:!a&&(u.statusCode<200||u.statusCode>=300)&&(k.cancel(),bs.throwError("bad response",h.b.errors.SERVER_ERROR,{status:u.statusCode,headers:u.headers,body:_s(y,u.headers?u.headers["content-type"]:null),requestBody:_s(c.body,w["content-type"]),requestMethod:c.method,url:s})),!r){t.next=60;break}return t.prev=37,t.next=40,r(y,u);case 40:return m=t.sent,k.cancel(),t.abrupt("return",m);case 45:if(t.prev=45,t.t1=t.catch(37),!(t.t1.throttleRetry&&e<n)){t.next=58;break}if(g=!0,!o){t.next=53;break}return t.next=52,o(e,s);case 52:g=t.sent;case 53:if(!g){t.next=58;break}return b=i*parseInt(String(Math.random()*Math.pow(2,e))),t.next=57,ws(b);case 57:return t.abrupt("continue",62);case 58:k.cancel(),bs.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:_s(y,u.headers?u.headers["content-type"]:null),error:t.t1,requestBody:_s(c.body,w["content-type"]),requestMethod:c.method,url:s});case 60:return k.cancel(),t.abrupt("return",y);case 62:e++,t.next=1;break;case 65:return t.abrupt("return",bs.throwError("failed response",h.b.errors.SERVER_ERROR,{requestBody:_s(c.body,w["content-type"]),requestMethod:c.method,url:s}));case 66:case"end":return t.stop()}}),t,null,[[3,30],[37,45]])})))}();return Promise.race([k.promise,E])}function Es(t,e,r){var n=null;if(null!=e){n=Et(e);var o="string"==typeof t?{url:t}:L(t);if(o.headers)0!==Object.keys(o.headers).filter((function(t){return"content-type"===t.toLowerCase()})).length||(o.headers=L(o.headers),o.headers["content-type"]="application/json");else o.headers={"content-type":"application/json"};t=o}return ks(t,n,(function(t,e){var n=null;if(null!=t)try{n=JSON.parse(St(t))}catch(e){bs.throwError("invalid JSON",h.b.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function xs(t,e){return e||(e={}),null==(e=L(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){var o=null,i=!1,a=function(){return!i&&(i=!0,o&&clearTimeout(o),!0)};e.timeout&&(o=setTimeout((function(){a()&&n(new Error("timeout"))}),e.timeout));var u=e.retryLimit,s=0;!function o(){return t().then((function(t){if(void 0!==t)a()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",o);else if(e.onceBlock)e.onceBlock.once("block",o);else if(!i){if(++s>u)return void(a()&&n(new Error("retry limit reached")));var c=e.interval*parseInt(String(Math.random()*Math.pow(2,s)));c<e.floor&&(c=e.floor),c>e.ceiling&&(c=e.ceiling),setTimeout(o,c)}return null}),(function(t){a()&&n(t)}))}()}))}var As=r(22),Os=r.n(As);function Ss(t){return(Ss="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ps(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Ss(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ss(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Ss(i)?i:String(i)),n)}var o,i}var js=new h.b("providers/5.7.2"),Ts=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.formats=this.getDefaultFormats()}var e,r,n;return e=t,n=[{key:"check",value:function(t,e){var r={};for(var n in t)try{var o=t[n](e[n]);void 0!==o&&(r[n]=o)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}},{key:"allowNull",value:function(t,e){return function(r){return null==r?e:t(r)}}},{key:"allowFalsish",value:function(t,e){return function(r){return r?t(r):e}}},{key:"arrayOf",value:function(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var r=[];return e.forEach((function(e){r.push(t(e))})),r}}}],(r=[{key:"getDefaultFormats",value:function(){var e=this,r={},n=this.address.bind(this),o=this.bigNumber.bind(this),i=this.blockTag.bind(this),a=this.data.bind(this),u=this.hash.bind(this),s=this.hex.bind(this),c=this.number.bind(this),l=this.type.bind(this);return r.transaction={hash:u,type:l,accessList:t.allowNull(this.accessList.bind(this),null),blockHash:t.allowNull(u,null),blockNumber:t.allowNull(c,null),transactionIndex:t.allowNull(c,null),confirmations:t.allowNull(c,null),from:n,gasPrice:t.allowNull(o),maxPriorityFeePerGas:t.allowNull(o),maxFeePerGas:t.allowNull(o),gasLimit:o,to:t.allowNull(n,null),value:o,nonce:c,data:a,r:t.allowNull(this.uint256),s:t.allowNull(this.uint256),v:t.allowNull(c),creates:t.allowNull(n,null),raw:t.allowNull(a)},r.transactionRequest={from:t.allowNull(n),nonce:t.allowNull(c),gasLimit:t.allowNull(o),gasPrice:t.allowNull(o),maxPriorityFeePerGas:t.allowNull(o),maxFeePerGas:t.allowNull(o),to:t.allowNull(n),value:t.allowNull(o),data:t.allowNull((function(t){return e.data(t,!0)})),type:t.allowNull(c),accessList:t.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:u,address:n,topics:t.arrayOf(u),data:a,logIndex:c,blockHash:u},r.receipt={to:t.allowNull(this.address,null),from:t.allowNull(this.address,null),contractAddress:t.allowNull(n,null),transactionIndex:c,root:t.allowNull(s),gasUsed:o,logsBloom:t.allowNull(a),blockHash:u,transactionHash:u,logs:t.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:t.allowNull(c,null),cumulativeGasUsed:o,effectiveGasPrice:t.allowNull(o),status:t.allowNull(c),type:l},r.block={hash:t.allowNull(u),parentHash:u,number:c,timestamp:c,nonce:t.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:o,gasUsed:o,miner:t.allowNull(n),extraData:a,transactions:t.allowNull(t.arrayOf(u)),baseFeePerGas:t.allowNull(o)},r.blockWithTransactions=L(r.block),r.blockWithTransactions.transactions=t.allowNull(t.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:t.allowNull(i,void 0),toBlock:t.allowNull(i,void 0),blockHash:t.allowNull(u,void 0),address:t.allowNull(n,void 0),topics:t.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:t.allowNull(c),blockHash:t.allowNull(u),transactionIndex:c,removed:t.allowNull(this.boolean.bind(this)),address:n,data:t.allowFalsish(a,"0x"),topics:t.arrayOf(u),transactionHash:u,logIndex:c},r}},{key:"accessList",value:function(t){return co(t||[])}},{key:"number",value:function(t){return"0x"===t?0:b.from(t).toNumber()}},{key:"type",value:function(t){return"0x"===t||null==t?0:b.from(t).toNumber()}},{key:"bigNumber",value:function(t){return b.from(t)}},{key:"boolean",value:function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}},{key:"hex",value:function(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),Object(c.l)(t))?t.toLowerCase():js.throwArgumentError("invalid hash","value",t)}},{key:"data",value:function(t,e){var r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}},{key:"address",value:function(t){return ht(t)}},{key:"callAddress",value:function(t){if(!Object(c.l)(t,32))return null;var e=ht(Object(c.e)(t,12));return e===ku?null:e}},{key:"contractAddress",value:function(t){return vt(t)}},{key:"blockTag",value:function(t){if(null==t)return"latest";if("earliest"===t)return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if("number"==typeof t||Object(c.l)(t))return Object(c.g)(t);throw new Error("invalid blockTag")}},{key:"hash",value:function(t,e){var r=this.hex(t,e);return 32!==Object(c.d)(r)?js.throwArgumentError("invalid hash","value",t):r}},{key:"difficulty",value:function(t){if(null==t)return null;var e=b.from(t);try{return e.toNumber()}catch(t){}return null}},{key:"uint256",value:function(t){if(!Object(c.l)(t))throw new Error("invalid uint256");return Object(c.h)(t,32)}},{key:"_block",value:function(e,r){null!=e.author&&null==e.miner&&(e.miner=e.author);var n=null!=e._difficulty?e._difficulty:e.difficulty,o=t.check(r,e);return o._difficulty=null==n?null:b.from(n),o}},{key:"block",value:function(t){return this._block(t,this.formats.block)}},{key:"blockWithTransactions",value:function(t){return this._block(t,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(e){return t.check(this.formats.transactionRequest,e)}},{key:"transactionResponse",value:function(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&b.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);var r=t.check(this.formats.transaction,e);if(null!=e.chainId){var n=e.chainId;Object(c.l)(n)&&(n=b.from(n).toNumber()),r.chainId=n}else{var o=e.networkId;null==o&&null==r.v&&(o=e.chainId),Object(c.l)(o)&&(o=b.from(o).toNumber()),"number"!=typeof o&&null!=r.v&&((o=(r.v-35)/2)<0&&(o=0),o=parseInt(o)),"number"!=typeof o&&(o=0),r.chainId=o}return r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}},{key:"transaction",value:function(t){return yo(t)}},{key:"receiptLog",value:function(e){return t.check(this.formats.receiptLog,e)}},{key:"receipt",value:function(e){var r=t.check(this.formats.receipt,e);if(null!=r.root)if(r.root.length<=4){var n=b.from(r.root).toNumber();0===n||1===n?(null!=r.status&&r.status!==n&&js.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):js.throwArgumentError("invalid alt-root-status","value.root",r.root)}else 66!==r.root.length&&js.throwArgumentError("invalid root hash","value.root",r.root);return null!=r.status&&(r.byzantium=!0),r}},{key:"topics",value:function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.topics(t)})):null!=t?this.hash(t,!0):null}},{key:"filter",value:function(e){return t.check(this.formats.filter,e)}},{key:"filterLog",value:function(e){return t.check(this.formats.filterLog,e)}}])&&Ps(e.prototype,r),n&&Ps(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Rs(t){return t&&"function"==typeof t.isCommunityResource}function Ns(t){return Rs(t)&&t.isCommunityResource()}var Is=!1;function Ls(){Is||(Is=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}function Cs(t,e){return(Cs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ms(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ds(t);if(e){var o=Ds(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Bs(this,r)}}function Bs(t,e){if(e&&("object"===qs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Fs(t)}function Fs(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ds(t){return(Ds=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Us(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Us=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==qs(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function zs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==qs(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==qs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===qs(i)?i:String(i)),n)}var o,i}function Hs(t,e,r){return e&&Gs(t.prototype,e),r&&Gs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function qs(t){return(qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Ks=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Ws=new h.b("providers/5.7.2");function Qs(t){return null==t?"null":(32!==Object(c.d)(t)&&Ws.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function Vs(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((function(t){if(Array.isArray(t)){var e={};t.forEach((function(t){e[Qs(t)]=!0}));var r=Object.keys(e);return r.sort(),r.join("|")}return Qs(t)})).join("&")}function Js(t){if("string"==typeof t){if(t=t.toLowerCase(),32===Object(c.d)(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+Vs(t);if(On.isForkEvent(t))throw Ws.warn("not implemented"),new Error("not implemented");if(t&&"object"===qs(t))return"filter:"+(t.address||"*")+":"+Vs(t.topics||[])}throw new Error("invalid event - "+t)}function Ys(){return(new Date).getTime()}function Zs(t){return new Promise((function(e){setTimeout(e,t)}))}var Xs=["block","network","pending","poll"],$s=function(){function t(e,r,n){zs(this,t),T(this,"tag",e),T(this,"listener",r),T(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return Hs(t,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}},{key:"filter",get:function(){var t=this.tag.split(":");if("filter"!==t[0])return null;var e,r=t[1],n=""===(e=t[2])?[]:e.split(/&/g).map((function(t){if(""===t)return[];var e=t.split("|").map((function(t){return"null"===t?null:t}));return 1===e.length?e[0]:e})),o={};return n.length>0&&(o.topics=n),r&&"*"!==r&&(o.address=r),o}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||Xs.indexOf(this.tag)>=0}}]),t}(),tc={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function ec(t){return Object(c.h)(b.from(t).toHexString(),32)}function rc(t){return Mi.encode(Object(c.b)([t,Object(c.e)(zi(zi(t)),0,4)]))}var nc=new RegExp("^(ipfs)://(.*)$","i"),oc=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),nc,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ic(t,e){try{return St(ac(t,e))}catch(t){}return null}function ac(t,e){if("0x"===t)return null;var r=b.from(Object(c.e)(t,e,e+32)).toNumber(),n=b.from(Object(c.e)(t,r,r+32)).toNumber();return Object(c.e)(t,r+32,r+32+n)}function uc(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Ws.throwArgumentError("unsupported IPFS format","link",t),"https://gateway.ipfs.io/ipfs/".concat(t)}function sc(t){var e=Object(c.a)(t);if(e.length>32)throw new Error("internal; should not happen");var r=new Uint8Array(32);return r.set(e,32-e.length),r}function cc(t){if(t.length%32==0)return t;var e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function lc(t){for(var e=[],r=0,n=0;n<t.length;n++)e.push(null),r+=32;for(var o=0;o<t.length;o++){var i=Object(c.a)(t[o]);e[o]=sc(r),e.push(sc(i.length)),e.push(cc(i)),r+=32+32*Math.ceil(i.length/32)}return Object(c.c)(e)}var fc=function(){function t(e,r,n,o){zs(this,t),T(this,"provider",e),T(this,"name",n),T(this,"address",e.formatter.address(r)),T(this,"_resolvedAddress",o)}return Hs(t,[{key:"supportsWildcard",value:function(){var t=this;return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((function(t){return b.from(t).eq(1)})).catch((function(e){if(e.code===h.b.errors.CALL_EXCEPTION)return!1;throw t._supportsEip2544=null,e}))),this._supportsEip2544}},{key:"_fetch",value:function(t,e){return Ks(this,void 0,void 0,Us().mark((function r(){var n,o,i;return Us().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={to:this.address,ccipReadEnabled:!0,data:Object(c.c)([t,ls(this.name),e||"0x"])},o=!1,r.next=4,this.supportsWildcard();case 4:if(!r.sent){r.next=7;break}o=!0,n.data=Object(c.c)(["0x9061b923",lc([fs(this.name),n.data])]);case 7:return r.prev=7,r.next=10,this.provider.call(n);case 10:return i=r.sent,Object(c.a)(i).length%32==4&&Ws.throwError("resolver threw error",h.b.errors.CALL_EXCEPTION,{transaction:n,data:i}),o&&(i=ac(i,0)),r.abrupt("return",i);case 16:if(r.prev=16,r.t0=r.catch(7),r.t0.code!==h.b.errors.CALL_EXCEPTION){r.next=20;break}return r.abrupt("return",null);case 20:throw r.t0;case 21:case"end":return r.stop()}}),r,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(t,e){return Ks(this,void 0,void 0,Us().mark((function r(){var n;return Us().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._fetch(t,e);case 2:if(null==(n=r.sent)){r.next=5;break}return r.abrupt("return",ac(n,0));case 5:return r.abrupt("return",null);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_getAddress",value:function(t,e){var r=tc[String(t)];if(null==r&&Ws.throwError("unsupported coin type: ".concat(t),h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(t,")")}),"eth"===r.ilk)return this.provider.formatter.address(e);var n=Object(c.a)(e);if(null!=r.p2pkh){var o=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){var i=parseInt(o[1],16);if(o[2].length===2*i&&i>=1&&i<=75)return rc(Object(c.b)([[r.p2pkh],"0x"+o[2]]))}}if(null!=r.p2sh){var a=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){var u=parseInt(a[1],16);if(a[2].length===2*u&&u>=1&&u<=75)return rc(Object(c.b)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var s=n[1],l=n[0];if(0===l?20!==s&&32!==s&&(l=-1):l=-1,l>=0&&n.length===2+s&&s>=1&&s<=75){var f=Os.a.toWords(n.slice(2));return f.unshift(l),Os.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n,o;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t&&(t=60),60!==t){e.next=16;break}return e.prev=2,e.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(r=e.sent)&&r!==Eu){e.next=8;break}return e.abrupt("return",null);case 8:return e.abrupt("return",this.provider.formatter.callAddress(r));case 11:if(e.prev=11,e.t0=e.catch(2),e.t0.code!==h.b.errors.CALL_EXCEPTION){e.next=15;break}return e.abrupt("return",null);case 15:throw e.t0;case 16:return e.next=18,this._fetchBytes("0xf1cb7e06",ec(t));case 18:if(null!=(n=e.sent)&&"0x"!==n){e.next=21;break}return e.abrupt("return",null);case 21:return null==(o=this._getAddress(t,n))&&Ws.throwError("invalid or unsupported coin data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(t,")"),coinType:t,data:n}),e.abrupt("return",o);case 24:case"end":return e.stop()}}),e,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return Ks(this,void 0,void 0,Us().mark((function t(){var e,r,n,o,i,a,u,s,l,f,h,p,d,v,y,m;return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[{type:"name",content:this.name}],t.prev=1,t.next=4,this.getText("avatar");case 4:if(null!=(r=t.sent)){t.next=7;break}return t.abrupt("return",null);case 7:n=0;case 8:if(!(n<oc.length)){t.next=91;break}if(null!=(o=r.match(oc[n]))){t.next=12;break}return t.abrupt("continue",88);case 12:i=o[1].toLowerCase(),t.t0=i,t.next="https"===t.t0?16:"data"===t.t0?18:"ipfs"===t.t0?20:"erc721"===t.t0||"erc1155"===t.t0?22:88;break;case 16:return e.push({type:"url",content:r}),t.abrupt("return",{linkage:e,url:r});case 18:return e.push({type:"data",content:r}),t.abrupt("return",{linkage:e,url:r});case 20:return e.push({type:"ipfs",content:r}),t.abrupt("return",{linkage:e,url:uc(r)});case 22:if(a="erc721"===i?"0xc87b56dd":"0x0e89341c",e.push({type:i,content:r}),t.t1=this._resolvedAddress,t.t1){t.next=29;break}return t.next=28,this.getAddress();case 28:t.t1=t.sent;case 29:if(u=t.t1,2===(s=(o[2]||"").split("/")).length){t.next=33;break}return t.abrupt("return",null);case 33:return t.next=35,this.provider.formatter.address(s[0]);case 35:if(l=t.sent,f=Object(c.h)(b.from(s[1]).toHexString(),32),"erc721"!==i){t.next=48;break}return t.t2=this.provider.formatter,t.next=41,this.provider.call({to:l,data:Object(c.c)(["0x6352211e",f])});case 41:if(t.t3=t.sent,h=t.t2.callAddress.call(t.t2,t.t3),u===h){t.next=45;break}return t.abrupt("return",null);case 45:e.push({type:"owner",content:h}),t.next=57;break;case 48:if("erc1155"!==i){t.next=57;break}return t.t4=b,t.next=52,this.provider.call({to:l,data:Object(c.c)(["0x00fdd58e",Object(c.h)(u,32),f])});case 52:if(t.t5=t.sent,!(p=t.t4.from.call(t.t4,t.t5)).isZero()){t.next=56;break}return t.abrupt("return",null);case 56:e.push({type:"balance",content:p.toString()});case 57:return d={to:this.provider.formatter.address(s[0]),data:Object(c.c)([a,f])},t.t6=ic,t.next=61,this.provider.call(d);case 61:if(t.t7=t.sent,null!=(v=(0,t.t6)(t.t7,0))){t.next=65;break}return t.abrupt("return",null);case 65:return e.push({type:"metadata-url-base",content:v}),"erc1155"===i&&(v=v.replace("{id}",f.substring(2)),e.push({type:"metadata-url-expanded",content:v})),v.match(/^ipfs:/i)&&(v=uc(v)),e.push({type:"metadata-url",content:v}),t.next=71,Es(v);case 71:if(y=t.sent){t.next=74;break}return t.abrupt("return",null);case 74:if(e.push({type:"metadata",content:JSON.stringify(y)}),"string"==typeof(m=y.image)){t.next=78;break}return t.abrupt("return",null);case 78:if(!m.match(/^(https:\/\/|data:)/i)){t.next=81;break}t.next=86;break;case 81:if(null!=m.match(nc)){t.next=84;break}return t.abrupt("return",null);case 84:e.push({type:"url-ipfs",content:m}),m=uc(m);case 86:return e.push({type:"url",content:m}),t.abrupt("return",{linkage:e,url:m});case 88:n++,t.next=8;break;case 91:t.next=95;break;case 93:t.prev=93,t.t8=t.catch(1);case 95:return t.abrupt("return",null);case 96:case"end":return t.stop()}}),t,this,[[1,93]])})))}},{key:"getContentHash",value:function(){return Ks(this,void 0,void 0,Us().mark((function t(){var e,r,n,o,i,a,u,s,c;return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(e=t.sent)&&"0x"!==e){t.next=5;break}return t.abrupt("return",null);case 5:if(!(r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){t.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){t.next=10;break}return t.abrupt("return","ipfs://"+Mi.encode("0x"+r[1]));case 10:if(!(o=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){t.next=15;break}if(i=parseInt(o[3],16),o[4].length!==2*i){t.next=15;break}return t.abrupt("return","ipns://"+Mi.encode("0x"+o[1]));case 15:if(!(a=e.match(/^0xe40101fa011b20([0-9a-f]*)$/))){t.next=19;break}if(64!==a[1].length){t.next=19;break}return t.abrupt("return","bzz://"+a[1]);case 19:if(!(u=e.match(/^0x90b2c605([0-9a-f]*)$/))){t.next=25;break}if(68!==u[1].length){t.next=25;break}return s={"=":"","+":"-","/":"_"},c=Lu("0x"+u[1]).replace(/[=+\/]/g,(function(t){return s[t]})),t.abrupt("return","sia://"+c);case 25:return t.abrupt("return",Ws.throwError("invalid or unsupported content hash data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e}));case 26:case"end":return t.stop()}}),t,this)})))}},{key:"getText",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Et(t),(r=Object(c.b)([ec(64),ec(r.length),r])).length%32!=0&&(r=Object(c.b)([r,Object(c.h)("0x",32-t.length%32)])),e.next=5,this._fetchBytes("0x59d1d43c",Object(c.i)(r));case 5:if(null!=(n=e.sent)&&"0x"!==n){e.next=8;break}return e.abrupt("return",null);case 8:return e.abrupt("return",St(n));case 9:case"end":return e.stop()}}),e,this)})))}}]),t}(),hc=null,pc=1,dc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cs(t,e)}(r,t);var e=Ms(r);function r(t){var n;if(zs(this,r),(n=e.call(this))._events=[],n._emitted={block:-2},n.disableCcipRead=!1,n.formatter=(this instanceof r?this.constructor:void 0).getFormatter(),T(Fs(n),"anyNetwork","any"===t),n.anyNetwork&&(t=n.detectNetwork()),t instanceof Promise)n._networkPromise=t,t.catch((function(t){})),n._ready().catch((function(t){}));else{var o=R(this instanceof r?this.constructor:void 0,"getNetwork")(t);o?(T(Fs(n),"_network",o),n.emit("network",o,null)):Ws.throwArgumentError("invalid network","network",t)}return n._maxInternalBlockNumber=-1024,n._lastBlockNumber=-2,n._maxFilterBlockRange=10,n._pollingInterval=4e3,n._fastQueryDate=0,n}return Hs(r,[{key:"_ready",value:function(){return Ks(this,void 0,void 0,Us().mark((function t(){var e;return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=this._network){t.next=17;break}if(e=null,!this._networkPromise){t.next=11;break}return t.prev=3,t.next=6,this._networkPromise;case 6:e=t.sent,t.next=11;break;case 9:t.prev=9,t.t0=t.catch(3);case 11:if(null!=e){t.next=15;break}return t.next=14,this.detectNetwork();case 14:e=t.sent;case 15:e||Ws.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:T(this,"_network",e),this.emit("network",e,null));case 17:return t.abrupt("return",this._network);case 18:case"end":return t.stop()}}),t,this,[[3,9]])})))}},{key:"ready",get:function(){var t=this;return xs((function(){return t._ready().then((function(t){return t}),(function(t){if(t.code!==h.b.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))}))}},{key:"ccipReadFetch",value:function(t,e,r){return Ks(this,void 0,void 0,Us().mark((function n(){var o,i,a,u,s,c,l,f,p;return Us().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.disableCcipRead&&0!==r.length){n.next=2;break}return n.abrupt("return",null);case 2:o=t.to.toLowerCase(),i=e.toLowerCase(),a=[],u=0;case 6:if(!(u<r.length)){n.next=22;break}return s=r[u],c=s.replace("{sender}",o).replace("{data}",i),l=s.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:o}),n.next=12,Es({url:c,errorPassThrough:!0},l,(function(t,e){return t.status=e.statusCode,t}));case 12:if(!(f=n.sent).data){n.next=15;break}return n.abrupt("return",f.data);case 15:if(p=f.message||"unknown error",!(f.status>=400&&f.status<500)){n.next=18;break}return n.abrupt("return",Ws.throwError("response not found during CCIP fetch: ".concat(p),h.b.errors.SERVER_ERROR,{url:s,errorMessage:p}));case 18:a.push(p);case 19:u++,n.next=6;break;case 22:return n.abrupt("return",Ws.throwError("error encountered during CCIP fetch: ".concat(a.map((function(t){return JSON.stringify(t)})).join(", ")),h.b.errors.SERVER_ERROR,{urls:r,errorMessages:a}));case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n,o,i,a=this;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:if(!(t>0)){e.next=20;break}case 3:if(!this._internalBlockNumber){e.next=20;break}return r=this._internalBlockNumber,e.prev=5,e.next=8,r;case 8:if(n=e.sent,!(Ys()-n.respTime<=t)){e.next=11;break}return e.abrupt("return",n.blockNumber);case 11:return e.abrupt("break",20);case 14:if(e.prev=14,e.t0=e.catch(5),this._internalBlockNumber!==r){e.next=18;break}return e.abrupt("break",20);case 18:e.next=3;break;case 20:return o=Ys(),i=N({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(t){return null}),(function(t){return t}))}).then((function(t){var e=t.blockNumber,r=t.networkError;if(r)throw a._internalBlockNumber===i&&(a._internalBlockNumber=null),r;var n=Ys();return(e=b.from(e).toNumber())<a._maxInternalBlockNumber&&(e=a._maxInternalBlockNumber),a._maxInternalBlockNumber=e,a._setFastBlockNumber(e),{blockNumber:e,reqTime:o,respTime:n}})),this._internalBlockNumber=i,i.catch((function(t){a._internalBlockNumber===i&&(a._internalBlockNumber=null)})),e.next=26,i;case 26:return e.abrupt("return",e.sent.blockNumber);case 27:case"end":return e.stop()}}),e,this,[[5,14]])})))}},{key:"poll",value:function(){return Ks(this,void 0,void 0,Us().mark((function t(){var e,r,n,o,i=this;return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=pc++,r=[],n=null,t.prev=3,t.next=6,this._getInternalBlockNumber(100+this.pollingInterval/2);case 6:n=t.sent,t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(3),this.emit("error",t.t0),t.abrupt("return");case 13:if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){t.next=18;break}return this.emit("didPoll",e),t.abrupt("return");case 18:if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Ws.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",Ws.makeError("network block skew detected",h.b.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(o=this._emitted.block+1;o<=n;o++)this.emit("block",o);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(t){if("block"!==t){var e=i._emitted[t];"pending"!==e&&n-e>12&&delete i._emitted[t]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(t){switch(t.type){case"tx":var e=t.hash,o=i.getTransactionReceipt(e).then((function(t){return t&&null!=t.blockNumber?(i._emitted["t:"+e]=t.blockNumber,i.emit(e,t),null):null})).catch((function(t){i.emit("error",t)}));r.push(o);break;case"filter":if(!t._inflight){t._inflight=!0,-2===t._lastBlockNumber&&(t._lastBlockNumber=n-1);var a=t.filter;a.fromBlock=t._lastBlockNumber+1,a.toBlock=n;var u=a.toBlock-i._maxFilterBlockRange;u>a.fromBlock&&(a.fromBlock=u),a.fromBlock<0&&(a.fromBlock=0);var s=i.getLogs(a).then((function(e){t._inflight=!1,0!==e.length&&e.forEach((function(e){e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),i._emitted["b:"+e.blockHash]=e.blockNumber,i._emitted["t:"+e.transactionHash]=e.blockNumber,i.emit(a,e)}))})).catch((function(e){i.emit("error",e),t._inflight=!1}));r.push(s)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){i.emit("didPoll",e)})).catch((function(t){i.emit("error",t)})),t.abrupt("return");case 26:case"end":return t.stop()}}),t,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return Ks(this,void 0,void 0,Us().mark((function t(){return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Ws.throwError("provider does not support network detection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return t.stop()}}),t)})))}},{key:"getNetwork",value:function(){return Ks(this,void 0,void 0,Us().mark((function t(){var e,r,n;return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:return e=t.sent,t.next=5,this.detectNetwork();case 5:if(r=t.sent,e.chainId===r.chainId){t.next=23;break}if(!this.anyNetwork){t.next=20;break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),t.next=19,Zs(0);case 19:return t.abrupt("return",this._network);case 20:throw n=Ws.makeError("underlying network changed",h.b.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r}),this.emit("error",n),n;case 23:return t.abrupt("return",e);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"blockNumber",get:function(){var t=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(e){t._setFastBlockNumber(e)}),(function(t){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(t){var e=this;t&&!this._poller?(this._poller=setInterval((function(){e.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){e.poll(),e._bootstrapPoll=setTimeout((function(){e._poller||e.poll(),e._bootstrapPoll=null}),e.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(t){var e=this;if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){e.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var t=this,e=Ys();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=Ys(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}},{key:"waitForTransaction",value:function(t,e,r){return Ks(this,void 0,void 0,Us().mark((function n(){return Us().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(t,null==e?1:e,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(t,e,r,n){return Ks(this,void 0,void 0,Us().mark((function o(){var i,a=this;return Us().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getTransactionReceipt(t);case 2:if(!(((i=o.sent)?i.confirmations:0)>=e)){o.next=5;break}return o.abrupt("return",i);case 5:return o.abrupt("return",new Promise((function(o,i){var u=[],s=!1,c=function(){return!!s||(s=!0,u.forEach((function(t){t()})),!1)},l=function(t){t.confirmations<e||c()||o(t)};if(a.on(t,l),u.push((function(){a.removeListener(t,l)})),n){var f=n.startBlock,p=null,d=function r(o){return Ks(a,void 0,void 0,Us().mark((function a(){var u=this;return Us().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!s){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,Zs(1e3);case 4:this.getTransactionCount(n.from).then((function(a){return Ks(u,void 0,void 0,Us().mark((function u(){var l,d,v,y,m,g;return Us().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(!s){u.next=2;break}return u.abrupt("return");case 2:if(!(a<=n.nonce)){u.next=6;break}f=o,u.next=41;break;case 6:return u.next=8,this.getTransaction(t);case 8:if(!(l=u.sent)||null==l.blockNumber){u.next=11;break}return u.abrupt("return");case 11:null==p&&(p=f-3)<n.startBlock&&(p=n.startBlock);case 12:if(!(p<=o)){u.next=41;break}if(!s){u.next=15;break}return u.abrupt("return");case 15:return u.next=17,this.getBlockWithTransactions(p);case 17:d=u.sent,v=0;case 19:if(!(v<d.transactions.length)){u.next=38;break}if((y=d.transactions[v]).hash!==t){u.next=23;break}return u.abrupt("return");case 23:if(y.from!==n.from||y.nonce!==n.nonce){u.next=35;break}if(!s){u.next=26;break}return u.abrupt("return");case 26:return u.next=28,this.waitForTransaction(y.hash,e);case 28:if(m=u.sent,!c()){u.next=31;break}return u.abrupt("return");case 31:return g="replaced",y.data===n.data&&y.to===n.to&&y.value.eq(n.value)?g="repriced":"0x"===y.data&&y.from===y.to&&y.value.isZero()&&(g="cancelled"),i(Ws.makeError("transaction was replaced",h.b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===g||"cancelled"===g,reason:g,replacement:this._wrapTransaction(y),hash:t,receipt:m})),u.abrupt("return");case 35:v++,u.next=19;break;case 38:p++,u.next=12;break;case 41:if(!s){u.next=43;break}return u.abrupt("return");case 43:this.once("block",r);case 44:case"end":return u.stop()}}),u,this)})))}),(function(t){s||u.once("block",r)}));case 5:case"end":return a.stop()}}),a,this)})))};if(s)return;a.once("block",d),u.push((function(){a.removeListener("block",d)}))}if("number"==typeof r&&r>0){var v=setTimeout((function(){c()||i(Ws.makeError("timeout exceeded",h.b.errors.TIMEOUT,{timeout:r}))}),r);v.unref&&v.unref(),u.push((function(){clearTimeout(v)}))}})));case 6:case"end":return o.stop()}}),o,this)})))}},{key:"getBlockNumber",value:function(){return Ks(this,void 0,void 0,Us().mark((function t(){return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"getGasPrice",value:function(){return Ks(this,void 0,void 0,Us().mark((function t(){var e;return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,this.perform("getGasPrice",{});case 4:return e=t.sent,t.prev=5,t.abrupt("return",b.from(e));case 9:return t.prev=9,t.t0=t.catch(5),t.abrupt("return",Ws.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t.t0}));case 12:case"end":return t.stop()}}),t,this,[[5,9]])})))}},{key:"getBalance",value:function(t,e){return Ks(this,void 0,void 0,Us().mark((function r(){var n,o;return Us().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,N({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return o=r.sent,r.prev=8,r.abrupt("return",b.from(o));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ws.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getBalance",params:n,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(t,e){return Ks(this,void 0,void 0,Us().mark((function r(){var n,o;return Us().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,N({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return o=r.sent,r.prev=8,r.abrupt("return",b.from(o).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ws.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(t,e){return Ks(this,void 0,void 0,Us().mark((function r(){var n,o;return Us().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,N({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return o=r.sent,r.prev=8,r.abrupt("return",Object(c.i)(o));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Ws.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getCode",params:n,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(t,e,r){return Ks(this,void 0,void 0,Us().mark((function n(){var o,i;return Us().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,N({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((function(t){return Object(c.g)(t)}))});case 4:return o=n.sent,n.next=7,this.perform("getStorageAt",o);case 7:return i=n.sent,n.prev=8,n.abrupt("return",Object(c.i)(i));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",Ws.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getStorageAt",params:o,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(t,e,r){var n=this;if(null!=e&&32!==Object(c.d)(e))throw new Error("invalid response - sendTransaction");var o=t;return null!=e&&t.hash!==e&&Ws.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.b.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),o.wait=function(e,o){return Ks(n,void 0,void 0,Us().mark((function n(){var i,a;return Us().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==e&&(e=1),null==o&&(o=0),i=void 0,0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r}),n.next=6,this._waitForTransaction(t.hash,e,o,i);case 6:if(null!=(a=n.sent)||0!==e){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+t.hash]=a.blockNumber,0===a.status&&Ws.throwError("transaction failed",h.b.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:a}),n.abrupt("return",a);case 12:case"end":return n.stop()}}),n,this)})))},o}},{key:"sendTransaction",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n,o,i;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,Promise.resolve(t).then((function(t){return Object(c.i)(t)}));case 4:return r=e.sent,null==(n=this.formatter.transaction(t)).confirmations&&(n.confirmations=0),e.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return o=e.sent,e.prev=10,e.next=13,this.perform("sendTransaction",{signedTransaction:r});case 13:return i=e.sent,e.abrupt("return",this._wrapTransaction(n,i,o));case 17:throw e.prev=17,e.t0=e.catch(10),e.t0.transaction=n,e.t0.transactionHash=n.hash,e.t0;case 22:case"end":return e.stop()}}),e,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n,o=this;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return r=e.sent,n={},["from","to"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?o._getAddress(t):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?b.from(t):null})))})),["type"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return null!=t?t:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?Object(c.i)(t):null})))})),e.t0=this.formatter,e.next=12,N(n);case 12:return e.t1=e.sent,e.abrupt("return",e.t0.transactionRequest.call(e.t0,e.t1));case 14:case"end":return e.stop()}}),e,this)})))}},{key:"_getFilter",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n=this;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,r={},null!=t.address&&(r.address=this._getAddress(t.address)),["blockHash","topics"].forEach((function(e){null!=t[e]&&(r[e]=t[e])})),["fromBlock","toBlock"].forEach((function(e){null!=t[e]&&(r[e]=n._getBlockTag(t[e]))})),e.t0=this.formatter,e.next=10,N(r);case 10:return e.t1=e.sent,e.abrupt("return",e.t0.filter.call(e.t0,e.t1));case 12:case"end":return e.stop()}}),e,this)})))}},{key:"_call",value:function(t,e,r){return Ks(this,void 0,void 0,Us().mark((function n(){var o,i,a,u,s,l,f,p,d,v,y,m,g,w,_;return Us().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&Ws.throwError("CCIP read exceeded maximum redirections",h.b.errors.SERVER_ERROR,{redirects:r,transaction:t}),o=t.to,n.next=4,this.perform("call",{transaction:t,blockTag:e});case 4:if(i=n.sent,!(r>=0&&"latest"===e&&null!=o&&"0x556f1830"===i.substring(0,10)&&Object(c.d)(i)%32==4)){n.next=31;break}for(n.prev=6,a=Object(c.e)(i,4),u=Object(c.e)(a,0,32),b.from(u).eq(o)||Ws.throwError("CCIP Read sender did not match",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),s=[],l=b.from(Object(c.e)(a,32,64)).toNumber(),f=b.from(Object(c.e)(a,l,l+32)).toNumber(),p=Object(c.e)(a,l+32),d=0;d<f;d++)null==(v=ic(p,32*d))&&Ws.throwError("CCIP Read contained corrupt URL string",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),s.push(v);return y=ac(a,64),b.from(Object(c.e)(a,100,128)).isZero()||Ws.throwError("CCIP Read callback selector included junk",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),m=Object(c.e)(a,96,100),g=ac(a,128),n.next=21,this.ccipReadFetch(t,y,s);case 21:return null==(w=n.sent)&&Ws.throwError("CCIP Read disabled or provided no URLs",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),_={to:o,data:Object(c.c)([m,lc([w,g])])},n.abrupt("return",this._call(_,e,r+1));case 27:if(n.prev=27,n.t0=n.catch(6),n.t0.code!==h.b.errors.SERVER_ERROR){n.next=31;break}throw n.t0;case 31:return n.prev=31,n.abrupt("return",Object(c.i)(i));case 35:return n.prev=35,n.t1=n.catch(31),n.abrupt("return",Ws.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:n.t1}));case 38:case"end":return n.stop()}}),n,this,[[6,27],[31,35]])})))}},{key:"call",value:function(t,e){return Ks(this,void 0,void 0,Us().mark((function r(){var n;return Us().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,N({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});case 4:return n=r.sent,r.abrupt("return",this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1));case 6:case"end":return r.stop()}}),r,this)})))}},{key:"estimateGas",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,N({transaction:this._getTransactionRequest(t)});case 4:return r=e.sent,e.next=7,this.perform("estimateGas",r);case 7:return n=e.sent,e.prev=8,e.abrupt("return",b.from(n));case 12:return e.prev=12,e.t0=e.catch(8),e.abrupt("return",Ws.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:e.t0}));case 15:case"end":return e.stop()}}),e,this,[[8,12]])})))}},{key:"_getAddress",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return"string"!=typeof(t=e.sent)&&Ws.throwArgumentError("invalid address or ENS name","name",t),e.next=6,this.resolveName(t);case 6:return null==(r=e.sent)&&Ws.throwError("ENS name not configured",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(t),")")}),e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"_getBlock",value:function(t,e){return Ks(this,void 0,void 0,Us().mark((function r(){var n,o,i=this;return Us().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,t;case 4:if(t=r.sent,n=-128,o={includeTransactions:!!e},!Object(c.l)(t,32)){r.next=11;break}o.blockHash=t,r.next=21;break;case 11:return r.prev=11,r.next=14,this._getBlockTag(t);case 14:o.blockTag=r.sent,Object(c.l)(o.blockTag)&&(n=parseInt(o.blockTag.substring(2),16)),r.next=21;break;case 18:r.prev=18,r.t0=r.catch(11),Ws.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t);case 21:return r.abrupt("return",xs((function(){return Ks(i,void 0,void 0,Us().mark((function t(){var r,i,a,u,s,c,l=this;return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getBlock",o);case 2:if(null!=(r=t.sent)){t.next=11;break}if(null==o.blockHash){t.next=7;break}if(null!=this._emitted["b:"+o.blockHash]){t.next=7;break}return t.abrupt("return",null);case 7:if(null==o.blockTag){t.next=10;break}if(!(n>this._emitted.block)){t.next=10;break}return t.abrupt("return",null);case 10:return t.abrupt("return",void 0);case 11:if(!e){t.next=34;break}i=null,a=0;case 14:if(!(a<r.transactions.length)){t.next=31;break}if(null!=(u=r.transactions[a]).blockNumber){t.next=20;break}u.confirmations=0,t.next=28;break;case 20:if(null!=u.confirmations){t.next=28;break}if(null!=i){t.next=25;break}return t.next=24,this._getInternalBlockNumber(100+2*this.pollingInterval);case 24:i=t.sent;case 25:(s=i-u.blockNumber+1)<=0&&(s=1),u.confirmations=s;case 28:a++,t.next=14;break;case 31:return(c=this.formatter.blockWithTransactions(r)).transactions=c.transactions.map((function(t){return l._wrapTransaction(t)})),t.abrupt("return",c);case 34:return t.abrupt("return",this.formatter.block(r));case 35:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 22:case"end":return r.stop()}}),r,this,[[11,18]])})))}},{key:"getBlock",value:function(t){return this._getBlock(t,!1)}},{key:"getBlockWithTransactions",value:function(t){return this._getBlock(t,!0)}},{key:"getTransaction",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n=this;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,t;case 4:return t=e.sent,r={transactionHash:this.formatter.hash(t,!0)},e.abrupt("return",xs((function(){return Ks(n,void 0,void 0,Us().mark((function e(){var n,o,i,a;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getTransaction",r);case 2:if(null!=(n=e.sent)){e.next=7;break}if(null!=this._emitted["t:"+t]){e.next=6;break}return e.abrupt("return",null);case 6:return e.abrupt("return",void 0);case 7:if(null!=(o=this.formatter.transactionResponse(n)).blockNumber){e.next=12;break}o.confirmations=0,e.next=19;break;case 12:if(null!=o.confirmations){e.next=19;break}return e.next=15,this._getInternalBlockNumber(100+2*this.pollingInterval);case 15:i=e.sent,(a=i-o.blockNumber+1)<=0&&(a=1),o.confirmations=a;case 19:return e.abrupt("return",this._wrapTransaction(o));case 20:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionReceipt",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n=this;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,t;case 4:return t=e.sent,r={transactionHash:this.formatter.hash(t,!0)},e.abrupt("return",xs((function(){return Ks(n,void 0,void 0,Us().mark((function e(){var n,o,i,a;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getTransactionReceipt",r);case 2:if(null!=(n=e.sent)){e.next=7;break}if(null!=this._emitted["t:"+t]){e.next=6;break}return e.abrupt("return",null);case 6:return e.abrupt("return",void 0);case 7:if(null!=n.blockHash){e.next=9;break}return e.abrupt("return",void 0);case 9:if(null!=(o=this.formatter.receipt(n)).blockNumber){e.next=14;break}o.confirmations=0,e.next=21;break;case 14:if(null!=o.confirmations){e.next=21;break}return e.next=17,this._getInternalBlockNumber(100+2*this.pollingInterval);case 17:i=e.sent,(a=i-o.blockNumber+1)<=0&&(a=1),o.confirmations=a;case 21:return e.abrupt("return",o);case 22:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getLogs",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,N({filter:this._getFilter(t)});case 4:return r=e.sent,e.next=7,this.perform("getLogs",r);case 7:return(n=e.sent).forEach((function(t){null==t.removed&&(t.removed=!1)})),e.abrupt("return",Ts.arrayOf(this.formatter.filterLog.bind(this.formatter))(n));case 10:case"end":return e.stop()}}),e,this)})))}},{key:"getEtherPrice",value:function(){return Ks(this,void 0,void 0,Us().mark((function t(){return Us().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.abrupt("return",this.perform("getEtherPrice",{}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlockTag",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(!("number"==typeof(t=e.sent)&&t<0)){e.next=11;break}return t%1&&Ws.throwArgumentError("invalid BlockTag","blockTag",t),e.next=7,this._getInternalBlockNumber(100+2*this.pollingInterval);case 7:return r=e.sent,(r+=t)<0&&(r=0),e.abrupt("return",this.formatter.blockTag(r));case 11:return e.abrupt("return",this.formatter.blockTag(t));case 12:case"end":return e.stop()}}),e,this)})))}},{key:"getResolver",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n,o;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t;case 1:if(""!==r&&"."!==r){e.next=4;break}return e.abrupt("return",null);case 4:if("eth"===t||"eth"!==r){e.next=6;break}return e.abrupt("return",null);case 6:return e.next=8,this._getResolver(r,"getResolver");case 8:if(null==(n=e.sent)){e.next=19;break}if(o=new fc(this,n,t),e.t0=r!==t,!e.t0){e.next=16;break}return e.next=15,o.supportsWildcard();case 15:e.t0=!e.sent;case 16:if(!e.t0){e.next=18;break}return e.abrupt("return",null);case 18:return e.abrupt("return",o);case 19:r=r.split(".").slice(1).join("."),e.next=1;break;case 22:case"end":return e.stop()}}),e,this)})))}},{key:"_getResolver",value:function(t,e){return Ks(this,void 0,void 0,Us().mark((function r(){var n,o;return Us().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e&&(e="ENS"),r.next=3,this.getNetwork();case 3:return(n=r.sent).ensAddress||Ws.throwError("network does not support ENS",h.b.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name}),r.prev=5,r.next=8,this.call({to:n.ensAddress,data:"0x0178b8bf"+ls(t).substring(2)});case 8:return o=r.sent,r.abrupt("return",this.formatter.callAddress(o));case 12:r.prev=12,r.t0=r.catch(5);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r,this,[[5,12]])})))}},{key:"resolveName",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,e.prev=3,e.abrupt("return",Promise.resolve(this.formatter.address(t)));case 7:if(e.prev=7,e.t0=e.catch(3),!Object(c.l)(t)){e.next=11;break}throw e.t0;case 11:return"string"!=typeof t&&Ws.throwArgumentError("invalid ENS name","name",t),e.next=14,this.getResolver(t);case 14:if(r=e.sent){e.next=17;break}return e.abrupt("return",null);case 17:return e.next=19,r.getAddress();case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e,this,[[3,7]])})))}},{key:"lookupAddress",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n,o;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,t=this.formatter.address(t),r=t.substring(2).toLowerCase()+".addr.reverse",e.next=7,this._getResolver(r,"lookupAddress");case 7:if(null!=(n=e.sent)){e.next=10;break}return e.abrupt("return",null);case 10:return e.t0=ic,e.next=13,this.call({to:n,data:"0x691f3431"+ls(r).substring(2)});case 13:return e.t1=e.sent,o=(0,e.t0)(e.t1,0),e.next=17,this.resolveName(o);case 17:if(e.sent==t){e.next=20;break}return e.abrupt("return",null);case 20:return e.abrupt("return",o);case 21:case"end":return e.stop()}}),e,this)})))}},{key:"getAvatar",value:function(t){return Ks(this,void 0,void 0,Us().mark((function e(){var r,n,o,i,a,u,s;return Us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,!Object(c.l)(t)){e.next=40;break}return n=this.formatter.address(t),o=n.substring(2).toLowerCase()+".addr.reverse",e.next=6,this._getResolver(o,"getAvatar");case 6:if(i=e.sent){e.next=9;break}return e.abrupt("return",null);case 9:return r=new fc(this,i,o),e.prev=10,e.next=13,r.getAvatar();case 13:if(!(a=e.sent)){e.next=16;break}return e.abrupt("return",a.url);case 16:e.next=22;break;case 18:if(e.prev=18,e.t0=e.catch(10),e.t0.code===h.b.errors.CALL_EXCEPTION){e.next=22;break}throw e.t0;case 22:return e.prev=22,e.t1=ic,e.next=26,this.call({to:i,data:"0x691f3431"+ls(o).substring(2)});case 26:return e.t2=e.sent,u=(0,e.t1)(e.t2,0),e.next=30,this.getResolver(u);case 30:r=e.sent,e.next=38;break;case 33:if(e.prev=33,e.t3=e.catch(22),e.t3.code===h.b.errors.CALL_EXCEPTION){e.next=37;break}throw e.t3;case 37:return e.abrupt("return",null);case 38:e.next=45;break;case 40:return e.next=42,this.getResolver(t);case 42:if(r=e.sent){e.next=45;break}return e.abrupt("return",null);case 45:return e.next=47,r.getAvatar();case 47:if(null!=(s=e.sent)){e.next=50;break}return e.abrupt("return",null);case 50:return e.abrupt("return",s.url);case 51:case"end":return e.stop()}}),e,this,[[10,18],[22,33]])})))}},{key:"perform",value:function(t,e){return Ws.throwError(t+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:t})}},{key:"_startEvent",value:function(t){this.polling=this._events.filter((function(t){return t.pollable()})).length>0}},{key:"_stopEvent",value:function(t){this.polling=this._events.filter((function(t){return t.pollable()})).length>0}},{key:"_addEventListener",value:function(t,e,r){var n=new $s(Js(t),e,r);return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(t,e){return this._addEventListener(t,e,!1)}},{key:"once",value:function(t,e){return this._addEventListener(t,e,!0)}},{key:"emit",value:function(t){for(var e=this,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=!1,a=[],u=Js(t);return this._events=this._events.filter((function(t){return t.tag!==u||(setTimeout((function(){t.listener.apply(e,n)}),0),i=!0,!t.once||(a.push(t),!1))})),a.forEach((function(t){e._stopEvent(t)})),i}},{key:"listenerCount",value:function(t){if(!t)return this._events.length;var e=Js(t);return this._events.filter((function(t){return t.tag===e})).length}},{key:"listeners",value:function(t){if(null==t)return this._events.map((function(t){return t.listener}));var e=Js(t);return this._events.filter((function(t){return t.tag===e})).map((function(t){return t.listener}))}},{key:"off",value:function(t,e){var r=this;if(null==e)return this.removeAllListeners(t);var n=[],o=!1,i=Js(t);return this._events=this._events.filter((function(t){return t.tag!==i||t.listener!=e||(!!o||(o=!0,n.push(t),!1))})),n.forEach((function(t){r._stopEvent(t)})),this}},{key:"removeAllListeners",value:function(t){var e=this,r=[];if(null==t)r=this._events,this._events=[];else{var n=Js(t);this._events=this._events.filter((function(t){return t.tag!==n||(r.push(t),!1)}))}return r.forEach((function(t){e._stopEvent(t)})),this}}],[{key:"getFormatter",value:function(){return null==hc&&(hc=new Ts),hc}},{key:"getNetwork",value:function(t){return Nu(null==t?"homestead":t)}}]),r}(Sn);function vc(){return(vc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=yc(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function yc(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Oc(t)););return t}function mc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */mc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==Sc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function gc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Sc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Sc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Sc(i)?i:String(i)),n)}var o,i}function wc(t,e,r){return e&&bc(t.prototype,e),r&&bc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kc(t,e)}function kc(t,e){return(kc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ec(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Oc(t);if(e){var o=Oc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return xc(this,r)}}function xc(t,e){if(e&&("object"===Sc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ac(t)}function Ac(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Oc(t){return(Oc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Sc(t){return(Sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Pc=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},jc=new h.b("providers/5.7.2"),Tc=["call","estimateGas"];function Rc(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){var r=Object(c.l)(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"===Sc(t)){for(var n in t){var o=Rc(t[n],e);if(o)return o}return null}if("string"==typeof t)try{return Rc(JSON.parse(t),e)}catch(t){}return null}function Nc(t,e,r){var n=r.transaction||r.signedTransaction;if("call"===t){var o=Rc(e,!0);if(o)return o.data;jc.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){var i=Rc(e.body,!1);null==i&&(i=Rc(e,!1)),i&&jc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:i.message,method:t,transaction:n,error:e})}var a=e.message;throw e.code===h.b.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?a=e.error.message:"string"==typeof e.body?a=e.body:"string"==typeof e.responseText&&(a=e.responseText),(a=(a||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&jc.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),a.match(/nonce (is )?too low/i)&&jc.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&jc.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),a.match(/only replay-protected/i)&&jc.throwError("legacy pre-eip-155 transactions not supported",h.b.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),Tc.indexOf(t)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&jc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Ic(t){return new Promise((function(e){setTimeout(e,t)}))}function Lc(t){if(t.error){var e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Cc(t){return t?t.toLowerCase():t}var Mc={},Bc=function(t){_c(r,t);var e=Ec(r);function r(t,n,o){var i;if(gc(this,r),i=e.call(this),t!==Mc)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return T(Ac(i),"provider",n),null==o&&(o=0),"string"==typeof o?(T(Ac(i),"_address",i.provider.formatter.address(o)),T(Ac(i),"_index",null)):"number"==typeof o?(T(Ac(i),"_index",o),T(Ac(i),"_address",null)):jc.throwArgumentError("invalid address or index","addressOrIndex",o),i}return wc(r,[{key:"connect",value:function(t){return jc.throwError("cannot alter JSON-RPC Signer connection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new Fc(Mc,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var t=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(e){return e.length<=t._index&&jc.throwError("unknown account #"+t._index,h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),t.provider.formatter.address(e[t._index])}))}},{key:"sendUncheckedTransaction",value:function(t){var e=this;t=L(t);var r=this.getAddress().then((function(t){return t&&(t=t.toLowerCase()),t}));if(null==t.gasLimit){var n=L(t);n.from=r,t.gasLimit=this.provider.estimateGas(n)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((function(t){return Pc(e,void 0,void 0,mc().mark((function e(){var r;return mc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this.provider.resolveName(t);case 4:return null==(r=e.sent)&&jc.throwArgumentError("provided ENS name resolves to null","tx.to",t),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)})))}))),N({tx:N(t),sender:r}).then((function(r){var n=r.tx,o=r.sender;null!=n.from?n.from.toLowerCase()!==o&&jc.throwArgumentError("from address mismatch","transaction",t):n.from=o;var i=e.provider.constructor.hexlifyTransaction(n,{from:!0});return e.provider.send("eth_sendTransaction",[i]).then((function(t){return t}),(function(t){return"string"==typeof t.message&&t.message.match(/user denied/i)&&jc.throwError("user rejected transaction",h.b.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),Nc("sendTransaction",t,i)}))}))}},{key:"signTransaction",value:function(t){return jc.throwError("signing transactions is unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(t){return Pc(this,void 0,void 0,mc().mark((function e(){var r,n,o=this;return mc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return r=e.sent,e.next=5,this.sendUncheckedTransaction(t);case 5:return n=e.sent,e.prev=6,e.next=9,xs((function(){return Pc(o,void 0,void 0,mc().mark((function t(){var e;return mc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.getTransaction(n);case 2:if(null!==(e=t.sent)){t.next=5;break}return t.abrupt("return",void 0);case 5:return t.abrupt("return",this.provider._wrapTransaction(e,n,r));case 6:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this.provider});case 9:return e.abrupt("return",e.sent);case 12:throw e.prev=12,e.t0=e.catch(6),e.t0.transactionHash=n,e.t0;case 16:case"end":return e.stop()}}),e,this,[[6,12]])})))}},{key:"signMessage",value:function(t){return Pc(this,void 0,void 0,mc().mark((function e(){var r,n;return mc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?Et(t):t,e.next=3,this.getAddress();case 3:return n=e.sent,e.prev=4,e.next=7,this.provider.send("personal_sign",[Object(c.i)(r),n.toLowerCase()]);case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(4),"string"==typeof e.t0.message&&e.t0.message.match(/user denied/i)&&jc.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:t}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(t){return Pc(this,void 0,void 0,mc().mark((function e(){var r,n;return mc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?Et(t):t,e.next=3,this.getAddress();case 3:return n=e.sent,e.prev=4,e.next=7,this.provider.send("eth_sign",[n.toLowerCase(),Object(c.i)(r)]);case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(4),"string"==typeof e.t0.message&&e.t0.message.match(/user denied/i)&&jc.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:t}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[4,10]])})))}},{key:"_signTypedData",value:function(t,e,r){return Pc(this,void 0,void 0,mc().mark((function n(){var o,i,a=this;return mc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Ri.resolveNames(t,e,r,(function(t){return a.provider.resolveName(t)}));case 2:return o=n.sent,n.next=5,this.getAddress();case 5:return i=n.sent,n.prev=6,n.next=9,this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Ri.getPayload(o.domain,e,o.value))]);case 9:return n.abrupt("return",n.sent);case 12:throw n.prev=12,n.t0=n.catch(6),"string"==typeof n.t0.message&&n.t0.message.match(/user denied/i)&&jc.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:o.domain,types:e,value:o.value}}),n.t0;case 16:case"end":return n.stop()}}),n,this,[[6,12]])})))}},{key:"unlock",value:function(t){return Pc(this,void 0,void 0,mc().mark((function e(){var r,n;return mc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.provider,e.next=3,this.getAddress();case 3:return n=e.sent,e.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),t,null]));case 5:case"end":return e.stop()}}),e,this)})))}}]),r}(Gn),Fc=function(t){_c(r,t);var e=Ec(r);function r(){return gc(this,r),e.apply(this,arguments)}return wc(r,[{key:"sendTransaction",value:function(t){var e=this;return this.sendUncheckedTransaction(t).then((function(t){return{hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return e.provider.waitForTransaction(t,r)}}}))}}]),r}(Bc),Dc={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},Uc=function(t){_c(r,t);var e=Ec(r);function r(t,n){var o;gc(this,r);var i=n;return null==i&&(i=new Promise((function(t,e){setTimeout((function(){o.detectNetwork().then((function(e){t(e)}),(function(t){e(t)}))}),0)}))),o=e.call(this,i),t||(t=R(o.constructor,"defaultUrl")()),T(Ac(o),"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(L(t))),o._nextId=42,o}return wc(r,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var t=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){t._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return Pc(this,void 0,void 0,mc().mark((function t(){var e,r;return mc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ic(0);case 2:return e=null,t.prev=3,t.next=6,this.send("eth_chainId",[]);case 6:e=t.sent,t.next=19;break;case 9:return t.prev=9,t.t0=t.catch(3),t.prev=11,t.next=14,this.send("net_version",[]);case 14:e=t.sent,t.next=19;break;case 17:t.prev=17,t.t1=t.catch(11);case 19:if(null==e){t.next=28;break}return r=R(this.constructor,"getNetwork"),t.prev=21,t.abrupt("return",r(b.from(e).toNumber()));case 25:return t.prev=25,t.t2=t.catch(21),t.abrupt("return",jc.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t.t2}));case 28:return t.abrupt("return",jc.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return t.stop()}}),t,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(t){return new Bc(Mc,this,t)}},{key:"getUncheckedSigner",value:function(t){return this.getSigner(t).connectUnchecked()}},{key:"listAccounts",value:function(){var t=this;return this.send("eth_accounts",[]).then((function(e){return e.map((function(e){return t.formatter.address(e)}))}))}},{key:"send",value:function(t,e){var r=this,n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:B(n),provider:this});var o=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(o&&this._cache[t])return this._cache[t];var i=Es(this.connection,JSON.stringify(n),Lc).then((function(t){return r.emit("debug",{action:"response",request:n,response:t,provider:r}),t}),(function(t){throw r.emit("debug",{action:"response",error:t,request:n,provider:r}),t}));return o&&(this._cache[t]=i,setTimeout((function(){r._cache[t]=null}),0)),i}},{key:"prepareRequest",value:function(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Cc(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Cc(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Cc(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Cc(e.address),Object(c.h)(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[R(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[R(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=Cc(e.filter.address)),["eth_getLogs",[e.filter]]}return null}},{key:"perform",value:function(t,e){return Pc(this,void 0,void 0,mc().mark((function r(){var n,o,i;return mc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==t&&"estimateGas"!==t){r.next=8;break}if(!(n=e.transaction)||null==n.type||!b.from(n.type).isZero()){r.next=8;break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8;break}return r.next=6,this.getFeeData();case 6:null==(o=r.sent).maxFeePerGas&&null==o.maxPriorityFeePerGas&&((e=L(e)).transaction=L(n),delete e.transaction.type);case 8:return null==(i=this.prepareRequest(t,e))&&jc.throwError(t+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:t}),r.prev=10,r.next=13,this.send(i[0],i[1]);case 13:return r.abrupt("return",r.sent);case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",Nc(t,r.t0,e));case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(t){"pending"===t.tag&&this._startPending(),vc(Oc(r.prototype),"_startEvent",this).call(this,t)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;var n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return Ic(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((function(t){}))}(),r})).catch((function(t){}))}}},{key:"_stopEvent",value:function(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),vc(Oc(r.prototype),"_stopEvent",this).call(this,t)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(t,e){var r=L(Dc);if(e)for(var n in e)e[n]&&(r[n]=!0);I(t,r);var o={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null!=t[e]){var r=Object(c.g)(b.from(t[e]));"gasLimit"===e&&(e="gas"),o[e]=r}})),["from","to","data"].forEach((function(e){null!=t[e]&&(o[e]=Object(c.i)(t[e]))})),t.accessList&&(o.accessList=co(t.accessList)),o}}]),r}(dc),zc=null;try{if(null==(zc=WebSocket))throw new Error("inject please")}catch(t){var Gc=new h.b("providers/5.7.2");zc=function(){Gc.throwError("WebSockets not supported in this environment",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}function Hc(t){return(Hc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */qc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==Hc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Kc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Hc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Hc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Hc(i)?i:String(i)),n)}var o,i}function Wc(t,e){return(Wc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Qc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Xc(t);if(e){var o=Xc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Vc(this,r)}}function Vc(t,e){if(e&&("object"===Hc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Jc(t)}function Jc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yc(){return(Yc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Zc(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function Zc(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xc(t)););return t}function Xc(t){return(Xc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $c=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},tl=new h.b("providers/5.7.2"),el=1,rl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wc(t,e)}(i,t);var e,r,n,o=Qc(i);function i(t,e){var r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),"any"===e&&tl.throwError("WebSocketProvider does not support 'any' network yet",h.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(n="string"==typeof t?o.call(this,t,e):o.call(this,"_websocket",e))._pollingInterval=-1,n._wsReady=!1,T(Jc(n),"_websocket","string"==typeof t?new zc(n.connection.url):t),T(Jc(n),"_requests",{}),T(Jc(n),"_subs",{}),T(Jc(n),"_subIds",{}),T(Jc(n),"_detectNetwork",Yc((r=Jc(n),Xc(i.prototype)),"detectNetwork",r).call(r)),n.websocket.onopen=function(){n._wsReady=!0,Object.keys(n._requests).forEach((function(t){n.websocket.send(n._requests[t].payload)}))},n.websocket.onmessage=function(t){var e=t.data,r=JSON.parse(e);if(null!=r.id){var o=String(r.id),i=n._requests[o];if(delete n._requests[o],void 0!==r.result)i.callback(null,r.result),n.emit("debug",{action:"response",request:JSON.parse(i.payload),response:r.result,provider:Jc(n)});else{var a=null;r.error?(T(a=new Error(r.error.message||"unknown error"),"code",r.error.code||null),T(a,"response",e)):a=new Error("unknown error"),i.callback(a,void 0),n.emit("debug",{action:"response",error:a,request:JSON.parse(i.payload),provider:Jc(n)})}}else if("eth_subscription"===r.method){var u=n._subs[r.params.subscription];u&&u.processFunc(r.params.result)}else console.warn("this should not happen")};var a=setInterval((function(){n.emit("poll")}),1e3);return a.unref&&a.unref(),Vc(n)}return e=i,n=[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}],(r=[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(t){tl.throwError("cannot set polling interval on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(t){tl.throwError("cannot reset events block on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return $c(this,void 0,void 0,qc().mark((function t(){return qc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 1:case"end":return t.stop()}}),t)})))}},{key:"polling",set:function(t){t&&tl.throwError("cannot set polling on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(t,e){var r=this,n=el++;return new Promise((function(o,i){var a=JSON.stringify({method:t,params:e,id:n,jsonrpc:"2.0"});r.emit("debug",{action:"request",request:JSON.parse(a),provider:r}),r._requests[String(n)]={callback:function(t,e){return t?i(t):o(e)},payload:a},r._wsReady&&r.websocket.send(a)}))}},{key:"_subscribe",value:function(t,e,r){return $c(this,void 0,void 0,qc().mark((function n(){var o,i,a=this;return qc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==(o=this._subIds[t])&&(o=Promise.all(e).then((function(t){return a.send("eth_subscribe",t)})),this._subIds[t]=o),n.next=4,o;case 4:i=n.sent,this._subs[i]={tag:t,processFunc:r};case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_startEvent",value:function(t){var e=this;switch(t.type){case"block":this._subscribe("block",["newHeads"],(function(t){var r=b.from(t.number).toNumber();e._emitted.block=r,e.emit("block",r)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(t){e.emit("pending",t)}));break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],(function(r){null==r.removed&&(r.removed=!1),e.emit(t.filter,e.formatter.filterLog(r))}));break;case"tx":var r=function(t){var r=t.hash;e.getTransactionReceipt(r).then((function(t){t&&e.emit(r,t)}))};r(t),this._subscribe("tx",["newHeads"],(function(t){e._events.filter((function(t){return"tx"===t.type})).forEach(r)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}},{key:"_stopEvent",value:function(t){var e=this,r=t.tag;if("tx"===t.type){if(this._events.filter((function(t){return"tx"===t.type})).length)return;r="tx"}else if(this.listenerCount(t.event))return;var n=this._subIds[r];n&&(delete this._subIds[r],n.then((function(t){e._subs[t]&&(delete e._subs[t],e.send("eth_unsubscribe",[t]))})))}},{key:"destroy",value:function(){return $c(this,void 0,void 0,qc().mark((function t(){var e=this;return qc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.websocket.readyState!==zc.CONNECTING){t.next=3;break}return t.next=3,new Promise((function(t){e.websocket.onopen=function(){t(!0)},e.websocket.onerror=function(){t(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return t.stop()}}),t,this)})))}}])&&Kc(e.prototype,r),n&&Kc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Uc);function nl(t){return(nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ol(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ol=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==nl(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function il(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function al(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==nl(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==nl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===nl(i)?i:String(i)),n)}var o,i}function ul(t,e,r){return e&&al(t.prototype,e),r&&al(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function sl(){return(sl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=cl(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function cl(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=vl(t)););return t}function ll(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fl(t,e)}function fl(t,e){return(fl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function hl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=vl(t);if(e){var o=vl(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return pl(this,r)}}function pl(t,e){if(e&&("object"===nl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return dl(t)}function dl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vl(t){return(vl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var yl=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},ml=new h.b("providers/5.7.2"),gl=function(t){ll(r,t);var e=hl(r);function r(){return il(this,r),e.apply(this,arguments)}return ul(r,[{key:"detectNetwork",value:function(){var t=this,e=Object.create(null,{detectNetwork:{get:function(){return sl(vl(r.prototype),"detectNetwork",t)}}});return yl(this,void 0,void 0,ol().mark((function t(){var r;return ol().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(r=this.network)){t.next=7;break}return t.next=4,e.detectNetwork.call(this);case 4:(r=t.sent)||ml.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(T(this,"_network",r),this.emit("network",r,null));case 7:return t.abrupt("return",r);case 8:case"end":return t.stop()}}),t,this)})))}}]),r}(Uc),bl=function(t){ll(r,t);var e=hl(r);function r(t,n){var o;il(this,r),ml.checkAbstract(this instanceof r?this.constructor:void 0,r),t=R(this instanceof r?this.constructor:void 0,"getNetwork")(t),n=R(this instanceof r?this.constructor:void 0,"getApiKey")(n);var i=R(this instanceof r?this.constructor:void 0,"getUrl")(t,n);return o=e.call(this,i,t),"string"==typeof n?T(dl(o),"apiKey",n):null!=n&&Object.keys(n).forEach((function(t){T(dl(o),t,n[t])})),o}return ul(r,[{key:"_startPending",value:function(){ml.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(t){return ml.throwError("API provider does not support signing",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(t){return t}},{key:"getUrl",value:function(t,e){return ml.throwError("not implemented; sub-classes must override getUrl",h.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),r}(gl);function wl(t){return(wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==wl(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==wl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===wl(i)?i:String(i)),n)}var o,i}function El(t,e,r){return e&&kl(t.prototype,e),r&&kl(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Al(t,e)}function Al(t,e){return(Al=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ol(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=jl(t);if(e){var o=jl(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Sl(this,r)}}function Sl(t,e){if(e&&("object"===wl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Pl(t)}function Pl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jl(t){return(jl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Tl=new h.b("providers/5.7.2"),Rl="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",Nl=function(t){xl(r,t);var e=Ol(r);function r(t,n){var o;_l(this,r);var i=new Il(t,n),a=i.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return T(Pl(o=e.call(this,a,i.network)),"apiKey",i.apiKey),o}return El(r,[{key:"isCommunityResource",value:function(){return this.apiKey===Rl}}]),r}(rl),Il=function(t){xl(r,t);var e=Ol(r);function r(){return _l(this,r),e.apply(this,arguments)}return El(r,[{key:"isCommunityResource",value:function(){return this.apiKey===Rl}}],[{key:"getWebSocketProvider",value:function(t,e){return new Nl(t,e)}},{key:"getApiKey",value:function(t){return null==t?Rl:(t&&"string"!=typeof t&&Tl.throwArgumentError("invalid apiKey","apiKey",t),t)}},{key:"getUrl",value:function(t,e){var r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:Tl.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:function(t,r){return e===Rl&&Ls(),Promise.resolve(!0)}}}}]),r}(bl);function Ll(t){return(Ll="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ml(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Ll(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ll(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Ll(i)?i:String(i)),n)}var o,i}function Bl(t,e){return(Bl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Fl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ul(t);if(e){var o=Ul(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Dl(this,r)}}function Dl(t,e){if(e&&("object"===Ll(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ul(t){return(Ul=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zl=new h.b("providers/5.7.2"),Gl="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Hl(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return zl.throwArgumentError("unsupported network","name",t)}var ql=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bl(t,e)}(i,t);var e,r,n,o=Fl(i);function i(){return Cl(this,i),o.apply(this,arguments)}return e=i,n=[{key:"getApiKey",value:function(t){return null==t?Gl:t}},{key:"getUrl",value:function(t,e){null==e&&(e=Gl);var r={allowGzip:!0,url:"https://"+Hl(t.name)+e,throttleCallback:function(t,r){return e.apiKey===Gl&&Ls(),Promise.resolve(!0)}};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}],(r=[{key:"isCommunityResource",value:function(){return this.apiKey===Gl}}])&&Ml(e.prototype,r),n&&Ml(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(bl);function Kl(t){return(Kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wl(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Wl=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==Kl(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ql(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Kl(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Kl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Kl(i)?i:String(i)),n)}var o,i}function Jl(){return(Jl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Yl(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function Yl(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=tf(t)););return t}function Zl(t,e){return(Zl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=tf(t);if(e){var o=tf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $l(this,r)}}function $l(t,e){if(e&&("object"===Kl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function tf(t){return(tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ef=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},rf=new h.b("providers/5.7.2"),nf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zl(t,e)}(i,t);var e,r,n,o=Xl(i);function i(){return Ql(this,i),o.apply(this,arguments)}return e=i,n=[{key:"getApiKey",value:function(t){return null!=t&&rf.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}},{key:"getUrl",value:function(t,e){var r=null;switch(t.name){case"homestead":r="https://cloudflare-eth.com/";break;default:rf.throwArgumentError("unsupported network","network",arguments[0])}return r}}],(r=[{key:"perform",value:function(t,e){var r=this,n=Object.create(null,{perform:{get:function(){return Jl(tf(i.prototype),"perform",r)}}});return ef(this,void 0,void 0,Wl().mark((function r(){var o;return Wl().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("getBlockNumber"!==t){r.next=5;break}return r.next=3,n.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return o=r.sent,r.abrupt("return",o.number);case 5:return r.abrupt("return",n.perform.call(this,t,e));case 6:case"end":return r.stop()}}),r,this)})))}}])&&Vl(e.prototype,r),n&&Vl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(bl);function of(t){return(of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function af(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */af=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==of(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function uf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==of(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==of(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===of(i)?i:String(i)),n)}var o,i}function sf(){return(sf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=cf(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function cf(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=df(t)););return t}function lf(t,e){return(lf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ff(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=df(t);if(e){var o=df(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return hf(this,r)}}function hf(t,e){if(e&&("object"===of(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return pf(t)}function pf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function df(t){return(df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var vf=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},yf=new h.b("providers/5.7.2");function mf(t){var e={};for(var r in t)if(null!=t[r]){var n=t[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?Object(c.g)(Object(c.i)(n)):"accessList"===r?"["+co(n).map((function(t){return'{address:"'.concat(t.address,'",storageKeys:["').concat(t.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(c.i)(n),e[r]=n)}return e}function gf(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"string"!=typeof t.message||!t.message.match(/^OK/)){var e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function bf(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){var e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){var r=new Error("invalid response");throw r.result=JSON.stringify(t),r}if(t.error){var n=new Error(t.error.message||"unknown error");throw t.error.code&&(n.code=t.error.code),t.error.data&&(n.data=t.error.data),n}return t.result}function wf(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}function _f(t,e,r){if("call"===t&&e.code===h.b.errors.SERVER_ERROR){var n=e.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var o=n.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),Object(c.l)(o))return o;yf.throwError("missing revert data in call exception",h.b.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}var i=e.message;throw e.code===h.b.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText)),(i=(i||"").toLowerCase()).match(/insufficient funds/)&&yf.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&yf.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),i.match(/another transaction with same nonce/)&&yf.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),i.match(/execution failed due to an exception|execution reverted/)&&yf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}var kf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lf(t,e)}(i,t);var e,r,n,o=ff(i);function i(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),T(pf(r=o.call(this,t)),"baseUrl",r.getBaseUrl()),T(pf(r),"apiKey",e||null),r}return e=i,(r=[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return yf.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(t,e){var r=Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&(t+="&".concat(r,"=").concat(n)),t}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(t).concat(r).concat(n)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(t,e){return e.module=t,e.apikey=this.apiKey,e}},{key:"fetch",value:function(t,e,r){return vf(this,void 0,void 0,af().mark((function n(){var o,i,a,u,s,c,l=this;return af().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=r?this.getPostUrl():this.getUrl(t,e),i=r?this.getPostData(t,e):null,a="proxy"===t?bf:gf,this.emit("debug",{action:"request",request:o,provider:this}),u={url:o,throttleSlotInterval:1e3,throttleCallback:function(t,e){return l.isCommunityResource()&&Ls(),Promise.resolve(!0)}},s=null,i&&(u.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map((function(t){return"".concat(t,"=").concat(i[t])})).join("&")),n.next=9,Es(u,s,a||bf);case 9:return c=n.sent,this.emit("debug",{action:"response",request:o,response:B(c),provider:this}),n.abrupt("return",c);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return vf(this,void 0,void 0,af().mark((function t(){return af().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.network);case 1:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(t,e){var r=this,n=Object.create(null,{perform:{get:function(){return sf(df(i.prototype),"perform",r)}}});return vf(this,void 0,void 0,af().mark((function r(){var o,i,a,u,s,c,l,f,p;return af().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=t,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72;break;case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag}));case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag}));case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag}));case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag}));case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch((function(t){return _f("sendTransaction",t,e.signedTransaction)})));case 10:if(!e.blockTag){r.next=12;break}return r.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.transactionHash}));case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.transactionHash}));case 15:if("latest"===e.blockTag){r.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(o=mf(e.transaction)).module="proxy",o.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",o,!0);case 23:return r.abrupt("return",r.sent);case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",_f("call",r.t1,e.transaction));case 29:return(i=mf(e.transaction)).module="proxy",i.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",i,!0);case 35:return r.abrupt("return",r.sent);case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",_f("estimateGas",r.t2,e.transaction));case 41:return a={action:"getLogs"},e.filter.fromBlock&&(a.fromBlock=wf(e.filter.fromBlock)),e.filter.toBlock&&(a.toBlock=wf(e.filter.toBlock)),e.filter.address&&(a.address=e.filter.address),e.filter.topics&&e.filter.topics.length>0&&(e.filter.topics.length>1&&yf.throwError("unsupported topic count",h.b.errors.UNSUPPORTED_OPERATION,{topics:e.filter.topics}),1===e.filter.topics.length&&("string"==typeof(u=e.filter.topics[0])&&66===u.length||yf.throwError("unsupported topic format",h.b.errors.UNSUPPORTED_OPERATION,{topic0:u}),a.topic0=u)),r.next=48,this.fetch("logs",a);case 48:s=r.sent,c={},l=0;case 51:if(!(l<s.length)){r.next=64;break}if(null==(f=s[l]).blockHash){r.next=55;break}return r.abrupt("continue",61);case 55:if(null!=c[f.blockNumber]){r.next=60;break}return r.next=58,this.getBlock(f.blockNumber);case 58:(p=r.sent)&&(c[f.blockNumber]=p.hash);case 60:f.blockHash=c[f.blockNumber];case 61:l++,r.next=51;break;case 64:return r.abrupt("return",s);case 65:if("homestead"===this.network.name){r.next=67;break}return r.abrupt("return",0);case 67:return r.t3=parseFloat,r.next=70,this.fetch("stats",{action:"ethprice"});case 70:return r.t4=r.sent.ethusd,r.abrupt("return",(0,r.t3)(r.t4));case 72:return r.abrupt("break",73);case 73:return r.abrupt("return",n.perform.call(this,t,e));case 74:case"end":return r.stop()}}),r,this,[[20,26],[32,38]])})))}},{key:"getHistory",value:function(t,e,r){return vf(this,void 0,void 0,af().mark((function n(){var o,i,a=this;return af().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.resolveName(t);case 2:return n.t0=n.sent,n.t1=null==e?0:e,n.t2=null==r?99999999:r,o={action:"txlist",address:n.t0,startblock:n.t1,endblock:n.t2,sort:"asc"},n.next=8,this.fetch("account",o);case 8:return i=n.sent,n.abrupt("return",i.map((function(t){["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);var e=a.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e})));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"isCommunityResource",value:function(){return null==this.apiKey}}])&&uf(e.prototype,r),n&&uf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(dc);function Ef(t){for(var e=(t=t.slice()).length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}function xf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Rf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Rf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Rf(i)?i:String(i)),n)}var o,i}function Af(t,e){return(Af=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Of(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=jf(t);if(e){var o=jf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Sf(this,r)}}function Sf(t,e){if(e&&("object"===Rf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Pf(t)}function Pf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jf(t){return(jf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Tf=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new A(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==e&&r.call(m,i)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;n(this,"_invoke",{value:function(n,i){function a(){return new e((function(o,a){!function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==Rf(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(n,i,o,a)}))}return o=o?o.then(a,a):a()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Rf(t){return(Rf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Nf=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},If=new h.b("providers/5.7.2");function Lf(){return(new Date).getTime()}function Cf(t){for(var e=null,r=0;r<t.length;r++){var n=t[r];if(null==n)return null;e?e.name===n.name&&e.chainId===n.chainId&&(e.ensAddress===n.ensAddress||null==e.ensAddress&&null==n.ensAddress)||If.throwArgumentError("provider mismatch","networks",t):e=n}return e}function Mf(t,e){t=t.slice().sort();var r=Math.floor(t.length/2);if(t.length%2)return t[r];var n=t[r-1],o=t[r];return null!=e&&Math.abs(n-o)>e?null:(n+o)/2}function Bf(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(b.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map((function(t){return Bf(t)})));if("object"===Rf(t)){var e=Object.keys(t);return e.sort(),"{"+e.map((function(e){var r=t[e];return r="function"==typeof r?"[function]":Bf(r),JSON.stringify(e)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+Rf(t))}var Ff=1;function Df(t){var e=null,r=null,n=new Promise((function(n){e=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(e,t)}));return{cancel:e,getPromise:function(){return n},wait:function(t){return n=n.then(t)}}}var Uf=[h.b.errors.CALL_EXCEPTION,h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED,h.b.errors.UNPREDICTABLE_GAS_LIMIT],zf=["address","args","errorArgs","errorSignature","method","transaction"];function Gf(t,e){var r={weight:t.weight};return Object.defineProperty(r,"provider",{get:function(){return t.provider}}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function Hf(t,e,r){var n=Bf;switch(e){case"getBlockNumber":return function(e){var r=e.map((function(t){return t.result})),n=Mf(e.map((function(t){return t.result})),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){var e=t.map((function(t){return t.result}));return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return Mf(t.map((function(t){return t.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(t){return null==t?null:((t=L(t)).confirmations=-1,Bf(t))};break;case"getBlock":n=r.includeTransactions?function(t){return null==t?null:((t=L(t)).transactions=t.transactions.map((function(t){return(t=L(t)).confirmations=-1,t})),Bf(t))}:function(t){return null==t?null:Bf(t)};break;default:throw new Error("unknown method: "+e)}return function(t,e){return function(r){var n={};r.forEach((function(e){var r=t(e.result);n[r]||(n[r]={count:0,result:e.result}),n[r].count++}));for(var o=Object.keys(n),i=0;i<o.length;i++){var a=n[o[i]];if(a.count>=e)return a.result}}}(n,t.quorum)}function qf(t,e){return Nf(this,void 0,void 0,Tf().mark((function r(){var n;return Tf().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=t.provider).blockNumber&&n.blockNumber>=e||-1===e)){r.next=3;break}return r.abrupt("return",n);case 3:return r.abrupt("return",xs((function(){return new Promise((function(r,o){setTimeout((function(){return n.blockNumber>=e?r(n):t.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n}));case 4:case"end":return r.stop()}}),r)})))}function Kf(t,e,r,n){return Nf(this,void 0,void 0,Tf().mark((function o(){var i,a;return Tf().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:i=t.provider,o.t0=r,o.next="getBlockNumber"===o.t0||"getGasPrice"===o.t0?4:"getEtherPrice"===o.t0?5:"getBalance"===o.t0||"getTransactionCount"===o.t0||"getCode"===o.t0?8:"getStorageAt"===o.t0?13:"getBlock"===o.t0?18:"call"===o.t0||"estimateGas"===o.t0?23:"getTransaction"===o.t0||"getTransactionReceipt"===o.t0?30:"getLogs"===o.t0?31:37;break;case 4:return o.abrupt("return",i[r]());case 5:if(!i.getEtherPrice){o.next=7;break}return o.abrupt("return",i.getEtherPrice());case 7:return o.abrupt("break",37);case 8:if(!n.blockTag||!Object(c.l)(n.blockTag)){o.next=12;break}return o.next=11,qf(t,e);case 11:i=o.sent;case 12:return o.abrupt("return",i[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!Object(c.l)(n.blockTag)){o.next=17;break}return o.next=16,qf(t,e);case 16:i=o.sent;case 17:return o.abrupt("return",i.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!Object(c.l)(n.blockTag)){o.next=22;break}return o.next=21,qf(t,e);case 21:i=o.sent;case 22:return o.abrupt("return",i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!Object(c.l)(n.blockTag)){o.next=27;break}return o.next=26,qf(t,e);case 26:i=o.sent;case 27:if("call"!==r||!n.blockTag){o.next=29;break}return o.abrupt("return",i[r](n.transaction,n.blockTag));case 29:return o.abrupt("return",i[r](n.transaction));case 30:return o.abrupt("return",i[r](n.transactionHash));case 31:if(!((a=n.filter).fromBlock&&Object(c.l)(a.fromBlock)||a.toBlock&&Object(c.l)(a.toBlock))){o.next=36;break}return o.next=35,qf(t,e);case 35:i=o.sent;case 36:return o.abrupt("return",i.getLogs(a));case 37:return o.abrupt("return",If.throwError("unknown method error",h.b.errors.UNKNOWN_ERROR,{method:r,params:n}));case 38:case"end":return o.stop()}}),o)})))}var Wf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Af(t,e)}(i,t);var e,r,n,o=Of(i);function i(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),0===t.length&&If.throwArgumentError("missing providers","providers",t);var n=t.map((function(t,e){if(Sn.isProvider(t)){var r=Ns(t)?2e3:750;return Object.freeze({provider:t,weight:1,stallTimeout:r,priority:1})}var n=L(t);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=Ns(t)?2e3:750),null==n.weight&&(n.weight=1);var o=n.weight;return(o%1||o>512||o<1)&&If.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(e,"].weight"),o),Object.freeze(n)})),a=n.reduce((function(t,e){return t+e.weight}),0);null==e?e=a/2:e>a&&If.throwArgumentError("quorum will always fail; larger than total weight","quorum",e);var u=Cf(n.map((function(t){return t.provider.network})));return null==u&&(u=new Promise((function(t,e){setTimeout((function(){r.detectNetwork().then(t,e)}),0)}))),T(Pf(r=o.call(this,u)),"providerConfigs",Object.freeze(n)),T(Pf(r),"quorum",e),r._highestBlockNumber=-1,r}return e=i,(r=[{key:"detectNetwork",value:function(){return Nf(this,void 0,void 0,Tf().mark((function t(){var e;return Tf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(this.providerConfigs.map((function(t){return t.provider.getNetwork()})));case 2:return e=t.sent,t.abrupt("return",Cf(e));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(t,e){return Nf(this,void 0,void 0,Tf().mark((function r(){var n,o,i,a,u,s,c,l,f,p,d=this;return Tf().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==t){r.next=13;break}return r.next=3,Promise.all(this.providerConfigs.map((function(t){return t.provider.sendTransaction(e.signedTransaction).then((function(t){return t.hash}),(function(t){return t}))})));case 3:n=r.sent,o=0;case 5:if(!(o<n.length)){r.next=12;break}if("string"!=typeof(i=n[o])){r.next=9;break}return r.abrupt("return",i);case 9:o++,r.next=5;break;case 12:throw n[0];case 13:if(-1!==this._highestBlockNumber||"getBlockNumber"===t){r.next=16;break}return r.next=16,this.getBlockNumber();case 16:a=Hf(this,t,e),(u=Ef(this.providerConfigs.map(L))).sort((function(t,e){return t.priority-e.priority})),s=this._highestBlockNumber,c=0,l=!0,f=Tf().mark((function r(){var n,o,i,f,h,p,v;return Tf().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=Lf(),o=u.filter((function(t){return t.runner&&n-t.start<t.stallTimeout})).reduce((function(t,e){return t+e.weight}),0),i=Tf().mark((function r(){var n,i;return Tf().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=u[c++],i=Ff++,n.start=Lf(),n.staller=Df(n.stallTimeout),n.staller.wait((function(){n.staller=null})),n.runner=Kf(n,s,t,e).then((function(r){n.done=!0,n.result=r,d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:i,backend:Gf(n,Lf()),request:{method:t,params:B(e)},provider:d})}),(function(r){n.done=!0,n.error=r,d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:i,backend:Gf(n,Lf()),request:{method:t,params:B(e)},provider:d})})),d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:i,backend:Gf(n,null),request:{method:t,params:B(e)},provider:d}),o+=n.weight;case 8:case"end":return r.stop()}}),r)}));case 3:if(!(o<d.quorum&&c<u.length)){r.next=7;break}return r.delegateYield(i(),"t0",5);case 5:r.next=3;break;case 7:if(f=[],u.forEach((function(t){!t.done&&t.runner&&(f.push(t.runner),t.staller&&f.push(t.staller.getPromise()))})),!f.length){r.next=12;break}return r.next=12,Promise.race(f);case 12:if(!((h=u.filter((function(t){return t.done&&null==t.error}))).length>=d.quorum)){r.next=22;break}if(void 0===(p=a(h))){r.next=18;break}return u.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0})),r.abrupt("return",{v:p});case 18:if(l){r.next=21;break}return r.next=21,Df(100).getPromise();case 21:l=!1;case 22:if(v=u.reduce((function(t,e){if(!e.done||null==e.error)return t;var r=e.error.code;return Uf.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t}),{}),Object.keys(v).forEach((function(t){var e=v[t];if(!(e.weight<d.quorum)){u.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0}));var r=e.error,n={};zf.forEach((function(t){null!=r[t]&&(n[t]=r[t])})),If.throwError(r.reason||r.message,t,n)}})),0!==u.filter((function(t){return!t.done})).length){r.next=26;break}return r.abrupt("return","break");case 26:case"end":return r.stop()}}),r)}));case 23:return r.delegateYield(f(),"t0",25);case 25:if("break"!==(p=r.t0)){r.next=28;break}return r.abrupt("break",32);case 28:if("object"!==Rf(p)){r.next=30;break}return r.abrupt("return",p.v);case 30:r.next=23;break;case 32:return u.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0})),r.abrupt("return",If.throwError("failed to meet quorum",h.b.errors.SERVER_ERROR,{method:t,params:e,results:u.map((function(t){return Gf(t)})),provider:this}));case 34:case"end":return r.stop()}}),r,this)})))}}])&&xf(e.prototype,r),n&&xf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(dc),Qf=null;function Vf(t){return(Vf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Vf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Vf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Vf(i)?i:String(i)),n)}var o,i}function Zf(t,e,r){return e&&Yf(t.prototype,e),r&&Yf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$f(t,e)}function $f(t,e){return($f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function th(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=nh(t);if(e){var o=nh(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return eh(this,r)}}function eh(t,e){if(e&&("object"===Vf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return rh(t)}function rh(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nh(t){return(nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var oh=new h.b("providers/5.7.2"),ih="84842078b09946638c03157f83405213",ah=function(t){Xf(r,t);var e=th(r);function r(t,n){var o;Jf(this,r);var i=new uh(t,n),a=i.connection;a.password&&oh.throwError("INFURA WebSocket project secrets unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});var u=a.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");return T(rh(o=e.call(this,u,t)),"apiKey",i.projectId),T(rh(o),"projectId",i.projectId),T(rh(o),"projectSecret",i.projectSecret),o}return Zf(r,[{key:"isCommunityResource",value:function(){return this.projectId===ih}}]),r}(rl),uh=function(t){Xf(r,t);var e=th(r);function r(){return Jf(this,r),e.apply(this,arguments)}return Zf(r,[{key:"isCommunityResource",value:function(){return this.projectId===ih}}],[{key:"getWebSocketProvider",value:function(t,e){return new ah(t,e)}},{key:"getApiKey",value:function(t){var e={apiKey:ih,projectId:ih,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(oh.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),oh.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}},{key:"getUrl",value:function(t,e){var r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:oh.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}var n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:function(t,r){return e.projectId===ih&&Ls(),Promise.resolve(!0)}};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}}]),r}(bl);function sh(t){return(sh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ch(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==sh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==sh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===sh(i)?i:String(i)),n)}var o,i}function fh(t,e){return(fh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function hh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=dh(t);if(e){var o=dh(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ph(this,r)}}function ph(t,e){if(e&&("object"===sh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function dh(t){return(dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var vh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fh(t,e)}(i,t);var e,r,n,o=hh(i);function i(){return ch(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"send",value:function(t,e){var r=this,n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);var o={request:n,resolve:null,reject:null},i=new Promise((function(t,e){o.resolve=t,o.reject=e}));return this._pendingBatch.push(o),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((function(){var t=r._pendingBatch;r._pendingBatch=null,r._pendingBatchAggregator=null;var e=t.map((function(t){return t.request}));return r.emit("debug",{action:"requestBatch",request:B(e),provider:r}),Es(r.connection,JSON.stringify(e)).then((function(n){r.emit("debug",{action:"response",request:e,response:n,provider:r}),t.forEach((function(t,e){var r=n[e];if(r.error){var o=new Error(r.error.message);o.code=r.error.code,o.data=r.error.data,t.reject(o)}else t.resolve(r.result)}))}),(function(n){r.emit("debug",{action:"response",error:n,request:e,provider:r}),t.forEach((function(t){t.reject(n)}))}))}),10)),i}}])&&lh(e.prototype,r),n&&lh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Uc);function yh(t){return(yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==yh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==yh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===yh(i)?i:String(i)),n)}var o,i}function bh(t,e){return(bh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function wh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=kh(t);if(e){var o=kh(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _h(this,r)}}function _h(t,e){if(e&&("object"===yh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function kh(t){return(kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Eh=new h.b("providers/5.7.2"),xh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bh(t,e)}(i,t);var e,r,n,o=wh(i);function i(){return mh(this,i),o.apply(this,arguments)}return e=i,n=[{key:"getApiKey",value:function(t){return t&&"string"!=typeof t&&Eh.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}},{key:"getUrl",value:function(t,e){Eh.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");var r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Eh.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}],(r=null)&&gh(e.prototype,r),n&&gh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(bl);function Ah(t){return(Ah="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Oh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Ah(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ah(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Ah(i)?i:String(i)),n)}var o,i}function Ph(t,e){return(Ph=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function jh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Rh(t);if(e){var o=Rh(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Th(this,r)}}function Th(t,e){if(e&&("object"===Ah(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Rh(t){return(Rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Nh=new h.b("providers/5.7.2"),Ih=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ph(t,e)}(i,t);var e,r,n,o=jh(i);function i(){return Oh(this,i),o.apply(this,arguments)}return e=i,n=[{key:"getApiKey",value:function(t){var e={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==t?e.applicationId="62e1ad51b37b8e00394bda3b":"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?(e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey):t.applicationId?e.applicationId=t.applicationId:Nh.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}},{key:"getUrl",value:function(t,e){var r=null;switch(t?t.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:Nh.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}var n={headers:{},url:"https://".concat(r,"/v1/lb/").concat(e.applicationId)};return null!=e.applicationSecretKey&&(n.user="",n.password=e.applicationSecretKey),n}}],(r=[{key:"isCommunityResource",value:function(){return"62e1ad51b37b8e00394bda3b"===this.applicationId}}])&&Sh(e.prototype,r),n&&Sh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(bl);function Lh(t){return(Lh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ch(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Lh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Lh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Lh(i)?i:String(i)),n)}var o,i}function Mh(t,e){return(Mh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Bh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Uh(t);if(e){var o=Uh(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Fh(this,r)}}function Fh(t,e){if(e&&("object"===Lh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Dh(t)}function Dh(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Uh(t){return(Uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zh=new h.b("providers/5.7.2"),Gh=1;function Hh(t,e){var r="Web3LegacyFetcher";return function(t,n){var o=this,i={method:t,params:n,id:Gh++,jsonrpc:"2.0"};return new Promise((function(t,n){o.emit("debug",{action:"request",fetcher:r,request:B(i),provider:o}),e(i,(function(e,a){if(e)return o.emit("debug",{action:"response",fetcher:r,error:e,request:i,provider:o}),n(e);if(o.emit("debug",{action:"response",fetcher:r,request:i,response:a,provider:o}),a.error){var u=new Error(a.error.message);return u.code=a.error.code,u.data=a.error.data,n(u)}t(a.result)}))}))}}var qh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mh(t,e)}(i,t);var e,r,n,o=Bh(i);function i(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),null==t&&zh.throwArgumentError("missing provider","provider",t);var n=null,a=null,u=null;return"function"==typeof t?(n="unknown:",a=t):(!(n=t.host||t.path||"")&&t.isMetaMask&&(n="metamask"),u=t,t.request?(""===n&&(n="eip-1193:"),a=function(t){return function(e,r){var n=this;null==r&&(r=[]);var o={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:B(o),provider:this}),t.request(o).then((function(t){return n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:o,response:t,provider:n}),t}),(function(t){throw n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:o,error:t,provider:n}),t}))}}(t)):t.sendAsync?a=Hh(0,t.sendAsync.bind(t)):t.send?a=Hh(0,t.send.bind(t)):zh.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),T(Dh(r=o.call(this,n,e)),"jsonRpcFetchFunc",a),T(Dh(r),"provider",u),r}return e=i,(r=[{key:"send",value:function(t,e){return this.jsonRpcFetchFunc(t,e)}}])&&Ch(e.prototype,r),n&&Ch(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Uc),Kh=new h.b("providers/5.7.2");function Wh(t,e){if(null==t&&(t="homestead"),"string"==typeof t){var r=t.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new Uc(t);case"ws":case"wss":return new rl(t);default:Kh.throwArgumentError("unsupported URL scheme","network",t)}}var n=Nu(t);return n&&n._defaultProvider||Kh.throwError("unsupported getDefaultProvider network",h.b.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),n._defaultProvider({FallbackProvider:Wf,AlchemyProvider:Il,AnkrProvider:ql,CloudflareProvider:nf,EtherscanProvider:kf,InfuraProvider:uh,JsonRpcProvider:Uc,NodesmithProvider:xh,PocketProvider:Ih,Web3Provider:qh,IpcProvider:Qf},e)}var Qh=new RegExp("^bytes([0-9]+)$"),Vh=new RegExp("^(u?int)([0-9]*)$"),Jh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Yh=new h.b("solidity/5.7.0");function Zh(t,e){t.length!=e.length&&Yh.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);var r=[];return t.forEach((function(t,n){r.push(function t(e,r,n){switch(e){case"address":return n?Object(c.p)(r,32):Object(c.a)(r);case"string":return Et(r);case"bytes":return Object(c.a)(r);case"bool":return r=r?"0x01":"0x00",n?Object(c.p)(r,32):Object(c.a)(r)}var o=e.match(Vh);if(o){var i=parseInt(o[2]||"256");return(o[2]&&String(i)!==o[2]||i%8!=0||0===i||i>256)&&Yh.throwArgumentError("invalid number type","type",e),n&&(i=256),r=b.from(r).toTwos(i),Object(c.p)(r,i/8)}if(o=e.match(Qh)){var a=parseInt(o[1]);return(String(a)!==o[1]||0===a||a>32)&&Yh.throwArgumentError("invalid bytes type","type",e),Object(c.a)(r).byteLength!==a&&Yh.throwArgumentError("invalid value for ".concat(e),"value",r),n?Object(c.a)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((o=e.match(Jh))&&Array.isArray(r)){var u=o[1];parseInt(o[2]||String(r.length))!=r.length&&Yh.throwArgumentError("invalid array length for ".concat(e),"value",r);var s=[];return r.forEach((function(e){s.push(t(u,e,!0))})),Object(c.b)(s)}return Yh.throwArgumentError("invalid type","type",e)}(t,e[n]))})),Object(c.i)(Object(c.b)(r))}function Xh(t,e){return Y(Zh(t,e))}function $h(t,e){return zi(Zh(t,e))}function tp(t,e){e||(e=function(t){return[parseInt(t,16)]});var r=0,n={};return t.split(",").forEach((function(t){var o=t.split(":");r+=parseInt(o[0],16),n[r]=e(o[1])})),n}function ep(t){var e=0;return t.split(",").map((function(t){var r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}}))}function rp(t,e){for(var r=0,n=0;n<e.length;n++){var o=e[n];if(t>=(r+=o.l)&&t<=r+o.h&&(t-r)%(o.d||1)==0){if(o.e&&-1!==o.e.indexOf(t-r))continue;return o}}return null}var np=ep("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),op="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(t){return parseInt(t,16)})),ip=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],ap=tp("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),up=tp("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),sp=tp("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");for(var e=[],r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e})),cp=ep("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function lp(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();var e,r=Pt(t);e=r.map((function(t){if(op.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];var e=function(t){var e=rp(t,ip);if(e)return[t+e.s];var r=ap[t];if(r)return r;var n=up[t];if(n)return[t+n[0]];var o=sp[t];return o||null}(t);return e||[t]})),(r=Pt(Ot(r=e.reduce((function(t,e){return e.forEach((function(e){t.push(e)})),t}),[])),mt.NFKC)).forEach((function(t){if(rp(t,cp))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(t){if(rp(t,np))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=Ot(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}function fp(t){var e=Et(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(c.i)(Object(c.b)([e,Eu]).slice(0,32))}function hp(t){var e=Object(c.a)(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return St(e.slice(0,r))}var pp=new h.b("units/5.7.0"),dp=["wei","kwei","mwei","gwei","szabo","finney","ether"];function vp(t){var e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&pp.throwArgumentError("invalid value","value",t);var r=e[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var o="";for(2===e.length&&(o="."+(e[1]||"0"));o.length>2&&"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(var i=[];r.length;){if(r.length<=3){i.unshift(r);break}var a=r.length-3;i.unshift(r.substring(a)),r=r.substring(0,a)}return n+i.join(",")+o}function yp(t,e){if("string"==typeof e){var r=dp.indexOf(e);-1!==r&&(e=3*r)}return ai(t,null!=e?e:18)}function mp(t,e){if("string"!=typeof t&&pp.throwArgumentError("value must be a string","value",t),"string"==typeof e){var r=dp.indexOf(e);-1!==r&&(e=3*r)}return ui(t,null!=e?e:18)}function gp(t){return yp(t,18)}function bp(t){return mp(t,18)}var wp="ethers/5.7.2",_p=new h.b(wp);try{var kp=window;null==kp._ethers&&(kp._ethers=s)}catch(t){}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return c}));var n=r(0),o=r(1),i=r(36),a=new o.b(i.a);var u=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")}(),s=u.crypto||u.msCrypto;function c(t){(t<=0||t>1024||t%1||t!=t)&&a.throwArgumentError("invalid length","length",t);var e=new Uint8Array(t);return s.getRandomValues(e),Object(n.a)(e)}s&&s.getRandomValues||(a.warn("WARNING: Missing strong random number source"),s={getRandomValues:function(t){return a.throwError("no secure random source avaialble",o.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(8))}])}));
|