Skip to content

Instantly share code, notes, and snippets.

@cloggo
Last active September 13, 2021 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloggo/8f1b16ef2bdcfd663e587dba11f2d116 to your computer and use it in GitHub Desktop.
Save cloggo/8f1b16ef2bdcfd663e587dba11f2d116 to your computer and use it in GitHub Desktop.
Create covalent signature payload
// In html,
// <script src="http://path-to-/covalent-js-sign.js"></script>
// To create the payload to that include the challenge data and the signature in base64,
const privateKey = "59e96b740f0af54f2d4335ddd033816fa24348b4097d3fddad4f6edc939f52e9";
const walletAddress = "0x71d094E5382CA33B25B92d3A75d5C6f269A78fAe";
const chainId = "1"; // default is "1"
// browser
const payload = covalent.createSignaturePayloadB64(privateKey, walletAddress, chainId);
/*! For license information please see lib.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.covalent=e():t.covalent=e()}(this,(function(){return(()=>{var t={7228:t=>{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.default=t.exports,t.exports.__esModule=!0},3646:(t,e,r)=>{var n=r(7228);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},1506:t=>{t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},4575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},3913: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,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},9713:t=>{t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},9754:t=>{function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,e(r)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},2205:(t,e,r)=>{var n=r(9489);t.exports=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}}),e&&n(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},5318:t=>{t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},6860:t=>{t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},8206:t=>{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.default=t.exports,t.exports.__esModule=!0},693:(t,e,r)=>{var n=r(9713);t.exports=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?Object(arguments[e]):{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),i.forEach((function(e){n(t,e,r[e])}))}return t},t.exports.default=t.exports,t.exports.__esModule=!0},8585:(t,e,r)=>{var n=r(8).default,i=r(1506);t.exports=function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)},t.exports.default=t.exports,t.exports.__esModule=!0},9489:t=>{function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,e(r,n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},319:(t,e,r)=>{var n=r(3646),i=r(6860),o=r(379),s=r(8206);t.exports=function(t){return n(t)||i(t)||o(t)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},8:t=>{function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(r)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},379:(t,e,r)=>{var n=r(7228);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.default=t.exports,t.exports.__esModule=!0},4083:function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.chains=e._getInitializedChains=void 0;var o=i(r(7180)),s=i(r(1227)),a=i(r(439)),u=i(r(7098)),f=i(r(7687)),h=i(r(8531));function c(t){var e,r,i={1:"mainnet",3:"ropsten",4:"rinkeby",42:"kovan",5:"goerli",123:"calaveras"},c={mainnet:o.default,ropsten:s.default,rinkeby:a.default,kovan:u.default,goerli:f.default,calaveras:h.default};if(t)try{for(var l=n(t),d=l.next();!d.done;d=l.next()){var p=d.value,m=p.name;i[p.chainId.toString()]=m,c[m]=p}}catch(t){e={error:t}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(e)throw e.error}}return c.names=i,c}e._getInitializedChains=c,e.chains=c()},7616:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EIPs=void 0,e.EIPs={1559:r(7523),2315:r(3339),2537:r(6769),2565:r(7897),2718:r(2170),2929:r(8436),2930:r(6213),3198:r(5491),3529:r(70),3541:r(1871),3554:r(7225)}},7459:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hardforks=void 0,e.hardforks=[["chainstart",r(114)],["homestead",r(2800)],["dao",r(7197)],["tangerineWhistle",r(2302)],["spuriousDragon",r(716)],["byzantium",r(6985)],["constantinople",r(5993)],["petersburg",r(4064)],["istanbul",r(3166)],["muirGlacier",r(2946)],["berlin",r(15)],["london",r(1250)]]},2832:function(t,e,r){"use strict";var n,i=r(8764).Buffer,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Hardfork=e.Chain=e.CustomChain=void 0;var u,f,h,c=r(7187),l=r(4606),d=r(4370),p=r(4083),m=r(7459),g=r(7616);!function(t){t.PolygonMainnet="polygon-mainnet",t.PolygonMumbai="polygon-mumbai",t.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",t.xDaiChain="x-dai-chain"}(u=e.CustomChain||(e.CustomChain={})),(h=e.Chain||(e.Chain={}))[h.Mainnet=1]="Mainnet",h[h.Ropsten=3]="Ropsten",h[h.Rinkeby=4]="Rinkeby",h[h.Kovan=42]="Kovan",h[h.Goerli=5]="Goerli",h[h.Calaveras=123]="Calaveras",function(t){t.Chainstart="chainstart",t.Homestead="homestead",t.Dao="dao",t.TangerineWhistle="tangerineWhistle",t.SpuriousDragon="spuriousDragon",t.Byzantium="byzantium",t.Constantinople="constantinople",t.Petersburg="petersburg",t.Istanbul="istanbul",t.MuirGlacier="muirGlacier",t.Berlin="berlin",t.London="london"}(f=e.Hardfork||(e.Hardfork={}));var y=function(t){function e(e){var r,n,i=t.call(this)||this;return i._supportedHardforks=[],i._eips=[],i._customChains=null!==(r=e.customChains)&&void 0!==r?r:[],i._chainParams=i.setChain(e.chain),i.DEFAULT_HARDFORK=null!==(n=i._chainParams.defaultHardfork)&&void 0!==n?n:f.Istanbul,i._hardfork=i.DEFAULT_HARDFORK,e.supportedHardforks&&(i._supportedHardforks=e.supportedHardforks),e.hardfork&&i.setHardfork(e.hardfork),e.eips&&i.setEIPs(e.eips),i}return o(e,t),e.custom=function(t,r){var n;void 0===r&&(r={});var i=null!==(n=r.baseChain)&&void 0!==n?n:"mainnet",o=s({},e._getChainParams(i));if(o.name="custom-chain","string"!=typeof t)return new e(s({chain:s(s({},o),t)},r));if(t===u.PolygonMainnet)return e.custom({name:u.PolygonMainnet,chainId:137,networkId:137});if(t===u.PolygonMumbai)return e.custom({name:u.PolygonMumbai,chainId:80001,networkId:80001});if(t===u.ArbitrumRinkebyTestnet)return e.custom({name:u.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611});if(t===u.xDaiChain)return e.custom({name:u.xDaiChain,chainId:100,networkId:100});throw new Error("Custom chain "+t+" not supported")},e.forCustomChain=function(t,r,n,i){var o=e._getChainParams(t);return new e({chain:s(s({},o),r),hardfork:n,supportedHardforks:i})},e.isSupportedChainId=function(t){var e=p._getInitializedChains();return Boolean(e.names[t.toString()])},e._getChainParams=function(t,e){var r=p._getInitializedChains(e);if("number"==typeof t||d.BN.isBN(t)){if(t=t.toString(),r.names[t])return r[r.names[t]];throw new Error("Chain with ID "+t+" not supported")}if(r[t])return r[t];throw new Error("Chain with name "+t+" not supported")},e.prototype.setChain=function(t){var r,n;if("number"==typeof t||"string"==typeof t||d.BN.isBN(t))this._chainParams=e._getChainParams(t,this._customChains);else{if("object"!=typeof t)throw new Error("Wrong input format");if(this._customChains.length>0)throw new Error("Chain must be a string, number, or BN when initialized with customChains passed in");try{for(var i=a(["networkId","genesis","hardforks","bootstrapNodes"]),o=i.next();!o.done;o=i.next()){var s=o.value;if(void 0===t[s])throw new Error("Missing required chain parameter: "+s)}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}this._chainParams=t}return this._chainParams},e.prototype.setHardfork=function(t){var e,r;if(!this._isSupportedHardfork(t))throw new Error("Hardfork "+t+" not set as supported in supportedHardforks");var n=!1;try{for(var i=a(m.hardforks),o=i.next();!o.done;o=i.next())o.value[0]===t&&(this._hardfork!==t&&(this._hardfork=t,this.emit("hardforkChanged",t)),n=!0)}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}if(!n)throw new Error("Hardfork with name "+t+" not supported")},e.prototype.getHardforkByBlockNumber=function(t){var e,r;t=d.toType(t,d.TypeOutput.BN);var n=f.Chainstart;try{for(var i=a(this.hardforks()),o=i.next();!o.done;o=i.next()){var s=o.value;null!==s.block&&t.gte(new d.BN(s.block))&&(n=s.name)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n},e.prototype.setHardforkByBlockNumber=function(t){t=d.toType(t,d.TypeOutput.BN);var e=this.getHardforkByBlockNumber(t);return this.setHardfork(e),e},e.prototype._chooseHardfork=function(t,e){if(void 0===e&&(e=!0),t){if(e&&!this._isSupportedHardfork(t))throw new Error("Hardfork "+t+" not set as supported in supportedHardforks")}else t=this._hardfork;return t},e.prototype._getHardfork=function(t){var e,r,n=this.hardforks();try{for(var i=a(n),o=i.next();!o.done;o=i.next()){var s=o.value;if(s.name===t)return s}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}throw new Error("Hardfork "+t+" not defined for chain "+this.chainName())},e.prototype._isSupportedHardfork=function(t){var e,r;if(!(this._supportedHardforks.length>0))return!0;try{for(var n=a(this._supportedHardforks),i=n.next();!i.done;i=n.next())if(t===i.value)return!0}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return!1},e.prototype.setEIPs=function(t){var e,r,n=this;void 0===t&&(t=[]);var i=function(e){if(!(e in g.EIPs))throw new Error(e+" not supported");var r=o.gteHardfork(g.EIPs[e].minimumHardfork);if(!r)throw new Error(e+" cannot be activated on hardfork "+o.hardfork()+", minimumHardfork: "+r);g.EIPs[e].requiredEIPs&&g.EIPs[e].requiredEIPs.forEach((function(r){if(!t.includes(r)&&!n.isActivatedEIP(r))throw new Error(e+" requires EIP "+r+", but is not included in the EIP list")}))},o=this;try{for(var s=a(t),u=s.next();!u.done;u=s.next())i(u.value)}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}this._eips=t},e.prototype.param=function(t,e){var r,n,i=null;try{for(var o=a(this._eips),s=o.next();!s.done;s=o.next()){var u=s.value;if(null!==(i=this.paramByEIP(t,e,u)))return i}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return this.paramByHardfork(t,e,this._hardfork)},e.prototype.paramByHardfork=function(t,e,r){var n,i,o,s;r=this._chooseHardfork(r);var u=null;try{for(var f=a(m.hardforks),h=f.next();!h.done;h=f.next()){var c=h.value;if(c[1].hasOwnProperty("eips")){var l=c[1].eips;try{for(var d=(o=void 0,a(l)),p=d.next();!p.done;p=d.next()){var g=p.value,y=this.paramByEIP(t,e,g);u=null!==y?y:u}}catch(t){o={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}}else{if(!c[1][t])throw new Error("Topic "+t+" not defined");void 0!==c[1][t][e]&&(u=c[1][t][e].v)}if(c[0]===r)break}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return u},e.prototype.paramByEIP=function(t,e,r){if(!(r in g.EIPs))throw new Error(r+" not supported");var n=g.EIPs[r];if(!(t in n))throw new Error("Topic "+t+" not defined");return void 0===n[t][e]?null:n[t][e].v},e.prototype.paramByBlock=function(t,e,r){var n=this.activeHardforks(r),i=n[n.length-1].name;return this.paramByHardfork(t,e,i)},e.prototype.isActivatedEIP=function(t){var e,r;if(this.eips().includes(t))return!0;try{for(var n=a(m.hardforks),i=n.next();!i.done;i=n.next()){var o=i.value[1];if(this.gteHardfork(o.name)&&"eips"in o&&o.eips.includes(t))return!0}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return!1},e.prototype.hardforkIsActiveOnBlock=function(t,e,r){var n;void 0===r&&(r={}),e=d.toType(e,d.TypeOutput.BN);var i=null!==(n=r.onlySupported)&&void 0!==n&&n;t=this._chooseHardfork(t,i);var o=this.hardforkBlockBN(t);return!(!o||!e.gte(o))},e.prototype.activeOnBlock=function(t,e){return this.hardforkIsActiveOnBlock(null,t,e)},e.prototype.hardforkGteHardfork=function(t,e,r){var n,i;void 0===r&&(r={});var o,s=void 0!==r.onlyActive&&r.onlyActive;t=this._chooseHardfork(t,r.onlySupported),o=s?this.activeHardforks(null,r):this.hardforks();var u=-1,f=-1,h=0;try{for(var c=a(o),l=c.next();!l.done;l=c.next()){var d=l.value;d.name===t&&(u=h),d.name===e&&(f=h),h+=1}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return u>=f&&-1!==f},e.prototype.gteHardfork=function(t,e){return this.hardforkGteHardfork(null,t,e)},e.prototype.hardforkIsActiveOnChain=function(t,e){var r,n,i;void 0===e&&(e={});var o=null!==(i=e.onlySupported)&&void 0!==i&&i;t=this._chooseHardfork(t,o);try{for(var s=a(this.hardforks()),u=s.next();!u.done;u=s.next()){var f=u.value;if(f.name===t&&null!==f.block)return!0}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.activeHardforks=function(t,e){var r,n;void 0===e&&(e={});var i=[],o=this.hardforks();try{for(var s=a(o),u=s.next();!u.done;u=s.next()){var f=u.value;if(null!==f.block){if(null!=t&&t<f.block)break;e.onlySupported&&!this._isSupportedHardfork(f.name)||i.push(f)}}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},e.prototype.activeHardfork=function(t,e){void 0===e&&(e={});var r=this.activeHardforks(t,e);if(r.length>0)return r[r.length-1].name;throw new Error("No (supported) active hardfork found")},e.prototype.hardforkBlock=function(t){return d.toType(this.hardforkBlockBN(t),d.TypeOutput.Number)},e.prototype.hardforkBlockBN=function(t){return t=this._chooseHardfork(t,!1),new d.BN(this._getHardfork(t).block)},e.prototype.isHardforkBlock=function(t,e){return t=d.toType(t,d.TypeOutput.BN),e=this._chooseHardfork(e,!1),this.hardforkBlockBN(e).eq(t)},e.prototype.nextHardforkBlock=function(t){var e=this.nextHardforkBlockBN(t);return null===e?null:d.toType(e,d.TypeOutput.Number)},e.prototype.nextHardforkBlockBN=function(t){t=this._chooseHardfork(t,!1);var e=this.hardforkBlockBN(t);return this.hardforks().reduce((function(t,r){var n=new d.BN(r.block);return n.gt(e)&&null===t?n:t}),null)},e.prototype.isNextHardforkBlock=function(t,e){t=d.toType(t,d.TypeOutput.BN),e=this._chooseHardfork(e,!1);var r=this.nextHardforkBlockBN(e);return null!==r&&r.eq(t)},e.prototype._calcForkHash=function(t){var e,r,n=i.from(this.genesis().hash.substr(2),"hex"),o=i.alloc(0),s=0;try{for(var u=a(this.hardforks()),f=u.next();!f.done;f=u.next()){var h=f.value,c=h.block;if(0!==c&&null!==c&&c!==s){var p=i.from(c.toString(16).padStart(16,"0"),"hex");o=i.concat([o,p])}if(h.name===t)break;s=c}}catch(t){e={error:t}}finally{try{f&&!f.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}var m=i.concat([n,o]);return"0x"+d.intToBuffer(l.buf(m)>>>0).toString("hex")},e.prototype.forkHash=function(t){t=this._chooseHardfork(t,!1);var e=this._getHardfork(t);if(null===e.block)throw new Error("No fork hash calculation possible for non-applied or future hardfork");return void 0!==e.forkHash?e.forkHash:this._calcForkHash(t)},e.prototype.hardforkForForkHash=function(t){var e=this.hardforks().filter((function(e){return e.forkHash===t}));return e.length>=1?e[e.length-1]:null},e.prototype.genesis=function(){return this._chainParams.genesis},e.prototype.hardforks=function(){return this._chainParams.hardforks},e.prototype.bootstrapNodes=function(){return this._chainParams.bootstrapNodes},e.prototype.dnsNetworks=function(){return this._chainParams.dnsNetworks},e.prototype.hardfork=function(){return this._hardfork},e.prototype.chainId=function(){return d.toType(this.chainIdBN(),d.TypeOutput.Number)},e.prototype.chainIdBN=function(){return new d.BN(this._chainParams.chainId)},e.prototype.chainName=function(){return this._chainParams.name},e.prototype.networkId=function(){return d.toType(this.networkIdBN(),d.TypeOutput.Number)},e.prototype.networkIdBN=function(){return new d.BN(this._chainParams.networkId)},e.prototype.eips=function(){return this._eips},e.prototype.consensusType=function(){return this._chainParams.consensus.type},e.prototype.consensusAlgorithm=function(){return this._chainParams.consensus.algorithm},e.prototype.consensusConfig=function(){return this._chainParams.consensus[this.consensusAlgorithm()]},e.prototype.copy=function(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)},e}(c.EventEmitter);e.default=y},3864:function(t,e,r){!function(t,e){"use strict";function n(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 o(t,e,r){if(o.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 s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2859).Buffer}catch(t){}function a(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 n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function f(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var f=t.charCodeAt(u)-48;o*=i,s=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&s<i,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(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 i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.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},o.prototype._move=function(t){h(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){o.prototype.inspect=c}else o.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,l=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=l;d++){var p=f-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.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 f=d[t],h=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var m=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?m+r:l[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var 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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.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},o.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},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.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},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(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()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.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()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.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()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.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 i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(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)},o.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,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,l=h>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,_=0|s[4],E=8191&_,S=_>>>13,A=0|s[5],x=8191&A,k=A>>>13,B=0|s[6],P=8191&B,I=B>>>13,O=0|s[7],T=8191&O,R=O>>>13,N=0|s[8],L=8191&N,C=N>>>13,j=0|s[9],D=8191&j,U=j>>>13,z=0|a[0],F=8191&z,H=z>>>13,q=0|a[1],K=8191&q,G=q>>>13,V=0|a[2],Z=8191&V,W=V>>>13,J=0|a[3],$=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,lt=ht>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(f+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,H))+Math.imul(l,F)|0))<<13)|0;f=((o=Math.imul(l,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,H))+Math.imul(m,F)|0,o=Math.imul(m,H);var yt=(f+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,K)|0))<<13)|0;f=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,H))+Math.imul(b,F)|0,o=Math.imul(b,H),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var bt=(f+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;f=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,H))+Math.imul(M,F)|0,o=Math.imul(M,H),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var vt=(f+(n=n+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,$)|0))<<13)|0;f=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,H))+Math.imul(S,F)|0,o=Math.imul(S,H),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,X)|0;var wt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;f=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,H))+Math.imul(k,F)|0,o=Math.imul(k,H),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;f=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,H))+Math.imul(I,F)|0,o=Math.imul(I,H),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;f=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,H))+Math.imul(R,F)|0,o=Math.imul(R,H),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(l,ut)|0))<<13)|0;f=((o=o+Math.imul(l,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,H))+Math.imul(C,F)|0,o=Math.imul(C,H),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0;var St=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;f=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,H))+Math.imul(U,F)|0,o=Math.imul(U,H),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var At=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;f=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,lt)|0;var xt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,W))+Math.imul(U,Z)|0,o=Math.imul(U,W),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ft)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var kt=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,X))+Math.imul(U,$)|0,o=Math.imul(U,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,lt)|0;var Bt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,lt)|0;var Pt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;f=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Ot=(f+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ft))+Math.imul(U,ut)|0,o=Math.imul(U,ft),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Tt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,lt))+Math.imul(U,ct)|0,o=Math.imul(U,lt);var Rt=(f+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(f+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return f=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=Et,u[8]=St,u[9]=At,u[10]=xt,u[11]=kt,u[12]=Bt,u[13]=Pt,u[14]=It,u[15]=Ot,u[16]=Tt,u[17]=Rt,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(t,e,r){return y(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):b(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,l=f,d=0;d<s;d++){var p=r[h+d],m=n[h+d],g=r[h+d+s],y=n[h+d+s],b=c*g-l*y;y=c*y+l*g,g=b,r[h+d]=p+g,n[h+d]=m+y,r[h+d+s]=p-g,n[h+d+s]=m-y,d!==a&&(b=u*c-f*l,l=u*l+f*c,c=b)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.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,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(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 i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(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)},o.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},o.prototype.isubn=function(t){if(n("number"==typeof t),n(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.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),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.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 i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.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],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.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},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},i(_,M),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.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(E,M),i(S,M),i(A,M),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return w[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(c,new o(1).iushln(p-g-1));l=l.redMul(y),c=y.redSqr(),d=d.redMul(c),p=g}return l},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},1297:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;var f=u(r(9282)),h=u(r(3864)),c=s(r(6636)),l=r(5053),d=r(884),p=r(1797),m=r(215),g=r(9529),y=r(6350),b=r(5309),v=function(){function t(t,e,r,n){void 0===t&&(t=new h.default(0)),void 0===e&&(e=new h.default(0)),void 0===r&&(r=p.KECCAK256_RLP),void 0===n&&(n=p.KECCAK256_NULL),this.nonce=t,this.balance=e,this.stateRoot=r,this.codeHash=n,this._validate()}return t.fromAccountData=function(e){var r=e.nonce,n=e.balance,i=e.stateRoot,o=e.codeHash;return new t(r?new h.default(m.toBuffer(r)):void 0,n?new h.default(m.toBuffer(n)):void 0,i?m.toBuffer(i):void 0,o?m.toBuffer(o):void 0)},t.fromRlpSerializedAccount=function(t){var e=c.decode(t);if(!Array.isArray(e))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(e)},t.fromValuesArray=function(e){var r=a(e,4),n=r[0],i=r[1],o=r[2],s=r[3];return new t(new h.default(n),new h.default(i),o,s)},t.prototype._validate=function(){if(this.nonce.lt(new h.default(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new h.default(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},t.prototype.raw=function(){return[b.bnToUnpaddedBuffer(this.nonce),b.bnToUnpaddedBuffer(this.balance),this.stateRoot,this.codeHash]},t.prototype.serialize=function(){return c.encode(this.raw())},t.prototype.isContract=function(){return!this.codeHash.equals(p.KECCAK256_NULL)},t.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(p.KECCAK256_NULL)},t}();e.Account=v,e.isValidAddress=function(t){try{y.assertIsString(t)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(t)},e.toChecksumAddress=function(t,e){y.assertIsHexString(t);var r=d.stripHexPrefix(t).toLowerCase(),n="";e&&(n=b.toType(e,b.TypeOutput.BN).toString()+"0x");for(var i=g.keccakFromString(n+r).toString("hex"),o="0x",s=0;s<r.length;s++)parseInt(i[s],16)>=8?o+=r[s].toUpperCase():o+=r[s];return o},e.isValidChecksumAddress=function(t,r){return e.isValidAddress(t)&&e.toChecksumAddress(t,r)===t},e.generateAddress=function(t,e){y.assertIsBuffer(t),y.assertIsBuffer(e);var r=new h.default(e);return r.isZero()?g.rlphash([t,null]).slice(-20):g.rlphash([t,n.from(r.toArray())]).slice(-20)},e.generateAddress2=function(t,e,r){return y.assertIsBuffer(t),y.assertIsBuffer(e),y.assertIsBuffer(r),f.default(20===t.length),f.default(32===e.length),g.keccak256(n.concat([n.from("ff","hex"),t,e,g.keccak256(r)])).slice(-20)},e.isValidPrivate=function(t){return l.privateKeyVerify(t)},e.isValidPublic=function(t,e){return void 0===e&&(e=!1),y.assertIsBuffer(t),64===t.length?l.publicKeyVerify(n.concat([n.from([4]),t])):!!e&&l.publicKeyVerify(t)},e.pubToAddress=function(t,e){return void 0===e&&(e=!1),y.assertIsBuffer(t),e&&64!==t.length&&(t=n.from(l.publicKeyConvert(t,!1).slice(1))),f.default(64===t.length),g.keccak(t).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToPublic=function(t){return y.assertIsBuffer(t),n.from(l.publicKeyCreate(t,!1)).slice(1)},e.privateToAddress=function(t){return e.publicToAddress(e.privateToPublic(t))},e.importPublic=function(t){return y.assertIsBuffer(t),64!==t.length&&(t=n.from(l.publicKeyConvert(t,!1).slice(1))),t},e.zeroAddress=function(){var t=m.zeros(20);return m.bufferToHex(t)},e.isZeroAddress=function(t){try{y.assertIsString(t)}catch(t){return!1}return e.zeroAddress()===t}},9380:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Address=void 0;var o=i(r(9282)),s=i(r(3864)),a=r(215),u=r(1297),f=function(){function t(t){o.default(20===t.length,"Invalid address length"),this.buf=t}return t.zero=function(){return new t(a.zeros(20))},t.fromString=function(e){return o.default(u.isValidAddress(e),"Invalid address"),new t(a.toBuffer(e))},t.fromPublicKey=function(e){return o.default(n.isBuffer(e),"Public key should be Buffer"),new t(u.pubToAddress(e))},t.fromPrivateKey=function(e){return o.default(n.isBuffer(e),"Private key should be Buffer"),new t(u.privateToAddress(e))},t.generate=function(e,r){return o.default(s.default.isBN(r)),new t(u.generateAddress(e.buf,r.toArrayLike(n)))},t.generate2=function(e,r,i){return o.default(n.isBuffer(r)),o.default(n.isBuffer(i)),new t(u.generateAddress2(e.buf,r,i))},t.prototype.equals=function(t){return this.buf.equals(t.buf)},t.prototype.isZero=function(){return this.equals(t.zero())},t.prototype.isPrecompileOrSystemAddress=function(){var t=new s.default(this.buf),e=new s.default(0),r=new s.default("ffff","hex");return t.gte(e)&&t.lte(r)},t.prototype.toString=function(){return"0x"+this.buf.toString("hex")},t.prototype.toBuffer=function(){return n.from(this.buf)},t}();e.Address=f},215:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.baToJSON=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=void 0;var o=i(r(3864)),s=r(884),a=r(6350);e.zeros=function(t){return n.allocUnsafe(t).fill(0)};var u=function(t,r,n){var i=e.zeros(r);return n?t.length<r?(t.copy(i),i):t.slice(0,r):t.length<r?(t.copy(i,r-t.length),i):t.slice(-r)};e.setLengthLeft=function(t,e){return a.assertIsBuffer(t),u(t,e,!1)},e.setLengthRight=function(t,e){return a.assertIsBuffer(t),u(t,e,!0)};var f=function(t){for(var e=t[0];t.length>0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t};e.unpadBuffer=function(t){return a.assertIsBuffer(t),f(t)},e.unpadArray=function(t){return a.assertIsArray(t),f(t)},e.unpadHexString=function(t){return a.assertIsHexString(t),t=s.stripHexPrefix(t),f(t)},e.toBuffer=function(t){if(null==t)return n.allocUnsafe(0);if(n.isBuffer(t))return n.from(t);if(Array.isArray(t)||t instanceof Uint8Array)return n.from(t);if("string"==typeof t){if(!s.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);return n.from(s.padToEven(s.stripHexPrefix(t)),"hex")}if("number"==typeof t)return s.intToBuffer(t);if(o.default.isBN(t))return t.toArrayLike(n);if(t.toArray)return n.from(t.toArray());if(t.toBuffer)return n.from(t.toBuffer());throw new Error("invalid type")},e.bufferToInt=function(t){return new o.default(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new o.default(t).fromTwos(256)},e.toUnsigned=function(t){return n.from(t.toTwos(256).toArray())},e.addHexPrefix=function(t){return"string"!=typeof t||s.isHexPrefixed(t)?t:"0x"+t},e.baToJSON=function(t){if(n.isBuffer(t))return"0x"+t.toString("hex");if(t instanceof Array){for(var r=[],i=0;i<t.length;i++)r.push(e.baToJSON(t[i]));return r}}},1797:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.MAX_INTEGER=void 0;var i=r(8764).Buffer,o=n(r(3864));e.MAX_INTEGER=new o.default("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new o.default("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=i.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=i.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=i.from(e.KECCAK256_RLP_S,"hex")},7231:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.rlp=e.BN=void 0;var a=s(r(3864));e.BN=a.default;var u=o(r(6636));e.rlp=u},9529:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.rlphash=e.ripemd160FromArray=e.ripemd160FromString=e.ripemd160=e.sha256FromArray=e.sha256FromString=e.sha256=e.keccakFromArray=e.keccakFromHexString=e.keccakFromString=e.keccak256=e.keccak=void 0;var a=r(2192),u=r(3482),f=s(r(6636)),h=r(215),c=r(6350);e.keccak=function(t,e){switch(void 0===e&&(e=256),c.assertIsBuffer(t),e){case 224:return a.keccak224(t);case 256:return a.keccak256(t);case 384:return a.keccak384(t);case 512:return a.keccak512(t);default:throw new Error("Invald algorithm: keccak"+e)}},e.keccak256=function(t){return e.keccak(t)},e.keccakFromString=function(t,r){void 0===r&&(r=256),c.assertIsString(t);var i=n.from(t,"utf8");return e.keccak(i,r)},e.keccakFromHexString=function(t,r){return void 0===r&&(r=256),c.assertIsHexString(t),e.keccak(h.toBuffer(t),r)},e.keccakFromArray=function(t,r){return void 0===r&&(r=256),c.assertIsArray(t),e.keccak(h.toBuffer(t),r)};var l=function(t){return t=h.toBuffer(t),u("sha256").update(t).digest()};e.sha256=function(t){return c.assertIsBuffer(t),l(t)},e.sha256FromString=function(t){return c.assertIsString(t),l(t)},e.sha256FromArray=function(t){return c.assertIsArray(t),l(t)};var d=function(t,e){t=h.toBuffer(t);var r=u("rmd160").update(t).digest();return!0===e?h.setLengthLeft(r,32):r};e.ripemd160=function(t,e){return c.assertIsBuffer(t),d(t,e)},e.ripemd160FromString=function(t,e){return c.assertIsString(t),d(t,e)},e.ripemd160FromArray=function(t,e){return c.assertIsArray(t),d(t,e)},e.rlphash=function(t){return e.keccak(f.encode(t))}},6350:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.assertIsString=e.assertIsArray=e.assertIsBuffer=e.assertIsHexString=void 0;var i=r(884);e.assertIsHexString=function(t){if(!i.isHexString(t))throw new Error("This method only supports 0x-prefixed hex strings but input was: "+t)},e.assertIsBuffer=function(t){if(!n.isBuffer(t))throw new Error("This method only supports Buffer but input was: "+t)},e.assertIsArray=function(t){if(!Array.isArray(t))throw new Error("This method only supports number arrays but input was: "+t)},e.assertIsString=function(t){if("string"!=typeof t)throw new Error("This method only supports strings but input was: "+t)}},4370:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(1797),e),i(r(1297),e),i(r(9380),e),i(r(9529),e),i(r(1612),e),i(r(215),e),i(r(499),e),i(r(7231),e),i(r(5309),e),i(r(884),e)},499:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.defineProperties=void 0;var u=a(r(9282)),f=s(r(884)),h=s(r(6636)),c=r(215);e.defineProperties=function(t,e,r){if(t.raw=[],t._fields=[],t.toJSON=function(e){if(void 0===e&&(e=!1),e){var r={};return t._fields.forEach((function(e){r[e]="0x"+t[e].toString("hex")})),r}return c.baToJSON(t.raw)},t.serialize=function(){return h.encode(t.raw)},e.forEach((function(e,r){function i(){return t.raw[r]}function o(i){"00"!==(i=c.toBuffer(i)).toString("hex")||e.allowZero||(i=n.allocUnsafe(0)),e.allowLess&&e.length?(i=c.unpadBuffer(i),u.default(e.length>=i.length,"The field "+e.name+" must not have more "+e.length+" bytes")):e.allowZero&&0===i.length||!e.length||u.default(e.length===i.length,"The field "+e.name+" must have byte length of "+e.length),t.raw[r]=i}t._fields.push(e.name),Object.defineProperty(t,e.name,{enumerable:!0,configurable:!0,get:i,set:o}),e.default&&(t[e.name]=e.default),e.alias&&Object.defineProperty(t,e.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),r)if("string"==typeof r&&(r=n.from(f.stripHexPrefix(r),"hex")),n.isBuffer(r)&&(r=h.decode(r)),Array.isArray(r)){if(r.length>t._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(e,r){t[t._fields[r]]=c.toBuffer(e)}))}else{if("object"!=typeof r)throw new Error("invalid data");var i=Object.keys(r);e.forEach((function(e){-1!==i.indexOf(e.name)&&(t[e.name]=r[e.name]),-1!==i.indexOf(e.alias)&&(t[e.alias]=r[e.alias])}))}}},1612:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toCompactSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;var o=r(5053),s=i(r(3864)),a=r(215),u=r(9529),f=r(6350),h=r(5309);function c(t,e){var r=h.toType(t,h.TypeOutput.BN);if(!e)return r.subn(27);var n=h.toType(e,h.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function l(t){var e=new s.default(t);return e.eqn(0)||e.eqn(1)}e.ecsign=function(t,e,r){var i=o.ecdsaSign(t,e),s=i.signature,a=i.recid,u=n.from(s.slice(0,32)),f=n.from(s.slice(32,64));if(!r||"number"==typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:u,s:f,v:r?a+(2*r+35):a+27}}return{r:u,s:f,v:h.toType(r,h.TypeOutput.BN).muln(2).addn(35).addn(a).toArrayLike(n)}},e.ecrecover=function(t,e,r,i,s){var u=n.concat([a.setLengthLeft(r,32),a.setLengthLeft(i,32)],64),f=c(e,s);if(!l(f))throw new Error("Invalid signature v value");var h=o.ecdsaRecover(u,f.toNumber(),t);return n.from(o.publicKeyConvert(h,!1).slice(1))},e.toRpcSig=function(t,e,r,i){if(!l(c(t,i)))throw new Error("Invalid signature v value");return a.bufferToHex(n.concat([a.setLengthLeft(e,32),a.setLengthLeft(r,32),a.toBuffer(t)]))},e.toCompactSig=function(t,e,r,i){if(!l(c(t,i)))throw new Error("Invalid signature v value");var o=h.toType(t,h.TypeOutput.Number),s=r;return(o>28&&o%2==1||1===o||28===o)&&((s=n.from(r))[0]|=128),a.bufferToHex(n.concat([a.setLengthLeft(e,32),a.setLengthLeft(s,32)]))},e.fromRpcSig=function(t){var e,r,n,i=a.toBuffer(t);if(i.length>=65)e=i.slice(0,32),r=i.slice(32,64),n=a.bufferToInt(i.slice(64));else{if(64!==i.length)throw new Error("Invalid signature length");e=i.slice(0,32),r=i.slice(32,64),n=a.bufferToInt(i.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:e,s:r}},e.isValidSignature=function(t,e,r,n,i){void 0===n&&(n=!0);var o=new s.default("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new s.default("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!l(c(t,i)))return!1;var u=new s.default(e),f=new s.default(r);return!(u.isZero()||u.gt(a)||f.isZero()||f.gt(a)||n&&1===f.cmp(o))},e.hashPersonalMessage=function(t){f.assertIsBuffer(t);var e=n.from("Ethereum Signed Message:\n"+t.length.toString(),"utf-8");return u.keccak(n.concat([e,t]))}},5309:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=e.bnToRlp=e.bnToUnpaddedBuffer=e.bnToHex=void 0;var o,s=i(r(3864)),a=r(884),u=r(215);function f(t){return u.unpadBuffer(t.toArrayLike(n))}e.bnToHex=function(t){return"0x"+t.toString(16)},e.bnToUnpaddedBuffer=f,e.bnToRlp=function(t){return f(t)},function(t){t[t.Number=0]="Number",t[t.BN=1]="BN",t[t.Buffer=2]="Buffer",t[t.PrefixedHexString=3]="PrefixedHexString"}(o=e.TypeOutput||(e.TypeOutput={})),e.toType=function(t,e){if("string"==typeof t&&!a.isHexString(t))throw new Error("A string must be provided with a 0x-prefix, given: "+t);if("number"==typeof t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");if(t=u.toBuffer(t),e===o.Buffer)return t;if(e===o.BN)return new s.default(t);if(e===o.Number){var r=new s.default(t),n=new s.default(Number.MAX_SAFE_INTEGER.toString());if(r.gt(n))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x"+t.toString("hex")}},6225:function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseTransaction=void 0;var s=o(r(2832)),a=r(4748),u=function(){function t(t){this.DEFAULT_CHAIN="mainnet",this.DEFAULT_HARDFORK="istanbul";var e=t.nonce,r=t.gasLimit,n=t.to,i=t.value,o=t.data,s=t.v,u=t.r,f=t.s,h=t.type;this._type=new a.BN(a.toBuffer(h)).toNumber();var c=a.toBuffer(""===n?"0x":n),l=a.toBuffer(""===s?"0x":s),d=a.toBuffer(""===u?"0x":u),p=a.toBuffer(""===f?"0x":f);this.nonce=new a.BN(a.toBuffer(""===e?"0x":e)),this.gasLimit=new a.BN(a.toBuffer(""===r?"0x":r)),this.to=c.length>0?new a.Address(c):void 0,this.value=new a.BN(a.toBuffer(""===i?"0x":i)),this.data=a.toBuffer(""===o?"0x":o),this.v=l.length>0?new a.BN(l):void 0,this.r=d.length>0?new a.BN(d):void 0,this.s=p.length>0?new a.BN(p):void 0,this._validateCannotExceedMaxInteger({nonce:this.nonce,gasLimit:this.gasLimit,value:this.value,r:this.r,s:this.s})}return Object.defineProperty(t.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),t.prototype.validate=function(t){void 0===t&&(t=!1);var e=[];return this.getBaseFee().gt(this.gasLimit)&&e.push("gasLimit is too low. given "+this.gasLimit+", need at least "+this.getBaseFee()),this.isSigned()&&!this.verifySignature()&&e.push("Invalid Signature"),t?e:0===e.length},t.prototype.getBaseFee=function(){var t=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&t.iaddn(this.common.param("gasPrices","txCreation")),t},t.prototype.getDataFee=function(){for(var t=this.common.param("gasPrices","txDataZero"),e=this.common.param("gasPrices","txDataNonZero"),r=0,n=0;n<this.data.length;n++)0===this.data[n]?r+=t:r+=e;return new a.BN(r)},t.prototype.toCreationAddress=function(){return void 0===this.to||0===this.to.buf.length},t.prototype.isSigned=function(){var t=this,e=t.v,r=t.r,n=t.s;return 0===this.type?!!(e&&r&&n):!(void 0===e||!r||!n)},t.prototype.verifySignature=function(){try{var t=this.getSenderPublicKey();return 0!==a.unpadBuffer(t).length}catch(t){return!1}},t.prototype.getSenderAddress=function(){return new a.Address(a.publicToAddress(this.getSenderPublicKey()))},t.prototype.sign=function(t){if(32!==t.length)throw new Error("Private key must be 32 bytes in length.");var e=this.getMessageToSign(!0),r=a.ecsign(e,t),n=r.v,i=r.r,o=r.s;return this._processSignature(n,i,o)},t.prototype._getCommon=function(t,e){var r;if(e){var n=new a.BN(a.toBuffer(e));if(t){if(!t.chainIdBN().eq(n))throw new Error("The chain ID does not match the chain ID of Common");return t.copy()}return s.default.isSupportedChainId(n)?new s.default({chain:n,hardfork:this.DEFAULT_HARDFORK}):s.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:n,chainId:n},this.DEFAULT_HARDFORK)}return null!==(r=null==t?void 0:t.copy())&&void 0!==r?r:new s.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},t.prototype._validateCannotExceedMaxInteger=function(t,e){var r,o;void 0===e&&(e=53);try{for(var s=n(Object.entries(t)),u=s.next();!u.done;u=s.next()){var f=i(u.value,2),h=f[0],c=f[1];if(53===e){if(null==c?void 0:c.gt(a.MAX_INTEGER))throw new Error(h+" cannot exceed MAX_INTEGER, given "+c)}else{if(256!==e)throw new Error("unimplemented bits value");if(null==c?void 0:c.gte(a.TWO_POW256))throw new Error(h+" must be less than 2^256, given "+c)}}}catch(t){r={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}},t}();e.BaseTransaction=u},7669:function(t,e,r){"use strict";var n,i=r(8764).Buffer,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(e,"__esModule",{value:!0});var u=r(4748),f=r(6225),h=r(3458),c=r(2942),l=i.from(2..toString(16).padStart(2,"0"),"hex"),d=function(t){function e(e,r){var n,i;void 0===r&&(r={});var o=t.call(this,s(s({},e),{type:2}))||this;o.DEFAULT_HARDFORK="london";var a=e.chainId,f=e.accessList,l=e.maxFeePerGas,d=e.maxPriorityFeePerGas;if(o.common=o._getCommon(r.common,a),o.chainId=o.common.chainIdBN(),!o.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");var p=c.AccessLists.getAccessListData(null!=f?f:[]);if(o.accessList=p.accessList,o.AccessListJSON=p.AccessListJSON,c.AccessLists.verifyAccessList(o.accessList),o.maxFeePerGas=new u.BN(u.toBuffer(""===l?"0x":l)),o.maxPriorityFeePerGas=new u.BN(u.toBuffer(""===d?"0x":d)),o._validateCannotExceedMaxInteger({maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas},256),o.maxFeePerGas.lt(o.maxPriorityFeePerGas))throw new Error("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");if(o.v&&!o.v.eqn(0)&&!o.v.eqn(1))throw new Error("The y-parity of the transaction should either be 0 or 1");if(o.common.gteHardfork("homestead")&&(null===(n=o.s)||void 0===n?void 0:n.gt(h.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");return(null===(i=null==r?void 0:r.freeze)||void 0===i||i)&&Object.freeze(o),o}return o(e,t),Object.defineProperty(e.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),e.fromTxData=function(t,r){return void 0===r&&(r={}),new e(t,r)},e.fromSerializedTx=function(t,r){if(void 0===r&&(r={}),!t.slice(0,1).equals(l))throw new Error("Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: 2, received: "+t.slice(0,1).toString("hex"));var n=u.rlp.decode(t.slice(1));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return e.fromValuesArray(n,r)},e.fromRlpSerializedTx=function(t,r){return void 0===r&&(r={}),e.fromSerializedTx(t,r)},e.fromValuesArray=function(t,r){if(void 0===r&&(r={}),9!==t.length&&12!==t.length)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");var n=a(t,12),i=n[0],o=n[1],s=n[2],f=n[3],h=n[4],c=n[5],l=n[6],d=n[7],p=n[8],m=n[9],g=n[10],y=n[11];return new e({chainId:new u.BN(i),nonce:o,maxPriorityFeePerGas:s,maxFeePerGas:f,gasLimit:h,to:c,value:l,data:d,accessList:null!=p?p:[],v:void 0!==m?new u.BN(m):void 0,r:g,s:y},r)},e.prototype.getDataFee=function(){var e=t.prototype.getDataFee.call(this);return e.iaddn(c.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),e},e.prototype.getUpfrontCost=function(t){void 0===t&&(t=new u.BN(0));var e=u.BN.min(this.maxPriorityFeePerGas,this.maxFeePerGas.sub(t)).add(t);return this.gasLimit.mul(e).add(this.value)},e.prototype.raw=function(){return[u.bnToRlp(this.chainId),u.bnToRlp(this.nonce),u.bnToRlp(this.maxPriorityFeePerGas),u.bnToRlp(this.maxFeePerGas),u.bnToRlp(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),u.bnToRlp(this.value),this.data,this.accessList,void 0!==this.v?u.bnToRlp(this.v):i.from([]),void 0!==this.r?u.bnToRlp(this.r):i.from([]),void 0!==this.s?u.bnToRlp(this.s):i.from([])]},e.prototype.serialize=function(){var t=this.raw();return i.concat([l,u.rlp.encode(t)])},e.prototype.getMessageToSign=function(t){void 0===t&&(t=!0);var e=this.raw().slice(0,9),r=i.concat([l,u.rlp.encode(e)]);return t?u.keccak256(r):r},e.prototype.hash=function(){if(!this.isSigned())throw new Error("Cannot call hash method if transaction is not signed");return u.keccak256(this.serialize())},e.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},e.prototype.getSenderPublicKey=function(){var t;if(!this.isSigned())throw new Error("Cannot call this method if transaction is not signed");var e=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(t=this.s)||void 0===t?void 0:t.gt(h.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");var r=this,n=r.v,i=r.r,o=r.s;try{return u.ecrecover(e,n.addn(27),u.bnToRlp(i),u.bnToRlp(o))}catch(t){throw new Error("Invalid Signature")}},e.prototype._processSignature=function(t,r,n){var i={common:this.common};return e.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new u.BN(t-27),r:new u.BN(r),s:new u.BN(n)},i)},e.prototype.toJSON=function(){var t=c.AccessLists.getAccessListJSON(this.accessList);return{chainId:u.bnToHex(this.chainId),nonce:u.bnToHex(this.nonce),maxPriorityFeePerGas:u.bnToHex(this.maxPriorityFeePerGas),maxFeePerGas:u.bnToHex(this.maxFeePerGas),gasLimit:u.bnToHex(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:u.bnToHex(this.value),data:"0x"+this.data.toString("hex"),accessList:t,v:void 0!==this.v?u.bnToHex(this.v):void 0,r:void 0!==this.r?u.bnToHex(this.r):void 0,s:void 0!==this.s?u.bnToHex(this.s):void 0}},e}(f.BaseTransaction);e.default=d},9325:function(t,e,r){"use strict";var n,i=r(8764).Buffer,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(e,"__esModule",{value:!0});var u=r(4748),f=r(6225),h=r(3458),c=r(2942),l=i.from(1..toString(16).padStart(2,"0"),"hex"),d=function(t){function e(e,r){var n,i;void 0===r&&(r={});var o=t.call(this,s(s({},e),{type:1}))||this;o.DEFAULT_HARDFORK="berlin";var a=e.chainId,f=e.accessList,l=e.gasPrice;if(o.common=o._getCommon(r.common,a),o.chainId=o.common.chainIdBN(),!o.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");var d=c.AccessLists.getAccessListData(null!=f?f:[]);if(o.accessList=d.accessList,o.AccessListJSON=d.AccessListJSON,c.AccessLists.verifyAccessList(o.accessList),o.gasPrice=new u.BN(u.toBuffer(""===l?"0x":l)),o._validateCannotExceedMaxInteger({gasPrice:o.gasPrice}),o.v&&!o.v.eqn(0)&&!o.v.eqn(1))throw new Error("The y-parity of the transaction should either be 0 or 1");if(o.common.gteHardfork("homestead")&&(null===(n=o.s)||void 0===n?void 0:n.gt(h.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");return(null===(i=null==r?void 0:r.freeze)||void 0===i||i)&&Object.freeze(o),o}return o(e,t),Object.defineProperty(e.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),e.fromTxData=function(t,r){return void 0===r&&(r={}),new e(t,r)},e.fromSerializedTx=function(t,r){if(void 0===r&&(r={}),!t.slice(0,1).equals(l))throw new Error("Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: 1, received: "+t.slice(0,1).toString("hex"));var n=u.rlp.decode(t.slice(1));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return e.fromValuesArray(n,r)},e.fromRlpSerializedTx=function(t,r){return void 0===r&&(r={}),e.fromSerializedTx(t,r)},e.fromValuesArray=function(t,r){if(void 0===r&&(r={}),8!==t.length&&11!==t.length)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");var n=a(t,11),i=n[0],o=n[1],s=n[2],f=n[3],h=n[4],c=n[5],l=n[6],d=n[7],p=n[8],m=n[9],g=n[10];return new e({chainId:new u.BN(i),nonce:o,gasPrice:s,gasLimit:f,to:h,value:c,data:l,accessList:null!=d?d:[],v:void 0!==p?new u.BN(p):void 0,r:m,s:g},r)},e.prototype.getDataFee=function(){var e=t.prototype.getDataFee.call(this);return e.iaddn(c.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),e},e.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},e.prototype.raw=function(){return[u.bnToRlp(this.chainId),u.bnToRlp(this.nonce),u.bnToRlp(this.gasPrice),u.bnToRlp(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),u.bnToRlp(this.value),this.data,this.accessList,void 0!==this.v?u.bnToRlp(this.v):i.from([]),void 0!==this.r?u.bnToRlp(this.r):i.from([]),void 0!==this.s?u.bnToRlp(this.s):i.from([])]},e.prototype.serialize=function(){var t=this.raw();return i.concat([l,u.rlp.encode(t)])},e.prototype.getMessageToSign=function(t){void 0===t&&(t=!0);var e=this.raw().slice(0,8),r=i.concat([l,u.rlp.encode(e)]);return t?u.keccak256(r):r},e.prototype.hash=function(){if(!this.isSigned())throw new Error("Cannot call hash method if transaction is not signed");return u.keccak256(this.serialize())},e.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},e.prototype.getSenderPublicKey=function(){var t;if(!this.isSigned())throw new Error("Cannot call this method if transaction is not signed");var e=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(t=this.s)||void 0===t?void 0:t.gt(h.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");var r=this,n=r.yParity,i=r.r,o=r.s;try{return u.ecrecover(e,n.addn(27),u.bnToRlp(i),u.bnToRlp(o))}catch(t){throw new Error("Invalid Signature")}},e.prototype._processSignature=function(t,r,n){var i={common:this.common};return e.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new u.BN(t-27),r:new u.BN(r),s:new u.BN(n)},i)},e.prototype.toJSON=function(){var t=c.AccessLists.getAccessListJSON(this.accessList);return{chainId:u.bnToHex(this.chainId),nonce:u.bnToHex(this.nonce),gasPrice:u.bnToHex(this.gasPrice),gasLimit:u.bnToHex(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:u.bnToHex(this.value),data:"0x"+this.data.toString("hex"),accessList:t,v:void 0!==this.v?u.bnToHex(this.v):void 0,r:void 0!==this.r?u.bnToHex(this.r):void 0,s:void 0!==this.s?u.bnToHex(this.s):void 0}},e}(f.BaseTransaction);e.default=d},6052:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(5534);Object.defineProperty(e,"Transaction",{enumerable:!0,get:function(){return o.default}});var s=r(9325);Object.defineProperty(e,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return s.default}});var a=r(1932);Object.defineProperty(e,"TransactionFactory",{enumerable:!0,get:function(){return a.default}});var u=r(7669);Object.defineProperty(e,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return u.default}}),i(r(3458),e)},5534:function(t,e,r){"use strict";var n,i=r(8764).Buffer,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(e,"__esModule",{value:!0});var u=r(4748),f=r(3458),h=function(t){function e(e,r){var n;void 0===r&&(r={});var i=t.call(this,s(s({},e),{type:0}))||this;return i.common=i._validateTxV(i.v,r.common),i.gasPrice=new u.BN(u.toBuffer(""===e.gasPrice?"0x":e.gasPrice)),i._validateCannotExceedMaxInteger({gasPrice:i.gasPrice}),(null===(n=null==r?void 0:r.freeze)||void 0===n||n)&&Object.freeze(i),i}return o(e,t),e.fromTxData=function(t,r){return void 0===r&&(r={}),new e(t,r)},e.fromSerializedTx=function(t,e){void 0===e&&(e={});var r=u.rlp.decode(t);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,e)},e.fromRlpSerializedTx=function(t,r){return void 0===r&&(r={}),e.fromSerializedTx(t,r)},e.fromValuesArray=function(t,r){if(void 0===r&&(r={}),6!==t.length&&9!==t.length)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");var n=a(t,9);return new e({nonce:n[0],gasPrice:n[1],gasLimit:n[2],to:n[3],value:n[4],data:n[5],v:n[6],r:n[7],s:n[8]},r)},e.prototype.raw=function(){return[u.bnToRlp(this.nonce),u.bnToRlp(this.gasPrice),u.bnToRlp(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),u.bnToRlp(this.value),this.data,void 0!==this.v?u.bnToRlp(this.v):i.from([]),void 0!==this.r?u.bnToRlp(this.r):i.from([]),void 0!==this.s?u.bnToRlp(this.s):i.from([])]},e.prototype.serialize=function(){return u.rlp.encode(this.raw())},e.prototype._unsignedTxImplementsEIP155=function(){return this.common.gteHardfork("spuriousDragon")},e.prototype._getMessageToSign=function(t){var e=[u.bnToRlp(this.nonce),u.bnToRlp(this.gasPrice),u.bnToRlp(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),u.bnToRlp(this.value),this.data];return t&&(e.push(u.toBuffer(this.common.chainIdBN())),e.push(u.unpadBuffer(u.toBuffer(0))),e.push(u.unpadBuffer(u.toBuffer(0)))),e},e.prototype.getMessageToSign=function(t){void 0===t&&(t=!0);var e=this._getMessageToSign(this._unsignedTxImplementsEIP155());return t?u.rlphash(e):e},e.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},e.prototype.hash=function(){return u.rlphash(this.raw())},e.prototype.getMessageToVerifySignature=function(){var t=this._signedTxImplementsEIP155(),e=this._getMessageToSign(t);return u.rlphash(e)},e.prototype.getSenderPublicKey=function(){var t,e=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(t=this.s)||void 0===t?void 0:t.gt(f.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");var r=this,n=r.v,i=r.r,o=r.s;try{return u.ecrecover(e,n,u.bnToRlp(i),u.bnToRlp(o),this._signedTxImplementsEIP155()?this.common.chainIdBN():void 0)}catch(t){throw new Error("Invalid Signature")}},e.prototype._processSignature=function(t,r,n){var i=new u.BN(t);this._unsignedTxImplementsEIP155()&&i.iadd(this.common.chainIdBN().muln(2).addn(8));var o={common:this.common};return e.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:i,r:new u.BN(r),s:new u.BN(n)},o)},e.prototype.toJSON=function(){return{nonce:u.bnToHex(this.nonce),gasPrice:u.bnToHex(this.gasPrice),gasLimit:u.bnToHex(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:u.bnToHex(this.value),data:"0x"+this.data.toString("hex"),v:void 0!==this.v?u.bnToHex(this.v):void 0,r:void 0!==this.r?u.bnToHex(this.r):void 0,s:void 0!==this.s?u.bnToHex(this.s):void 0}},e.prototype._validateTxV=function(t,e){var r;if(void 0!==t&&!t.eqn(0)&&(!e||e.gteHardfork("spuriousDragon"))&&!t.eqn(27)&&!t.eqn(28))if(e){var n=e.chainIdBN().muln(2);if(!t.eq(n.addn(35))&&!t.eq(n.addn(36)))throw new Error("Incompatible EIP155-based V "+t.toString()+" and chain id "+e.chainIdBN().toString()+". See the Common parameter of the Transaction constructor to set the chain id.")}else{var i;i=t.subn(35).isEven()?35:36,r=t.subn(i).divn(2)}return this._getCommon(e,r)},e.prototype._signedTxImplementsEIP155=function(){if(!this.isSigned())throw Error("This transaction is not signed");var t=this.common.gteHardfork("spuriousDragon"),e=this.v,r=this.common.chainIdBN().muln(2);return(e.eq(r.addn(35))||e.eq(r.addn(36)))&&t},e}(r(6225).BaseTransaction);e.default=h},1932:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var i=r(4748),o=r(6052),s=function(){function t(){}return t.fromTxData=function(t,e){if(void 0===e&&(e={}),"type"in t&&void 0!==t.type){var r=new i.BN(i.toBuffer(t.type)).toNumber();if(0===r)return o.Transaction.fromTxData(t,e);if(1===r)return o.AccessListEIP2930Transaction.fromTxData(t,e);if(2===r)return o.FeeMarketEIP1559Transaction.fromTxData(t,e);throw new Error("Tx instantiation with type "+r+" not supported")}return o.Transaction.fromTxData(t,e)},t.fromSerializedData=function(t,e){if(void 0===e&&(e={}),t[0]<=127){var r=void 0;switch(t[0]){case 1:r=2930;break;case 2:r=1559;break;default:throw new Error("TypedTransaction with ID "+t[0]+" unknown")}return 1559===r?o.FeeMarketEIP1559Transaction.fromSerializedTx(t,e):o.AccessListEIP2930Transaction.fromSerializedTx(t,e)}return o.Transaction.fromSerializedTx(t,e)},t.fromBlockBodyData=function(t,e){if(void 0===e&&(e={}),n.isBuffer(t))return this.fromSerializedData(t,e);if(Array.isArray(t))return o.Transaction.fromValuesArray(t,e);throw new Error("Cannot decode transaction: unknown type input")},t.getTransactionClass=function(t,e){if(void 0===t&&(t=0),0==t||t>=128&&t<=255)return o.Transaction;switch(t){case 1:return o.AccessListEIP2930Transaction;case 2:return o.FeeMarketEIP1559Transaction;default:throw new Error("TypedTransaction with ID "+t+" unknown")}},t}();e.default=s},3458:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.N_DIV_2=e.isAccessList=e.isAccessListBuffer=void 0;var n=r(4748);function i(t){if(0===t.length)return!0;var e=t[0];return!!Array.isArray(e)}e.isAccessListBuffer=i,e.isAccessList=function(t){return!i(t)},e.N_DIV_2=new n.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)},2942:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AccessLists=void 0;var n=r(4748),i=r(3458),o=function(){function t(){}return t.getAccessListData=function(t){var e,r;if(t&&i.isAccessList(t)){e=t;for(var o=[],s=0;s<t.length;s++){for(var a=t[s],u=n.toBuffer(a.address),f=[],h=0;h<a.storageKeys.length;h++)f.push(n.toBuffer(a.storageKeys[h]));o.push([u,f])}r=o}else{r=null!=t?t:[];var c=[];for(s=0;s<r.length;s++){var l=r[s],d=n.bufferToHex(l[0]),p=[];for(a=0;a<l[1].length;a++)p.push(n.bufferToHex(l[1][a]));var m={address:d,storageKeys:p};c.push(m)}e=c}return{AccessListJSON:e,accessList:r}},t.verifyAccessList=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r[0],i=r[1];if(void 0!==r[2])throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(20!=n.length)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(var o=0;o<i.length;o++)if(32!=i[o].length)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},t.getAccessListJSON=function(t){for(var e=[],r=0;r<t.length;r++){for(var i=t[r],o={address:"0x"+n.setLengthLeft(i[0],20).toString("hex"),storageKeys:[]},s=i[1],a=0;a<s.length;a++){var u=s[a];o.storageKeys.push("0x"+n.setLengthLeft(u,32).toString("hex"))}e.push(o)}return e},t.getDataFeeEIP2930=function(t,e){for(var r=e.param("gasPrices","accessListStorageKeyCost"),n=e.param("gasPrices","accessListAddressCost"),i=0,o=0;o<t.length;o++)i+=t[o][1].length;return t.length*n+i*r},t}();e.AccessLists=o},4081:function(t,e,r){!function(t,e){"use strict";function n(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 o(t,e,r){if(o.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 s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(5304).Buffer}catch(t){}function a(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 n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function f(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var f=t.charCodeAt(u)-48;o*=i,s=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&s<i,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(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 i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.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},o.prototype._move=function(t){h(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){o.prototype.inspect=c}else o.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,l=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=l;d++){var p=f-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.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 f=d[t],h=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var m=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?m+r:l[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var 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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.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},o.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},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.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},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(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()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.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()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.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()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.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 i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(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)},o.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,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,l=h>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,_=0|s[4],E=8191&_,S=_>>>13,A=0|s[5],x=8191&A,k=A>>>13,B=0|s[6],P=8191&B,I=B>>>13,O=0|s[7],T=8191&O,R=O>>>13,N=0|s[8],L=8191&N,C=N>>>13,j=0|s[9],D=8191&j,U=j>>>13,z=0|a[0],F=8191&z,H=z>>>13,q=0|a[1],K=8191&q,G=q>>>13,V=0|a[2],Z=8191&V,W=V>>>13,J=0|a[3],$=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,lt=ht>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(f+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,H))+Math.imul(l,F)|0))<<13)|0;f=((o=Math.imul(l,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,H))+Math.imul(m,F)|0,o=Math.imul(m,H);var yt=(f+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,K)|0))<<13)|0;f=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,H))+Math.imul(b,F)|0,o=Math.imul(b,H),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var bt=(f+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;f=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,H))+Math.imul(M,F)|0,o=Math.imul(M,H),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var vt=(f+(n=n+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,$)|0))<<13)|0;f=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,H))+Math.imul(S,F)|0,o=Math.imul(S,H),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,X)|0;var wt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;f=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,H))+Math.imul(k,F)|0,o=Math.imul(k,H),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;f=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,H))+Math.imul(I,F)|0,o=Math.imul(I,H),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;f=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,H))+Math.imul(R,F)|0,o=Math.imul(R,H),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(l,ut)|0))<<13)|0;f=((o=o+Math.imul(l,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,H))+Math.imul(C,F)|0,o=Math.imul(C,H),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0;var St=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;f=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,H))+Math.imul(U,F)|0,o=Math.imul(U,H),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var At=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;f=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,lt)|0;var xt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,W))+Math.imul(U,Z)|0,o=Math.imul(U,W),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ft)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var kt=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,X))+Math.imul(U,$)|0,o=Math.imul(U,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,lt)|0;var Bt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,lt)|0;var Pt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;f=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Ot=(f+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ft))+Math.imul(U,ut)|0,o=Math.imul(U,ft),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Tt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,lt))+Math.imul(U,ct)|0,o=Math.imul(U,lt);var Rt=(f+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(f+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return f=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=Et,u[8]=St,u[9]=At,u[10]=xt,u[11]=kt,u[12]=Bt,u[13]=Pt,u[14]=It,u[15]=Ot,u[16]=Tt,u[17]=Rt,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(t,e,r){return y(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):b(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,l=f,d=0;d<s;d++){var p=r[h+d],m=n[h+d],g=r[h+d+s],y=n[h+d+s],b=c*g-l*y;y=c*y+l*g,g=b,r[h+d]=p+g,n[h+d]=m+y,r[h+d+s]=p-g,n[h+d+s]=m-y,d!==a&&(b=u*c-f*l,l=u*l+f*c,c=b)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.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,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(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 i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(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)},o.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},o.prototype.isubn=function(t){if(n("number"==typeof t),n(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.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),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.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 i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.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],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.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},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},i(_,M),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.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(E,M),i(S,M),i(A,M),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return w[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(c,new o(1).iushln(p-g-1));l=l.redMul(y),c=y.redSqr(),d=d.redMul(c),p=g}return l},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},4090:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;var f=u(r(9282)),h=u(r(4081)),c=s(r(6636)),l=r(5053),d=r(884),p=r(2924),m=r(9611),g=r(8691),y=r(1012),b=r(7445),v=function(){function t(t,e,r,n){void 0===t&&(t=new h.default(0)),void 0===e&&(e=new h.default(0)),void 0===r&&(r=p.KECCAK256_RLP),void 0===n&&(n=p.KECCAK256_NULL),this.nonce=t,this.balance=e,this.stateRoot=r,this.codeHash=n,this._validate()}return t.fromAccountData=function(e){var r=e.nonce,n=e.balance,i=e.stateRoot,o=e.codeHash;return new t(r?new h.default(m.toBuffer(r)):void 0,n?new h.default(m.toBuffer(n)):void 0,i?m.toBuffer(i):void 0,o?m.toBuffer(o):void 0)},t.fromRlpSerializedAccount=function(t){var e=c.decode(t);if(!Array.isArray(e))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(e)},t.fromValuesArray=function(e){var r=a(e,4),n=r[0],i=r[1],o=r[2],s=r[3];return new t(new h.default(n),new h.default(i),o,s)},t.prototype._validate=function(){if(this.nonce.lt(new h.default(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new h.default(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},t.prototype.raw=function(){return[b.bnToUnpaddedBuffer(this.nonce),b.bnToUnpaddedBuffer(this.balance),this.stateRoot,this.codeHash]},t.prototype.serialize=function(){return c.encode(this.raw())},t.prototype.isContract=function(){return!this.codeHash.equals(p.KECCAK256_NULL)},t.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(p.KECCAK256_NULL)},t}();e.Account=v,e.isValidAddress=function(t){try{y.assertIsString(t)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(t)},e.toChecksumAddress=function(t,e){y.assertIsHexString(t);var r=d.stripHexPrefix(t).toLowerCase(),n="";e&&(n=b.toType(e,b.TypeOutput.BN).toString()+"0x");for(var i=g.keccakFromString(n+r).toString("hex"),o="0x",s=0;s<r.length;s++)parseInt(i[s],16)>=8?o+=r[s].toUpperCase():o+=r[s];return o},e.isValidChecksumAddress=function(t,r){return e.isValidAddress(t)&&e.toChecksumAddress(t,r)===t},e.generateAddress=function(t,e){y.assertIsBuffer(t),y.assertIsBuffer(e);var r=new h.default(e);return r.isZero()?g.rlphash([t,null]).slice(-20):g.rlphash([t,n.from(r.toArray())]).slice(-20)},e.generateAddress2=function(t,e,r){return y.assertIsBuffer(t),y.assertIsBuffer(e),y.assertIsBuffer(r),f.default(20===t.length),f.default(32===e.length),g.keccak256(n.concat([n.from("ff","hex"),t,e,g.keccak256(r)])).slice(-20)},e.isValidPrivate=function(t){return l.privateKeyVerify(t)},e.isValidPublic=function(t,e){return void 0===e&&(e=!1),y.assertIsBuffer(t),64===t.length?l.publicKeyVerify(n.concat([n.from([4]),t])):!!e&&l.publicKeyVerify(t)},e.pubToAddress=function(t,e){return void 0===e&&(e=!1),y.assertIsBuffer(t),e&&64!==t.length&&(t=n.from(l.publicKeyConvert(t,!1).slice(1))),f.default(64===t.length),g.keccak(t).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToPublic=function(t){return y.assertIsBuffer(t),n.from(l.publicKeyCreate(t,!1)).slice(1)},e.privateToAddress=function(t){return e.publicToAddress(e.privateToPublic(t))},e.importPublic=function(t){return y.assertIsBuffer(t),64!==t.length&&(t=n.from(l.publicKeyConvert(t,!1).slice(1))),t},e.zeroAddress=function(){var t=m.zeros(20);return m.bufferToHex(t)},e.isZeroAddress=function(t){try{y.assertIsString(t)}catch(t){return!1}return e.zeroAddress()===t}},5797:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Address=void 0;var o=i(r(9282)),s=i(r(4081)),a=r(9611),u=r(4090),f=function(){function t(t){o.default(20===t.length,"Invalid address length"),this.buf=t}return t.zero=function(){return new t(a.zeros(20))},t.fromString=function(e){return o.default(u.isValidAddress(e),"Invalid address"),new t(a.toBuffer(e))},t.fromPublicKey=function(e){return o.default(n.isBuffer(e),"Public key should be Buffer"),new t(u.pubToAddress(e))},t.fromPrivateKey=function(e){return o.default(n.isBuffer(e),"Private key should be Buffer"),new t(u.privateToAddress(e))},t.generate=function(e,r){return o.default(s.default.isBN(r)),new t(u.generateAddress(e.buf,r.toArrayLike(n)))},t.generate2=function(e,r,i){return o.default(n.isBuffer(r)),o.default(n.isBuffer(i)),new t(u.generateAddress2(e.buf,r,i))},t.prototype.equals=function(t){return this.buf.equals(t.buf)},t.prototype.isZero=function(){return this.equals(t.zero())},t.prototype.isPrecompileOrSystemAddress=function(){var t=new s.default(this.buf),e=new s.default(0),r=new s.default("ffff","hex");return t.gte(e)&&t.lte(r)},t.prototype.toString=function(){return"0x"+this.buf.toString("hex")},t.prototype.toBuffer=function(){return n.from(this.buf)},t}();e.Address=f},9611:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.baToJSON=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=void 0;var o=i(r(4081)),s=r(884),a=r(1012);e.zeros=function(t){return n.allocUnsafe(t).fill(0)};var u=function(t,r,n){var i=e.zeros(r);return n?t.length<r?(t.copy(i),i):t.slice(0,r):t.length<r?(t.copy(i,r-t.length),i):t.slice(-r)};e.setLengthLeft=function(t,e){return a.assertIsBuffer(t),u(t,e,!1)},e.setLengthRight=function(t,e){return a.assertIsBuffer(t),u(t,e,!0)};var f=function(t){for(var e=t[0];t.length>0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t};e.unpadBuffer=function(t){return a.assertIsBuffer(t),f(t)},e.unpadArray=function(t){return a.assertIsArray(t),f(t)},e.unpadHexString=function(t){return a.assertIsHexString(t),t=s.stripHexPrefix(t),f(t)},e.toBuffer=function(t){if(null==t)return n.allocUnsafe(0);if(n.isBuffer(t))return n.from(t);if(Array.isArray(t)||t instanceof Uint8Array)return n.from(t);if("string"==typeof t){if(!s.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);return n.from(s.padToEven(s.stripHexPrefix(t)),"hex")}if("number"==typeof t)return s.intToBuffer(t);if(o.default.isBN(t))return t.toArrayLike(n);if(t.toArray)return n.from(t.toArray());if(t.toBuffer)return n.from(t.toBuffer());throw new Error("invalid type")},e.bufferToInt=function(t){return new o.default(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new o.default(t).fromTwos(256)},e.toUnsigned=function(t){return n.from(t.toTwos(256).toArray())},e.addHexPrefix=function(t){return"string"!=typeof t||s.isHexPrefixed(t)?t:"0x"+t},e.baToJSON=function(t){if(n.isBuffer(t))return"0x"+t.toString("hex");if(t instanceof Array){for(var r=[],i=0;i<t.length;i++)r.push(e.baToJSON(t[i]));return r}}},2924:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.MAX_INTEGER=void 0;var i=r(8764).Buffer,o=n(r(4081));e.MAX_INTEGER=new o.default("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new o.default("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=i.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=i.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=i.from(e.KECCAK256_RLP_S,"hex")},1856:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.rlp=e.BN=void 0;var a=s(r(4081));e.BN=a.default;var u=o(r(6636));e.rlp=u},8691:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.rlphash=e.ripemd160FromArray=e.ripemd160FromString=e.ripemd160=e.sha256FromArray=e.sha256FromString=e.sha256=e.keccakFromArray=e.keccakFromHexString=e.keccakFromString=e.keccak256=e.keccak=void 0;var a=r(2192),u=r(3482),f=s(r(6636)),h=r(9611),c=r(1012);e.keccak=function(t,e){switch(void 0===e&&(e=256),c.assertIsBuffer(t),e){case 224:return a.keccak224(t);case 256:return a.keccak256(t);case 384:return a.keccak384(t);case 512:return a.keccak512(t);default:throw new Error("Invald algorithm: keccak"+e)}},e.keccak256=function(t){return e.keccak(t)},e.keccakFromString=function(t,r){void 0===r&&(r=256),c.assertIsString(t);var i=n.from(t,"utf8");return e.keccak(i,r)},e.keccakFromHexString=function(t,r){return void 0===r&&(r=256),c.assertIsHexString(t),e.keccak(h.toBuffer(t),r)},e.keccakFromArray=function(t,r){return void 0===r&&(r=256),c.assertIsArray(t),e.keccak(h.toBuffer(t),r)};var l=function(t){return t=h.toBuffer(t),u("sha256").update(t).digest()};e.sha256=function(t){return c.assertIsBuffer(t),l(t)},e.sha256FromString=function(t){return c.assertIsString(t),l(t)},e.sha256FromArray=function(t){return c.assertIsArray(t),l(t)};var d=function(t,e){t=h.toBuffer(t);var r=u("rmd160").update(t).digest();return!0===e?h.setLengthLeft(r,32):r};e.ripemd160=function(t,e){return c.assertIsBuffer(t),d(t,e)},e.ripemd160FromString=function(t,e){return c.assertIsString(t),d(t,e)},e.ripemd160FromArray=function(t,e){return c.assertIsArray(t),d(t,e)},e.rlphash=function(t){return e.keccak(f.encode(t))}},1012:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.assertIsString=e.assertIsArray=e.assertIsBuffer=e.assertIsHexString=void 0;var i=r(884);e.assertIsHexString=function(t){if(!i.isHexString(t))throw new Error("This method only supports 0x-prefixed hex strings but input was: "+t)},e.assertIsBuffer=function(t){if(!n.isBuffer(t))throw new Error("This method only supports Buffer but input was: "+t)},e.assertIsArray=function(t){if(!Array.isArray(t))throw new Error("This method only supports number arrays but input was: "+t)},e.assertIsString=function(t){if("string"!=typeof t)throw new Error("This method only supports strings but input was: "+t)}},4748:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2924),e),i(r(4090),e),i(r(5797),e),i(r(8691),e),i(r(7959),e),i(r(9611),e),i(r(8637),e),i(r(1856),e),i(r(7445),e),i(r(884),e)},8637:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.defineProperties=void 0;var u=a(r(9282)),f=s(r(884)),h=s(r(6636)),c=r(9611);e.defineProperties=function(t,e,r){if(t.raw=[],t._fields=[],t.toJSON=function(e){if(void 0===e&&(e=!1),e){var r={};return t._fields.forEach((function(e){r[e]="0x"+t[e].toString("hex")})),r}return c.baToJSON(t.raw)},t.serialize=function(){return h.encode(t.raw)},e.forEach((function(e,r){function i(){return t.raw[r]}function o(i){"00"!==(i=c.toBuffer(i)).toString("hex")||e.allowZero||(i=n.allocUnsafe(0)),e.allowLess&&e.length?(i=c.unpadBuffer(i),u.default(e.length>=i.length,"The field "+e.name+" must not have more "+e.length+" bytes")):e.allowZero&&0===i.length||!e.length||u.default(e.length===i.length,"The field "+e.name+" must have byte length of "+e.length),t.raw[r]=i}t._fields.push(e.name),Object.defineProperty(t,e.name,{enumerable:!0,configurable:!0,get:i,set:o}),e.default&&(t[e.name]=e.default),e.alias&&Object.defineProperty(t,e.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),r)if("string"==typeof r&&(r=n.from(f.stripHexPrefix(r),"hex")),n.isBuffer(r)&&(r=h.decode(r)),Array.isArray(r)){if(r.length>t._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(e,r){t[t._fields[r]]=c.toBuffer(e)}))}else{if("object"!=typeof r)throw new Error("invalid data");var i=Object.keys(r);e.forEach((function(e){-1!==i.indexOf(e.name)&&(t[e.name]=r[e.name]),-1!==i.indexOf(e.alias)&&(t[e.alias]=r[e.alias])}))}}},7959:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toCompactSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;var o=r(5053),s=i(r(4081)),a=r(9611),u=r(8691),f=r(1012),h=r(7445);function c(t,e){var r=h.toType(t,h.TypeOutput.BN);if(!e)return r.subn(27);var n=h.toType(e,h.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function l(t){var e=new s.default(t);return e.eqn(0)||e.eqn(1)}e.ecsign=function(t,e,r){var i=o.ecdsaSign(t,e),s=i.signature,a=i.recid,u=n.from(s.slice(0,32)),f=n.from(s.slice(32,64));if(!r||"number"==typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:u,s:f,v:r?a+(2*r+35):a+27}}return{r:u,s:f,v:h.toType(r,h.TypeOutput.BN).muln(2).addn(35).addn(a).toArrayLike(n)}},e.ecrecover=function(t,e,r,i,s){var u=n.concat([a.setLengthLeft(r,32),a.setLengthLeft(i,32)],64),f=c(e,s);if(!l(f))throw new Error("Invalid signature v value");var h=o.ecdsaRecover(u,f.toNumber(),t);return n.from(o.publicKeyConvert(h,!1).slice(1))},e.toRpcSig=function(t,e,r,i){if(!l(c(t,i)))throw new Error("Invalid signature v value");return a.bufferToHex(n.concat([a.setLengthLeft(e,32),a.setLengthLeft(r,32),a.toBuffer(t)]))},e.toCompactSig=function(t,e,r,i){if(!l(c(t,i)))throw new Error("Invalid signature v value");var o=h.toType(t,h.TypeOutput.Number),s=r;return(o>28&&o%2==1||1===o||28===o)&&((s=n.from(r))[0]|=128),a.bufferToHex(n.concat([a.setLengthLeft(e,32),a.setLengthLeft(s,32)]))},e.fromRpcSig=function(t){var e,r,n,i=a.toBuffer(t);if(i.length>=65)e=i.slice(0,32),r=i.slice(32,64),n=a.bufferToInt(i.slice(64));else{if(64!==i.length)throw new Error("Invalid signature length");e=i.slice(0,32),r=i.slice(32,64),n=a.bufferToInt(i.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:e,s:r}},e.isValidSignature=function(t,e,r,n,i){void 0===n&&(n=!0);var o=new s.default("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new s.default("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!l(c(t,i)))return!1;var u=new s.default(e),f=new s.default(r);return!(u.isZero()||u.gt(a)||f.isZero()||f.gt(a)||n&&1===f.cmp(o))},e.hashPersonalMessage=function(t){f.assertIsBuffer(t);var e=n.from("Ethereum Signed Message:\n"+t.length.toString(),"utf-8");return u.keccak(n.concat([e,t]))}},7445:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=e.bnToRlp=e.bnToUnpaddedBuffer=e.bnToHex=void 0;var o,s=i(r(4081)),a=r(884),u=r(9611);function f(t){return u.unpadBuffer(t.toArrayLike(n))}e.bnToHex=function(t){return"0x"+t.toString(16)},e.bnToUnpaddedBuffer=f,e.bnToRlp=function(t){return f(t)},function(t){t[t.Number=0]="Number",t[t.BN=1]="BN",t[t.Buffer=2]="Buffer",t[t.PrefixedHexString=3]="PrefixedHexString"}(o=e.TypeOutput||(e.TypeOutput={})),e.toType=function(t,e){if("string"==typeof t&&!a.isHexString(t))throw new Error("A string must be provided with a 0x-prefix, given: "+t);if("number"==typeof t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");if(t=u.toBuffer(t),e===o.Buffer)return t;if(e===o.BN)return new s.default(t);if(e===o.Number){var r=new s.default(t),n=new s.default(Number.MAX_SAFE_INTEGER.toString());if(r.gt(n))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x"+t.toString("hex")}},4867:(t,e,r)=>{var n=r(4155);!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],a=[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],u=[224,256,384,512],f=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(n){return new M(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new M(t,e,i).update(n)[r]()}},l=function(t,e){var r=h(t,e,"hex");r.create=function(){return new M(t,e,t)},r.update=function(t){return r.create().update(t)};for(var n=0;n<f.length;++n){var i=f[n];r[i]=h(t,e,i)}return r},d=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:l},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,createMethod:l},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var r=c(t,e,"hex");r.create=function(r){return new M(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var n=0;n<f.length;++n){var i=f[n];r[i]=c(t,e,i)}return r}}],p={},m=[],g=0;g<d.length;++g)for(var y=d[g],b=y.bits,v=0;v<b.length;++v){var w=y.name+"_"+b[v];m.push(w),p[w]=y.createMethod(b[v],y.padding)}function M(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,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}M.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,a=this.byteCount,u=this.blockCount,f=0,h=this.s;f<i;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<u+1;++r)o[r]=0;if(e)for(r=this.start;f<i&&r<a;++f)o[r>>2]|=t[f]<<s[3&r++];else for(r=this.start;f<i&&r<a;++f)(n=t.charCodeAt(f))<128?o[r>>2]|=n<<s[3&r++]:n<2048?(o[r>>2]|=(192|n>>6)<<s[3&r++],o[r>>2]|=(128|63&n)<<s[3&r++]):n<55296||n>=57344?(o[r>>2]|=(224|n>>12)<<s[3&r++],o[r>>2]|=(128|n>>6&63)<<s[3&r++],o[r>>2]|=(128|63&n)<<s[3&r++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++f)),o[r>>2]|=(240|n>>18)<<s[3&r++],o[r>>2]|=(128|n>>12&63)<<s[3&r++],o[r>>2]|=(128|n>>6&63)<<s[3&r++],o[r>>2]|=(128|63&n)<<s[3&r++]);if(this.lastByteIndex=r,r>=a){for(this.start=r-a,this.block=o[u],r=0;r<u;++r)h[r]^=o[r];_(h),this.reset=!0}else this.start=r}return this},M.prototype.finalize=function(){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];_(n)},M.prototype.toString=M.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,s=0,a=0,u="";a<n;){for(s=0;s<e&&a<n;++s,++a)t=r[s],u+=o[t>>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(_(r),s=0)}return i&&(t=r[s],i>0&&(u+=o[t>>4&15]+o[15&t]),i>1&&(u+=o[t>>12&15]+o[t>>8&15]),i>2&&(u+=o[t>>20&15]+o[t>>16&15])),u},M.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&_(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},M.prototype.buffer=M.prototype.arrayBuffer,M.prototype.digest=M.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&_(n)}return o&&(t=a<<2,e=n[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var _=function(t){var e,r,n,i,o,s,u,f,h,c,l,d,p,m,g,y,b,v,w,M,_,E,S,A,x,k,B,P,I,O,T,R,N,L,C,j,D,U,z,F,H,q,K,G,V,Z,W,J,$,X,Y,Q,tt,et,rt,nt,it,ot,st,at,ut,ft,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|s>>>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=i^(f<<1|h>>>31),r=o^(h<<1|f>>>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=s^(c<<1|l>>>31),r=u^(l<<1|c>>>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=f^(d<<1|p>>>31),r=h^(p<<1|d>>>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=c^(i<<1|o>>>31),r=l^(o<<1|i>>>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,m=t[0],g=t[1],Z=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,q=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,L=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,b=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,$=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ft=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,j=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,N=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~y&v,t[1]=g^~b&w,t[10]=A^~k&P,t[11]=x^~B&I,t[20]=L^~j&U,t[21]=C^~D&z,t[30]=G^~Z&J,t[31]=V^~W&$,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~v&M,t[3]=b^~w&_,t[12]=k^~P&O,t[13]=B^~I&T,t[22]=j^~U&F,t[23]=D^~z&H,t[32]=Z^~J&X,t[33]=W^~$&Y,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=v^~M&E,t[5]=w^~_&S,t[14]=P^~O&R,t[15]=I^~T&N,t[24]=U^~F&q,t[25]=z^~H&K,t[34]=J^~X&Q,t[35]=$^~Y&tt,t[44]=ot^~at&ft,t[45]=st^~ut&ht,t[6]=M^~E&m,t[7]=_^~S&g,t[16]=O^~R&A,t[17]=T^~N&x,t[26]=F^~q&L,t[27]=H^~K&C,t[36]=X^~Q&G,t[37]=Y^~tt&V,t[46]=at^~ft&et,t[47]=ut^~ht&rt,t[8]=E^~m&y,t[9]=S^~g&b,t[18]=R^~A&k,t[19]=N^~x&B,t[28]=q^~L&j,t[29]=K^~C&D,t[38]=Q^~G&Z,t[39]=tt^~V&W,t[48]=ft^~et&nt,t[49]=ht^~rt&it,t[0]^=a[n],t[1]^=a[n+1]};if(i)t.exports=p;else for(g=0;g<m.length;++g)e[m[g]]=p[m[g]]}()},9809:(t,e,r)=>{"use strict";const n=e;n.bignum=r(3550),n.define=r(2500).define,n.base=r(1979),n.constants=r(6826),n.decoders=r(8307),n.encoders=r(6579)},2500:(t,e,r)=>{"use strict";const n=r(6579),i=r(8307),o=r(5717);function s(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new s(t,e)},s.prototype._createNamed=function(t){const e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},s.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},s.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},s.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},s.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},6625:(t,e,r)=>{"use strict";const n=r(5717),i=r(8465).b,o=r(2399).Buffer;function s(t,e){i.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(s,i),e.C=s,s.isDecoderBuffer=function(t){return t instanceof s||"object"==typeof t&&o.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(t){const e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=a,a.isEncoderBuffer=function(t){return t instanceof a||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},a.prototype.join=function(t,e){return t||(t=o.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},1979:(t,e,r)=>{"use strict";const n=e;n.Reporter=r(8465).b,n.DecoderBuffer=r(6625).C,n.EncoderBuffer=r(6625).R,n.Node=r(1949)},1949:(t,e,r)=>{"use strict";const n=r(8465).b,i=r(6625).R,o=r(6625).C,s=r(9746),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function f(t,e,r){const n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=f;const h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];f.prototype.clone=function(){const t=this._baseState,e={};h.forEach((function(r){e[r]=t[r]}));const r=new this.constructor(e.parent);return r._baseState=e,r},f.prototype._wrap=function(){const t=this._baseState;u.forEach((function(e){this[e]=function(){const r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},f.prototype._init=function(t){const e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(e.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(t){const e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){f.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){f.prototype[t]=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}})),f.prototype.use=function(t){s(t);const e=this._baseState;return s(null===e.use),e.use=t,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(t){const e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},f.prototype.explicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},f.prototype.implicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},f.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},f.prototype.key=function(t){const e=this._baseState;return s(null===e.key),e.key=t,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(t){const e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},f.prototype.contains=function(t){const e=this._baseState;return s(null===e.use),e.contains=t,this},f.prototype._decode=function(t,e){const r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));let n,i=r.default,s=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(s=this._peekTag(t,n,r.any),t.isError(s))return s}else{const n=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),s=!0}catch(t){s=!1}t.restore(n)}}if(r.obj&&s&&(n=t.enterObject()),s){if(null!==r.explicit){const e=this._decodeTag(t,r.explicit);if(t.isError(e))return e;t=e}const n=t.offset;if(null===r.use&&null===r.choice){let e;r.any&&(e=t.save());const n=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(n))return n;r.any?i=t.raw(e):t=n}if(e&&e.track&&null!==r.tag&&e.track(t.path(),n,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(n,e)}}return r.obj&&s&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,i),i},f.prototype._decodeGeneric=function(t,e,r){const n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},f.prototype._getUse=function(t,e){const r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},f.prototype._decodeChoice=function(t,e){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const s=t.save(),a=r.choice[o];try{const r=a._decode(t,e);if(t.isError(r))return!1;n={type:o,value:r},i=!0}catch(e){return t.restore(s),!1}return!0}),this),i?n:t.error("Choice not matched")},f.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},f.prototype._encode=function(t,e,r){const n=this._baseState;if(null!==n.default&&n.default===t)return;const i=this._encodeValue(t,e,r);return void 0===i||this._skipDefault(i,e,r)?void 0:i},f.prototype._encodeValue=function(t,e,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);let o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}let s=null,a=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)s=this._getUse(i.contains,r)._encode(t,e),a=!0;else if(i.children)s=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");const n=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i}),this).filter((function(t){return t})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(r){const n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),r))}else null!==i.use?o=this._getUse(i.use,r)._encode(t,e):(s=this._encodePrimitive(i.tag,t),a=!0);if(!i.any&&null===i.choice){const t=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===t?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(t,a,r,s))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},f.prototype._encodeChoice=function(t,e){const r=this._baseState,n=r.choice[t.type];return n||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},f.prototype._encodePrimitive=function(t,e){const r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},f.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},f.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},8465:(t,e,r)=>{"use strict";const n=r(5717);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.b=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){const n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){const e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){let e;const r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},160:(t,e)=>{"use strict";function r(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=r(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=r(e.tag)},6826:(t,e,r)=>{"use strict";const n=e;n._reverse=function(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e},n.der=r(160)},1671:(t,e,r)=>{"use strict";const n=r(5717),i=r(3550),o=r(6625).C,s=r(1949),a=r(160);function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new f,this.tree._init(t.body)}function f(t){s.call(this,"der",t)}function h(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=t.readUInt8(e),t.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function c(t,e,r){let n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(let e=0;e<i;e++){n<<=8;const e=t.readUInt8(r);if(t.isError(e))return e;n|=e}return n}t.exports=u,u.prototype.decode=function(t,e){return o.isDecoderBuffer(t)||(t=new o(t,e)),this.tree._decode(t,e)},n(f,s),f.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;const n=t.save(),i=h(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},f.prototype._decodeTag=function(t,e,r){const n=h(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;let i=c(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');const o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: "'+e+'"'))},f.prototype._skipUntilEnd=function(t,e){for(;;){const r=h(t,e);if(t.isError(r))return r;const n=c(t,r.primitive,e);if(t.isError(n))return n;let i;if(i=r.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},f.prototype._decodeList=function(t,e,r,n){const i=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const o=r.decode(t,"der",n);if(t.isError(o)&&e)break;i.push(o)}return i},f.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let r="";for(let t=0;t<e.length/2;t++)r+=String.fromCharCode(e.readUInt16BE(2*t));return r}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},f.prototype._decodeObjid=function(t,e,r){let n;const i=[];let o=0,s=0;for(;!t.isEmpty();)s=t.readUInt8(),o<<=7,o|=127&s,0==(128&s)&&(i.push(o),o=0);128&s&&i.push(o);const a=i[0]/40|0,u=i[0]%40;if(n=r?i:[a,u].concat(i.slice(1)),e){let t=e[n.join(" ")];void 0===t&&(t=e[n.join(".")]),void 0!==t&&(n=t)}return n},f.prototype._decodeTime=function(t,e){const r=t.raw().toString();let n,i,o,s,a,u;if("gentime"===e)n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,s,a,u,0)},f.prototype._decodeNull=function(){return null},f.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},f.prototype._decodeInt=function(t,e){const r=t.raw();let n=new i(r);return e&&(n=e[n.toString(10)]||n),n},f.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},8307:(t,e,r)=>{"use strict";const n=e;n.der=r(1671),n.pem=r(9631)},9631:(t,e,r)=>{"use strict";const n=r(5717),i=r(2399).Buffer,o=r(1671);function s(t){o.call(this,t),this.enc="pem"}n(s,o),t.exports=s,s.prototype.decode=function(t,e){const r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,u=-1;for(let t=0;t<r.length;t++){const e=r[t].match(s);if(null!==e&&e[2]===n){if(-1!==a){if("END"!==e[1])break;u=t;break}if("BEGIN"!==e[1])break;a=t}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+n);const f=r.slice(a+1,u).join("");f.replace(/[^a-z0-9+/=]+/gi,"");const h=i.from(f,"base64");return o.prototype.decode.call(this,h,e)}},6984:(t,e,r)=>{"use strict";const n=r(5717),i=r(2399).Buffer,o=r(1949),s=r(160);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function f(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(u,o),u.prototype._encodeComposite=function(t,e,r,n){const o=function(t,e,r,n){let i;if("seqof"===t?t="seq":"setof"===t&&(t="set"),s.tagByName.hasOwnProperty(t))i=s.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=s.tagClassByName[r||"universal"]<<6,i)}(t,e,r,this.reporter);if(n.length<128){const t=i.alloc(2);return t[0]=o,t[1]=n.length,this._createEncoderBuffer([t,n])}let a=1;for(let t=n.length;t>=256;t>>=8)a++;const u=i.alloc(2+a);u[0]=o,u[1]=128|a;for(let t=1+a,e=n.length;e>0;t--,e>>=8)u[t]=255&e;return this._createEncoderBuffer([u,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=i.alloc(2*t.length);for(let r=0;r<t.length;r++)e.writeUInt16BE(t.charCodeAt(r),2*r);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},u.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let n=0;for(let e=0;e<t.length;e++){let r=t[e];for(n++;r>=128;r>>=7)n++}const o=i.alloc(n);let s=o.length-1;for(let e=t.length-1;e>=0;e--){let r=t[e];for(o[s--]=127&r;(r>>=7)>0;)o[s--]=128|127&r}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(t,e){let r;const n=new Date(t);return"gentime"===e?r=[f(n.getUTCFullYear()),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[f(n.getUTCFullYear()%100),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=i.from(e)}if(i.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=i.alloc(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;e>=256;e>>=8)r++;const n=new Array(r);for(let e=n.length-1;e>=0;e--)n[e]=255&t,t>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0}},6579:(t,e,r)=>{"use strict";const n=e;n.der=r(6984),n.pem=r(2883)},2883:(t,e,r)=>{"use strict";const n=r(5717),i=r(6984);function o(t){i.call(this,t),this.enc="pem"}n(o,i),t.exports=o,o.prototype.encode=function(t,e){const r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"];for(let t=0;t<r.length;t+=64)n.push(r.slice(t,t+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},9282:(t,e,r)=>{"use strict";var n=r(4155);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)}var o,s,a=r(2136).codes,u=a.ERR_AMBIGUOUS_ARGUMENT,f=a.ERR_INVALID_ARG_TYPE,h=a.ERR_INVALID_ARG_VALUE,c=a.ERR_INVALID_RETURN_VALUE,l=a.ERR_MISSING_ARGS,d=r(5961),p=r(9539).inspect,m=r(9539).types,g=m.isPromise,y=m.isRegExp,b=Object.assign?Object.assign:r(8091).assign,v=Object.is?Object.is:r(609);function w(){var t=r(9158);o=t.isDeepEqual,s=t.isDeepStrictEqual}new Map;var M=!1,_=t.exports=x,E={};function S(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function A(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw o.generatedMessage=i,o}}function x(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];A.apply(void 0,[x,e.length].concat(e))}_.fail=function t(e,r,i,o,s){var a,u=arguments.length;if(0===u)a="Failed";else if(1===u)i=e,e=void 0;else{if(!1===M){M=!0;var f=n.emitWarning?n.emitWarning:console.warn.bind(console);f("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===u&&(o="!=")}if(i instanceof Error)throw i;var h={actual:e,expected:r,operator:void 0===o?"fail":o,stackStartFn:s||t};void 0!==i&&(h.message=i);var c=new d(h);throw a&&(c.message=a,c.generatedMessage=!0),c},_.AssertionError=d,_.ok=x,_.equal=function t(e,r,n){if(arguments.length<2)throw new l("actual","expected");e!=r&&S({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},_.notEqual=function t(e,r,n){if(arguments.length<2)throw new l("actual","expected");e==r&&S({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},_.deepEqual=function t(e,r,n){if(arguments.length<2)throw new l("actual","expected");void 0===o&&w(),o(e,r)||S({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},_.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new l("actual","expected");void 0===o&&w(),o(e,r)&&S({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},_.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new l("actual","expected");void 0===o&&w(),s(e,r)||S({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},_.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new l("actual","expected");void 0===o&&w(),s(e,r)&&S({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},_.strictEqual=function t(e,r,n){if(arguments.length<2)throw new l("actual","expected");v(e,r)||S({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},_.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new l("actual","expected");v(e,r)&&S({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var k=function t(e,r,n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&y(e[t])&&e[t].test(n[t])?i[t]=n[t]:i[t]=e[t])}))};function B(t,e,r,n,i,o){if(!(r in t)||!s(t[r],e[r])){if(!n){var a=new k(t,i),u=new k(e,i,t),f=new d({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:o});throw f.actual=t,f.expected=e,f.operator=o.name,f}S({actual:t,expected:e,message:n,operator:o.name,stackStartFn:o})}}function P(t,e,r,n){if("function"!=typeof e){if(y(e))return e.test(t);if(2===arguments.length)throw new f("expected",["Function","RegExp"],e);if("object"!==i(t)||null===t){var s=new d({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw s.operator=n.name,s}var a=Object.keys(e);if(e instanceof Error)a.push("name","message");else if(0===a.length)throw new h("error",e,"may not be an empty object");return void 0===o&&w(),a.forEach((function(i){"string"==typeof t[i]&&y(e[i])&&e[i].test(t[i])||B(t,e,i,r,a,n)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function I(t){if("function"!=typeof t)throw new f("fn","Function",t);try{t()}catch(t){return t}return E}function O(t){return g(t)||null!==t&&"object"===i(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function T(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!O(e=t()))throw new c("instance of Promise","promiseFn",e)}else{if(!O(t))throw new f("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return E})).catch((function(t){return t}))}))}function R(t,e,r,n){if("string"==typeof r){if(4===arguments.length)throw new f("error",["Object","Error","Function","RegExp"],r);if("object"===i(e)&&null!==e){if(e.message===r)throw new u("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new u("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new f("error",["Object","Error","Function","RegExp"],r);if(e===E){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var s="rejects"===t.name?"rejection":"exception";S({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(s).concat(o),stackStartFn:t})}if(r&&!P(e,r,n,t))throw e}function N(t,e,r,n){if(e!==E){if("string"==typeof r&&(n=r,r=void 0),!r||P(e,r)){var i=n?": ".concat(n):".",o="doesNotReject"===t.name?"rejection":"exception";S({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function L(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];A.apply(void 0,[L,e.length].concat(e))}_.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];R.apply(void 0,[t,I(e)].concat(n))},_.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return T(e).then((function(e){return R.apply(void 0,[t,e].concat(n))}))},_.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];N.apply(void 0,[t,I(e)].concat(n))},_.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return T(e).then((function(e){return N.apply(void 0,[t,e].concat(n))}))},_.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===i(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=p(e);var n=new d({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),o=e.stack;if("string"==typeof o){var s=o.split("\n");s.shift();for(var a=n.stack.split("\n"),u=0;u<s.length;u++){var f=a.indexOf(s[u]);if(-1!==f){a=a.slice(0,f);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},_.strict=b(L,_,{equal:_.strictEqual,deepEqual:_.deepStrictEqual,notEqual:_.notStrictEqual,notDeepEqual:_.notDeepStrictEqual}),_.strict.strict=_.strict},5961:(t,e,r)=>{"use strict";var n=r(4155);function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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,n.key,n)}}function s(t,e){return!e||"object"!==d(e)&&"function"!=typeof e?a(t):e}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e="function"==typeof Map?new Map:void 0;return(u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return h(t,arguments,l(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,t)})(t)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function h(t,e,r){return(h=f()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&c(i,r.prototype),i}).apply(null,arguments)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}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)}var p=r(9539).inspect,m=r(2136).codes.ERR_INVALID_ARG_TYPE;function g(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var y="",b="",v="",w="",M={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function E(t){return p(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var S=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==d(t)||null===t)throw new m("options","Object",t);var i=t.message,o=t.operator,u=t.stackStartFn,f=t.actual,h=t.expected,c=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,l(e).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(y="",b="",w="",v=""):(y="",b="",w="",v="")),"object"===d(f)&&null!==f&&"object"===d(h)&&null!==h&&"stack"in f&&f instanceof Error&&"stack"in h&&h instanceof Error&&(f=_(f),h=_(h)),"deepStrictEqual"===o||"strictEqual"===o)r=s(this,l(e).call(this,function(t,e,r){var i="",o="",s=0,a="",u=!1,f=E(t),h=f.split("\n"),c=E(e).split("\n"),l=0,p="";if("strictEqual"===r&&"object"===d(t)&&"object"===d(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===h.length&&1===c.length&&h[0]!==c[0]){var m=h[0].length+c[0].length;if(m<=10){if(!("object"===d(t)&&null!==t||"object"===d(e)&&null!==e||0===t&&0===e))return"".concat(M[r],"\n\n")+"".concat(h[0]," !== ").concat(c[0],"\n")}else if("strictEqualObject"!==r&&m<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;h[0][l]===c[0][l];)l++;l>2&&(p="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",l),"^"),l=0)}}for(var _=h[h.length-1],S=c[c.length-1];_===S&&(l++<2?a="\n ".concat(_).concat(a):i=_,h.pop(),c.pop(),0!==h.length&&0!==c.length);)_=h[h.length-1],S=c[c.length-1];var A=Math.max(h.length,c.length);if(0===A){var x=f.split("\n");if(x.length>30)for(x[26]="".concat(y,"...").concat(w);x.length>27;)x.pop();return"".concat(M.notIdentical,"\n\n").concat(x.join("\n"),"\n")}l>3&&(a="\n".concat(y,"...").concat(w).concat(a),u=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var k=0,B=M[r]+"\n".concat(b,"+ actual").concat(w," ").concat(v,"- expected").concat(w),P=" ".concat(y,"...").concat(w," Lines skipped");for(l=0;l<A;l++){var I=l-s;if(h.length<l+1)I>1&&l>2&&(I>4?(o+="\n".concat(y,"...").concat(w),u=!0):I>3&&(o+="\n ".concat(c[l-2]),k++),o+="\n ".concat(c[l-1]),k++),s=l,i+="\n".concat(v,"-").concat(w," ").concat(c[l]),k++;else if(c.length<l+1)I>1&&l>2&&(I>4?(o+="\n".concat(y,"...").concat(w),u=!0):I>3&&(o+="\n ".concat(h[l-2]),k++),o+="\n ".concat(h[l-1]),k++),s=l,o+="\n".concat(b,"+").concat(w," ").concat(h[l]),k++;else{var O=c[l],T=h[l],R=T!==O&&(!g(T,",")||T.slice(0,-1)!==O);R&&g(O,",")&&O.slice(0,-1)===T&&(R=!1,T+=","),R?(I>1&&l>2&&(I>4?(o+="\n".concat(y,"...").concat(w),u=!0):I>3&&(o+="\n ".concat(h[l-2]),k++),o+="\n ".concat(h[l-1]),k++),s=l,o+="\n".concat(b,"+").concat(w," ").concat(T),i+="\n".concat(v,"-").concat(w," ").concat(O),k+=2):(o+=i,i="",1!==I&&0!==l||(o+="\n ".concat(T),k++))}if(k>20&&l<A-2)return"".concat(B).concat(P,"\n").concat(o,"\n").concat(y,"...").concat(w).concat(i,"\n")+"".concat(y,"...").concat(w)}return"".concat(B).concat(u?P:"","\n").concat(o).concat(i).concat(a).concat(p)}(f,h,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var p=M[o],S=E(f).split("\n");if("notStrictEqual"===o&&"object"===d(f)&&null!==f&&(p=M.notStrictEqualObject),S.length>30)for(S[26]="".concat(y,"...").concat(w);S.length>27;)S.pop();r=1===S.length?s(this,l(e).call(this,"".concat(p," ").concat(S[0]))):s(this,l(e).call(this,"".concat(p,"\n\n").concat(S.join("\n"),"\n")))}else{var A=E(f),x="",k=M[o];"notDeepEqual"===o||"notEqual"===o?(A="".concat(M[o],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(x="".concat(E(h)),A.length>512&&(A="".concat(A.slice(0,509),"...")),x.length>512&&(x="".concat(x.slice(0,509),"...")),"deepEqual"===o||"equal"===o?A="".concat(k,"\n\n").concat(A,"\n\nshould equal\n\n"):x=" ".concat(o," ").concat(x)),r=s(this,l(e).call(this,"".concat(A).concat(x)))}return Error.stackTraceLimit=c,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=f,r.expected=h,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),u),r.stack,r.name="AssertionError",s(r)}var r,u;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}}),e&&c(t,e)}(e,t),r=e,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(t,e){return p(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){i(t,e,r[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}])&&o(r.prototype,u),e}(u(Error));t.exports=S},2136:(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)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var s,a,u={};function f(t,e,r){r||(r=Error);var s=function(r){function s(r,o,a){var u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(u=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,i(s).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,o,a)))).code=t,u}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}}),e&&o(t,e)}(s,r),s}(r);u[t]=s}function h(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",(function(t,e,i){var o,a,u,f,c;if(void 0===s&&(s=r(9282)),s("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(0,a.length)===a)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))u="The ".concat(t," ").concat(o," ").concat(h(e,"type"));else{var l=("number"!=typeof c&&(c=0),c+".".length>(f=t).length||-1===f.indexOf(".",c)?"argument":"property");u='The "'.concat(t,'" ').concat(l," ").concat(o," ").concat(h(e,"type"))}return u+". Received type ".concat(n(i))}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(9539));var i=a.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===s&&(s=r(9282)),s(e.length>0,"At least one arg needs to be specified");var i="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,o-1).join(", "),i+=", and ".concat(e[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=u},9158:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}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)}var o=void 0!==/a/g.flags,s=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},a=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(609),f=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},h=Number.isNaN?Number.isNaN:r(360);function c(t){return t.call.bind(t)}var l=c(Object.prototype.hasOwnProperty),d=c(Object.prototype.propertyIsEnumerable),p=c(Object.prototype.toString),m=r(9539).types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,b=m.isDate,v=m.isMap,w=m.isRegExp,M=m.isSet,_=m.isNativeError,E=m.isBoxedPrimitive,S=m.isNumberObject,A=m.isStringObject,x=m.isBooleanObject,k=m.isBigIntObject,B=m.isSymbolObject,P=m.isFloat32Array,I=m.isFloat64Array;function O(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function T(t){return Object.keys(t).filter(O).concat(f(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function R(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function N(t,e,r,n){if(t===e)return 0!==t||!r||u(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&h(t)&&h(e);if("object"!==i(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var s,a,f,c,l=p(t);if(l!==p(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var d=T(t),m=T(e);return d.length===m.length&&C(t,e,r,n,1,d)}if("[object Object]"===l&&(!v(t)&&v(e)||!M(t)&&M(e)))return!1;if(b(t)){if(!b(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(f=t,c=e,!(o?f.source===c.source&&f.flags===c.flags:RegExp.prototype.toString.call(f)===RegExp.prototype.toString.call(c))))return!1}else if(_(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(y(t)){if(r||!P(t)&&!I(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===R(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var O=T(t),N=T(e);return O.length===N.length&&C(t,e,r,n,0,O)}if(M(t))return!(!M(e)||t.size!==e.size)&&C(t,e,r,n,2);if(v(t))return!(!v(e)||t.size!==e.size)&&C(t,e,r,n,3);if(g(t)){if(a=e,(s=t).byteLength!==a.byteLength||0!==R(new Uint8Array(s),new Uint8Array(a)))return!1}else if(E(t)&&!function(t,e){return S(t)?S(e)&&u(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):A(t)?A(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):x(t)?x(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):k(t)?k(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):B(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return C(t,e,r,n,0)}function L(t,e){return e.filter((function(e){return d(t,e)}))}function C(t,e,r,n,i,o){if(5===arguments.length){o=Object.keys(t);var s=Object.keys(e);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!l(e,o[a]))return!1;if(r&&5===arguments.length){var u=f(t);if(0!==u.length){var h=0;for(a=0;a<u.length;a++){var c=u[a];if(d(t,c)){if(!d(e,c))return!1;o.push(c),h++}else if(d(e,c))return!1}var p=f(e);if(u.length!==p.length&&L(e,p).length!==h)return!1}else{var m=f(e);if(0!==m.length&&0!==L(e,m).length)return!1}}if(0===o.length&&(0===i||1===i&&0===t.length||0===t.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var g=n.val1.get(t);if(void 0!==g){var y=n.val2.get(e);if(void 0!==y)return g===y}n.position++}n.val1.set(t,n.position),n.val2.set(e,n.position);var b=H(t,e,r,o,n,i);return n.val1.delete(t),n.val2.delete(e),b}function j(t,e,r,n){for(var i=s(t),o=0;o<i.length;o++){var a=i[o];if(N(e,a,r,n))return t.delete(a),!0}return!1}function D(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(h(t))return!1}return!0}function U(t,e,r){var n=D(r);return null!=n?n:e.has(n)&&!t.has(n)}function z(t,e,r,n,i){var o=D(r);if(null!=o)return o;var s=e.get(o);return!(void 0===s&&!e.has(o)||!N(n,s,!1,i))&&!t.has(o)&&N(n,s,!1,i)}function F(t,e,r,n,i,o){for(var a=s(t),u=0;u<a.length;u++){var f=a[u];if(N(r,f,i,o)&&N(n,e.get(f),i,o))return t.delete(f),!0}return!1}function H(t,e,r,o,u,f){var h=0;if(2===f){if(!function(t,e,r,n){for(var o=null,a=s(t),u=0;u<a.length;u++){var f=a[u];if("object"===i(f)&&null!==f)null===o&&(o=new Set),o.add(f);else if(!e.has(f)){if(r)return!1;if(!U(t,e,f))return!1;null===o&&(o=new Set),o.add(f)}}if(null!==o){for(var h=s(e),c=0;c<h.length;c++){var l=h[c];if("object"===i(l)&&null!==l){if(!j(o,l,r,n))return!1}else if(!r&&!t.has(l)&&!j(o,l,r,n))return!1}return 0===o.size}return!0}(t,e,r,u))return!1}else if(3===f){if(!function(t,e,r,o){for(var s=null,u=a(t),f=0;f<u.length;f++){var h=n(u[f],2),c=h[0],l=h[1];if("object"===i(c)&&null!==c)null===s&&(s=new Set),s.add(c);else{var d=e.get(c);if(void 0===d&&!e.has(c)||!N(l,d,r,o)){if(r)return!1;if(!z(t,e,c,l,o))return!1;null===s&&(s=new Set),s.add(c)}}}if(null!==s){for(var p=a(e),m=0;m<p.length;m++){var g=n(p[m],2),y=(c=g[0],g[1]);if("object"===i(c)&&null!==c){if(!F(s,t,c,y,r,o))return!1}else if(!(r||t.has(c)&&N(t.get(c),y,!1,o)||F(s,t,c,y,!1,o)))return!1}return 0===s.size}return!0}(t,e,r,u))return!1}else if(1===f)for(;h<t.length;h++){if(!l(t,h)){if(l(e,h))return!1;for(var c=Object.keys(t);h<c.length;h++){var d=c[h];if(!l(e,d)||!N(t[d],e[d],r,u))return!1}return c.length===Object.keys(e).length}if(!l(e,h)||!N(t[h],e[h],r,u))return!1}for(h=0;h<o.length;h++){var p=o[h];if(!N(t[p],e[p],r,u))return!1}return!0}t.exports={isDeepEqual:function(t,e){return N(t,e,!1)},isDeepStrictEqual:function(t,e){return N(t,e,!0)}}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],f=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[h++]=e>>16&255,f[h++]=e>>8&255,f[h++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[h++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[h++]=e>>8&255,f[h++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(f(t,a,a+s>u?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(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 f(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3550:function(t,e,r){!function(t,e){"use strict";function n(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 o(t,e,r){if(o.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 s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(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 i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.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},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,l=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=l;d++){var p=f-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.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 f=c[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var 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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,f=new t(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),f[a]=s;for(;a<o;a++)f[a]=0}else{for(a=0;a<o-i;a++)f[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),f[o-a-1]=s}return f},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.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},o.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},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.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},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(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()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.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()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.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()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.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 i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(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)},o.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,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,l=h>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,_=0|s[4],E=8191&_,S=_>>>13,A=0|s[5],x=8191&A,k=A>>>13,B=0|s[6],P=8191&B,I=B>>>13,O=0|s[7],T=8191&O,R=O>>>13,N=0|s[8],L=8191&N,C=N>>>13,j=0|s[9],D=8191&j,U=j>>>13,z=0|a[0],F=8191&z,H=z>>>13,q=0|a[1],K=8191&q,G=q>>>13,V=0|a[2],Z=8191&V,W=V>>>13,J=0|a[3],$=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,lt=ht>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(f+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,H))+Math.imul(l,F)|0))<<13)|0;f=((o=Math.imul(l,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,H))+Math.imul(m,F)|0,o=Math.imul(m,H);var yt=(f+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,K)|0))<<13)|0;f=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,H))+Math.imul(b,F)|0,o=Math.imul(b,H),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var bt=(f+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;f=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,H))+Math.imul(M,F)|0,o=Math.imul(M,H),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var vt=(f+(n=n+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,$)|0))<<13)|0;f=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,H))+Math.imul(S,F)|0,o=Math.imul(S,H),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,X)|0;var wt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;f=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,H))+Math.imul(k,F)|0,o=Math.imul(k,H),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;f=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,H))+Math.imul(I,F)|0,o=Math.imul(I,H),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;f=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,H))+Math.imul(R,F)|0,o=Math.imul(R,H),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(l,ut)|0))<<13)|0;f=((o=o+Math.imul(l,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,H))+Math.imul(C,F)|0,o=Math.imul(C,H),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0;var St=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;f=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,H))+Math.imul(U,F)|0,o=Math.imul(U,H),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var At=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;f=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,lt)|0;var xt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,W))+Math.imul(U,Z)|0,o=Math.imul(U,W),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ft)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var kt=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,X))+Math.imul(U,$)|0,o=Math.imul(U,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,lt)|0;var Bt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,lt)|0;var Pt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;f=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Ot=(f+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ft))+Math.imul(U,ut)|0,o=Math.imul(U,ft),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Tt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,lt))+Math.imul(U,ct)|0,o=Math.imul(U,lt);var Rt=(f+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(f+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return f=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=Et,u[8]=St,u[9]=At,u[10]=xt,u[11]=kt,u[12]=Bt,u[13]=Pt,u[14]=It,u[15]=Ot,u[16]=Tt,u[17]=Rt,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,l=f,d=0;d<s;d++){var p=r[h+d],m=n[h+d],g=r[h+d+s],y=n[h+d+s],b=c*g-l*y;y=c*y+l*g,g=b,r[h+d]=p+g,n[h+d]=m+y,r[h+d+s]=p-g,n[h+d+s]=m-y,d!==a&&(b=u*c-f*l,l=u*l+f*c,c=b)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.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,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(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 i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(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)},o.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},o.prototype.isubn=function(t){if(n("number"==typeof t),n(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.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),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.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 i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.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],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new E(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.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},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.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(w,b),i(M,b),i(_,b),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return y[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.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)},E.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},E.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)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(c,new o(1).iushln(p-g-1));l=l.redMul(y),c=y.redSqr(),d=d.redMul(c),p=g}return l},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,E),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.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),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},9931:(t,e,r)=>{var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(9214);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},4497:(t,e,r)=>{var n=r(9509).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,n,i){for(var o,s,a,u,f=r[0],h=r[1],c=r[2],l=r[3],d=t[0]^e[0],p=t[1]^e[1],m=t[2]^e[2],g=t[3]^e[3],y=4,b=1;b<i;b++)o=f[d>>>24]^h[p>>>16&255]^c[m>>>8&255]^l[255&g]^e[y++],s=f[p>>>24]^h[m>>>16&255]^c[g>>>8&255]^l[255&d]^e[y++],a=f[m>>>24]^h[g>>>16&255]^c[d>>>8&255]^l[255&p]^e[y++],u=f[g>>>24]^h[d>>>16&255]^c[p>>>8&255]^l[255&m]^e[y++],d=o,p=s,m=a,g=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&g])^e[y++],s=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[g>>>8&255]<<8|n[255&d])^e[y++],a=(n[m>>>24]<<24|n[g>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[y++],u=(n[g>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[y++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var f=a^a<<1^a<<2^a<<3^a<<4;f=f>>>8^255&f^99,r[s]=f,n[f]=s;var h=t[s],c=t[h],l=t[c],d=257*t[f]^16843008*f;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*l^65537*c^257*h^16843008*s,o[0][f]=d<<24|d>>>8,o[1][f]=d<<16|d>>>16,o[2][f]=d<<8|d>>>24,o[3][f]=d,0===s?s=a=1:(s=h^t[t[t[l^h]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function f(t){this._key=i(t),this._reset()}f.blockSize=16,f.keySize=32,f.prototype.blockSize=f.blockSize,f.prototype.keySize=f.keySize,f.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o<e;o++)i[o]=t[o];for(o=e;o<n;o++){var s=i[o-1];o%e==0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),i[o]=i[o-e]^s}for(var f=[],h=0;h<n;h++){var c=n-h,l=i[c-(h%4?0:4)];f[h]=h<4||c<=4?l:u.INV_SUB_MIX[0][u.SBOX[l>>>24]]^u.INV_SUB_MIX[1][u.SBOX[l>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[l>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=f},f.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},f.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},f.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},f.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=f},2422:(t,e,r)=>{var n=r(4497),i=r(9509).Buffer,o=r(1027),s=r(5717),a=r(3288),u=r(7295),f=r(685);function h(t,e,r,s){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var h=this._cipher.encryptBlock(u);this._ghash=new a(h),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var u=8*o,h=i.alloc(8);h.writeUIntBE(u,0,8),n.update(h),t._finID=n.state;var c=i.from(t._finID);return f(c),c}(this,r,h),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(h,o),h.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},h.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},h.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},h.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=h},4696:(t,e,r)=>{var n=r(1494),i=r(6193),o=r(4946);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},6193:(t,e,r)=>{var n=r(2422),i=r(9509).Buffer,o=r(45),s=r(5969),a=r(1027),u=r(4497),f=r(3048);function h(t,e,r){a.call(this),this._cache=new c,this._last=void 0,this._cipher=new u.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function c(){this.cache=i.allocUnsafe(0)}function l(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new h(a.module,e,r)}r(5717)(h,a),h.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},h.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},c.prototype.add=function(t){this.cache=i.concat([this.cache,t])},c.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=f(e,!1,r.key,r.iv);return l(t,n.key,n.iv)},e.createDecipheriv=l},1494:(t,e,r)=>{var n=r(45),i=r(2422),o=r(9509).Buffer,s=r(5969),a=r(1027),u=r(4497),f=r(3048);function h(t,e,r){a.call(this),this._cache=new l,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(5717)(h,a),h.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var c=o.alloc(16,16);function l(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new h(a.module,e,r)}h.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=o.concat([this.cache,t])},l.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},l.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=d,e.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=f(e,!1,r.key,r.iv);return d(t,i.key,i.iv)}},3288:(t,e,r)=>{var n=r(9509).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},685:t=>{t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},5292:(t,e,r)=>{var n=r(7295);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},6311:(t,e,r)=>{var n=r(9509).Buffer,i=r(7295);function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},1510:(t,e,r)=>{var n=r(9509).Buffer;function i(t,e,r){for(var n,i,s=-1,a=0;++s<8;)n=e&1<<7-s?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>s%8,t._prev=o(t._prev,r?n:i);return a}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},2887:(t,e,r)=>{var n=r(9509).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},6009:(t,e,r)=>{var n=r(7295),i=r(9509).Buffer,o=r(685);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var u=s(t),f=o+16*a;t._cache.writeUInt32BE(u[0],f+0),t._cache.writeUInt32BE(u[1],f+4),t._cache.writeUInt32BE(u[2],f+8),t._cache.writeUInt32BE(u[3],f+12)}var h=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,h)}},1084:(t,e)=>{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},45:(t,e,r)=>{var n={ECB:r(1084),CBC:r(5292),CFB:r(6311),CFB8:r(2887),CFB1:r(1510),OFB:r(8861),CTR:r(6009),GCM:r(6009)},i=r(4946);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},8861:(t,e,r)=>{var n=r(8764).Buffer,i=r(7295);function o(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length<e.length;)t._cache=n.concat([t._cache,o(t)]);var r=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,r)}},5969:(t,e,r)=>{var n=r(4497),i=r(9509).Buffer,o=r(1027);function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}r(5717)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},3614:(t,e,r)=>{var n=r(7667),i=r(4696),o=r(45),s=r(9715),a=r(3048);function u(t,e,r){if(t=t.toLowerCase(),o[t])return i.createCipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function f(t,e,r){if(t=t.toLowerCase(),o[t])return i.createDecipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return u(t,i.key,i.iv)},e.createCipheriv=e.Cipheriv=u,e.createDecipher=e.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return f(t,i.key,i.iv)},e.createDecipheriv=e.Decipheriv=f,e.listCiphers=e.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},7667:(t,e,r)=>{var n=r(1027),i=r(5251),o=r(5717),s=r(9509).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var u=t.iv;s.isBuffer(u)||(u=s.from(u)),this._des=i.create({key:o,iv:u,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=u,o(u,n),u.prototype._update=function(t){return s.from(this._des.update(t))},u.prototype._final=function(){return s.from(this._des.final())}},9715:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},3663:(t,e,r)=>{var n=r(8764).Buffer,i=r(3982),o=r(1798);function s(t){var e,r=t.modulus.byteLength();do{e=new i(o(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,e){var r=function(t){var e=s(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),a=new i(t).mul(r.blinder).umod(e.modulus),u=a.toRed(i.mont(e.prime1)),f=a.toRed(i.mont(e.prime2)),h=e.coefficient,c=e.prime1,l=e.prime2,d=u.redPow(e.exponent1).fromRed(),p=f.redPow(e.exponent2).fromRed(),m=d.isub(p).imul(h).umod(c).imul(l);return p.iadd(m).imul(r.unblinder).umod(e.modulus).toArrayLike(n,"be",o)}a.getr=s,t.exports=a},3982:function(t,e,r){!function(t,e){"use strict";function n(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 o(t,e,r){if(o.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 s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(1922).Buffer}catch(t){}function a(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 n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function f(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var f=t.charCodeAt(u)-48;o*=i,s=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&s<i,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(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 i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.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},o.prototype._move=function(t){h(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){o.prototype.inspect=c}else o.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,l=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=l;d++){var p=f-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.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 f=d[t],h=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var m=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?m+r:l[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var 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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.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},o.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},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.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},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(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()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.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()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.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()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.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 i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(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)},o.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,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,l=h>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,_=0|s[4],E=8191&_,S=_>>>13,A=0|s[5],x=8191&A,k=A>>>13,B=0|s[6],P=8191&B,I=B>>>13,O=0|s[7],T=8191&O,R=O>>>13,N=0|s[8],L=8191&N,C=N>>>13,j=0|s[9],D=8191&j,U=j>>>13,z=0|a[0],F=8191&z,H=z>>>13,q=0|a[1],K=8191&q,G=q>>>13,V=0|a[2],Z=8191&V,W=V>>>13,J=0|a[3],$=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,lt=ht>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(f+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,H))+Math.imul(l,F)|0))<<13)|0;f=((o=Math.imul(l,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,H))+Math.imul(m,F)|0,o=Math.imul(m,H);var yt=(f+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,K)|0))<<13)|0;f=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,H))+Math.imul(b,F)|0,o=Math.imul(b,H),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var bt=(f+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;f=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,H))+Math.imul(M,F)|0,o=Math.imul(M,H),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var vt=(f+(n=n+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,$)|0))<<13)|0;f=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,H))+Math.imul(S,F)|0,o=Math.imul(S,H),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,X)|0;var wt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;f=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,H))+Math.imul(k,F)|0,o=Math.imul(k,H),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;f=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,H))+Math.imul(I,F)|0,o=Math.imul(I,H),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;f=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,H))+Math.imul(R,F)|0,o=Math.imul(R,H),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(l,ut)|0))<<13)|0;f=((o=o+Math.imul(l,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,H))+Math.imul(C,F)|0,o=Math.imul(C,H),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0;var St=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;f=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,H))+Math.imul(U,F)|0,o=Math.imul(U,H),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var At=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;f=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,lt)|0;var xt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,W))+Math.imul(U,Z)|0,o=Math.imul(U,W),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ft)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var kt=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,X))+Math.imul(U,$)|0,o=Math.imul(U,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,lt)|0;var Bt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,lt)|0;var Pt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;f=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Ot=(f+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ft))+Math.imul(U,ut)|0,o=Math.imul(U,ft),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Tt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,lt))+Math.imul(U,ct)|0,o=Math.imul(U,lt);var Rt=(f+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(f+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return f=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=Et,u[8]=St,u[9]=At,u[10]=xt,u[11]=kt,u[12]=Bt,u[13]=Pt,u[14]=It,u[15]=Ot,u[16]=Tt,u[17]=Rt,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(t,e,r){return y(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):b(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,l=f,d=0;d<s;d++){var p=r[h+d],m=n[h+d],g=r[h+d+s],y=n[h+d+s],b=c*g-l*y;y=c*y+l*g,g=b,r[h+d]=p+g,n[h+d]=m+y,r[h+d+s]=p-g,n[h+d+s]=m-y,d!==a&&(b=u*c-f*l,l=u*l+f*c,c=b)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.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,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(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 i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(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)},o.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},o.prototype.isubn=function(t){if(n("number"==typeof t),n(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.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),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.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 i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.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],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.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},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},i(_,M),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.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(E,M),i(S,M),i(A,M),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return w[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(c,new o(1).iushln(p-g-1));l=l.redMul(y),c=y.redSqr(),d=d.redMul(c),p=g}return l},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6042:(t,e,r)=>{t.exports=r(5207)},4743:(t,e,r)=>{var n=r(9509).Buffer,i=r(3482),o=r(8473),s=r(5717),a=r(2957),u=r(7753),f=r(5207);function h(t){o.Writable.call(this);var e=f[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function c(t){o.Writable.call(this);var e=f[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){return new h(t)}function d(t){return new c(t)}Object.keys(f).forEach((function(t){f[t].id=n.from(f[t].id,"hex"),f[t.toLowerCase()]=f[t]})),s(h,o.Writable),h.prototype._write=function(t,e,r){this._hash.update(t),r()},h.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},h.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},s(c,o.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},c.prototype.verify=function(t,e,r){"string"==typeof e&&(e=n.from(e,r)),this.end();var i=this._hash.digest();return u(e,i,t,this._signType,this._tag)},t.exports={Sign:l,Verify:d,createSign:l,createVerify:d}},2957:(t,e,r)=>{var n=r(9509).Buffer,i=r(8355),o=r(3663),s=r(6266).ec,a=r(8815),u=r(980),f=r(1308);function h(t,e,r,o){if((t=n.from(t.toArray())).length<e.byteLength()){var s=n.alloc(e.byteLength()-t.length);t=n.concat([s,t])}var a=r.length,u=function(t,e){t=(t=c(t,e)).mod(e);var r=n.from(t.toArray());if(r.length<e.byteLength()){var i=n.alloc(e.byteLength()-r.length);r=n.concat([i,r])}return r}(r,e),f=n.alloc(a);f.fill(1);var h=n.alloc(a);return h=i(o,h).update(f).update(n.from([0])).update(t).update(u).digest(),f=i(o,h).update(f).digest(),{k:h=i(o,h).update(f).update(n.from([1])).update(t).update(u).digest(),v:f=i(o,h).update(f).digest()}}function c(t,e){var r=new a(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function l(t,e,r){var o,s;do{for(o=n.alloc(0);8*o.length<t.bitLength();)e.v=i(r,e.k).update(e.v).digest(),o=n.concat([o,e.v]);s=c(o,t),e.k=i(r,e.k).update(e.v).update(n.from([0])).digest(),e.v=i(r,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function d(t,e,r,n){return t.toRed(a.mont(r)).redPow(e).fromRed().mod(n)}t.exports=function(t,e,r,i,p){var m=u(e);if(m.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(t,e){var r=f[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new s(r).keyFromPrivate(e.privateKey).sign(t);return n.from(i.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==i)throw new Error("wrong private key type");return function(t,e,r){for(var i,o=e.params.priv_key,s=e.params.p,u=e.params.q,f=e.params.g,p=new a(0),m=c(t,u).mod(u),g=!1,y=h(o,u,t,r);!1===g;)p=d(f,i=l(u,y,r),s,u),0===(g=i.invm(u).imul(m.add(o.mul(p))).mod(u)).cmpn(0)&&(g=!1,p=new a(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),n.from(r)}(p,g)}(t,m,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");t=n.concat([p,t]);for(var g=m.modulus.byteLength(),y=[0,1];t.length+y.length+1<g;)y.push(255);y.push(0);for(var b=-1;++b<t.length;)y.push(t[b]);return o(y,m)},t.exports.getKey=h,t.exports.makeKey=l},7753:(t,e,r)=>{var n=r(9509).Buffer,i=r(8815),o=r(6266).ec,s=r(980),a=r(1308);function u(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,e,r,f,h){var c=s(r);if("ec"===c.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),s=r.data.subjectPrivateKey.data;return i.verify(e,t,s)}(t,e,c)}if("dsa"===c.type){if("dsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,a=r.data.g,f=r.data.pub_key,h=s.signature.decode(t,"der"),c=h.s,l=h.r;u(c,o),u(l,o);var d=i.mont(n),p=c.invm(o);return 0===a.toRed(d).redPow(new i(e).mul(p).mod(o)).fromRed().mul(f.toRed(d).redPow(l.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(l)}(t,e,c)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");e=n.concat([h,e]);for(var l=c.modulus.byteLength(),d=[1],p=0;e.length+d.length+2<l;)d.push(255),p++;d.push(0);for(var m=-1;++m<e.length;)d.push(e[m]);d=n.from(d);var g=i.mont(c.modulus);t=(t=new i(t).toRed(g)).redPow(new i(c.publicExponent)),t=n.from(t.fromRed().toArray());var y=p<8?1:0;for(l=Math.min(t.length,d.length),t.length!==d.length&&(y=1),m=-1;++m<l;)y|=t[m]^d[m];return 0===y}},8815:function(t,e,r){!function(t,e){"use strict";function n(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 o(t,e,r){if(o.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 s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2363).Buffer}catch(t){}function a(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 n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function f(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var f=t.charCodeAt(u)-48;o*=i,s=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&s<i,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(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 i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.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},o.prototype._move=function(t){h(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){o.prototype.inspect=c}else o.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,l=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=l;d++){var p=f-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.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 f=d[t],h=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var m=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?m+r:l[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var 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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.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},o.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},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.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},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(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()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.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()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.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()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.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 i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(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)},o.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,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,l=h>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,_=0|s[4],E=8191&_,S=_>>>13,A=0|s[5],x=8191&A,k=A>>>13,B=0|s[6],P=8191&B,I=B>>>13,O=0|s[7],T=8191&O,R=O>>>13,N=0|s[8],L=8191&N,C=N>>>13,j=0|s[9],D=8191&j,U=j>>>13,z=0|a[0],F=8191&z,H=z>>>13,q=0|a[1],K=8191&q,G=q>>>13,V=0|a[2],Z=8191&V,W=V>>>13,J=0|a[3],$=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,lt=ht>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(f+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,H))+Math.imul(l,F)|0))<<13)|0;f=((o=Math.imul(l,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,H))+Math.imul(m,F)|0,o=Math.imul(m,H);var yt=(f+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,K)|0))<<13)|0;f=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,H))+Math.imul(b,F)|0,o=Math.imul(b,H),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var bt=(f+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;f=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,H))+Math.imul(M,F)|0,o=Math.imul(M,H),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var vt=(f+(n=n+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,$)|0))<<13)|0;f=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,H))+Math.imul(S,F)|0,o=Math.imul(S,H),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,X)|0;var wt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;f=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,H))+Math.imul(k,F)|0,o=Math.imul(k,H),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;f=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,H))+Math.imul(I,F)|0,o=Math.imul(I,H),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;f=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,H))+Math.imul(R,F)|0,o=Math.imul(R,H),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(l,ut)|0))<<13)|0;f=((o=o+Math.imul(l,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,H))+Math.imul(C,F)|0,o=Math.imul(C,H),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0;var St=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;f=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,H))+Math.imul(U,F)|0,o=Math.imul(U,H),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var At=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;f=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,lt)|0;var xt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,W))+Math.imul(U,Z)|0,o=Math.imul(U,W),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ft)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var kt=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,X))+Math.imul(U,$)|0,o=Math.imul(U,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,lt)|0;var Bt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,lt)|0;var Pt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;f=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Ot=(f+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ft))+Math.imul(U,ut)|0,o=Math.imul(U,ft),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Tt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,lt))+Math.imul(U,ct)|0,o=Math.imul(U,lt);var Rt=(f+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(f+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return f=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=Et,u[8]=St,u[9]=At,u[10]=xt,u[11]=kt,u[12]=Bt,u[13]=Pt,u[14]=It,u[15]=Ot,u[16]=Tt,u[17]=Rt,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(t,e,r){return y(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):b(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,l=f,d=0;d<s;d++){var p=r[h+d],m=n[h+d],g=r[h+d+s],y=n[h+d+s],b=c*g-l*y;y=c*y+l*g,g=b,r[h+d]=p+g,n[h+d]=m+y,r[h+d+s]=p-g,n[h+d+s]=m-y,d!==a&&(b=u*c-f*l,l=u*l+f*c,c=b)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.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,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(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 i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(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)},o.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},o.prototype.isubn=function(t){if(n("number"==typeof t),n(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.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),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.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 i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.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],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.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},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},i(_,M),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.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(E,M),i(S,M),i(A,M),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return w[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(c,new o(1).iushln(p-g-1));l=l.redMul(y),c=y.redSqr(),d=d.redMul(c),p=g}return l},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},7295:(t,e,r)=>{var n=r(8764).Buffer;t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new n(r),o=0;o<r;++o)i[o]=t[o]^e[o];return i}},8764:(t,e,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|m(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||$(t.length)?a(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return h(t),a(t<0?0:0|p(t))}function l(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function m(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(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(i)return n?-1:V(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let 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 I(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return B(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 O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=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;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(f(t,o)===f(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(f(t,o+n)!==f(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if($(n))return s;t[r+s]=n}return s}function M(t,e,r,n){return W(V(e,t.length-r),t,r,n)}function _(t,e,r,n){return W(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return W(Z(e),t,r,n)}function S(t,e,r,n){return W(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(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 x(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return c(t)},u.allocUnsafeSlow=function(t){return c(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(J(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let 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},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?x(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),f=this.slice(n,i),h=t.slice(e,r);for(let t=0;t<a;++t)if(f[t]!==h[t]){o=f[t],s=h[t];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},u.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)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function B(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function P(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function I(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=X[t[n]];return i}function O(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function T(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 R(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function L(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function C(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,o){return e=+e,r>>>=0,o||C(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return e=+e,r>>>=0,o||C(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Y((function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Y((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Y((function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Y((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");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("Index out of range");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);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.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),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let 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{const o=u.isBuffer(t)?t:u.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const U={};function z(t,e,r){U[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function F(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function H(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||K(e,t.length-(r+1))}(n,i,o)}function q(t,e){if("number"!=typeof t)throw new U.ERR_INVALID_ARG_TYPE(e,"number",t)}function K(t,e,r){if(Math.floor(t)!==t)throw q(t,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),z("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function V(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},1924:(t,e,r)=>{"use strict";var n=r(210),i=r(5559),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},5559:(t,e,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),f=i("%Object.defineProperty%",!0),h=i("%Math.max%");if(f)try{f({},"a",{value:1})}catch(t){f=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&f){var r=u(e,"length");r.configurable&&f(e,"length",{value:1+h(0,t.length-(arguments.length-1))})}return e};var c=function(){return a(n,o,arguments)};f?f(t.exports,"apply",{value:c}):t.exports.apply=c},1027:(t,e,r)=>{var n=r(9509).Buffer,i=r(2830).Transform,o=r(2553).s;function s(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(5717)(s,i),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=s},4606:(t,e)=>{var r;r=function(t){t.version="1.2.0";var e=function(){for(var t=0,e=new Array(256),r=0;256!=r;++r)t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=r)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1,e[r]=t;return"undefined"!=typeof Int32Array?new Int32Array(e):e}();t.table=e,t.bstr=function(t,r){for(var n=-1^r,i=t.length-1,o=0;o<i;)n=(n=n>>>8^e[255&(n^t.charCodeAt(o++))])>>>8^e[255&(n^t.charCodeAt(o++))];return o===i&&(n=n>>>8^e[255&(n^t.charCodeAt(o))]),-1^n},t.buf=function(t,r){if(t.length>1e4)return function(t,r){for(var n=-1^r,i=t.length-7,o=0;o<i;)n=(n=(n=(n=(n=(n=(n=(n=n>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])];for(;o<i+7;)n=n>>>8^e[255&(n^t[o++])];return-1^n}(t,r);for(var n=-1^r,i=t.length-3,o=0;o<i;)n=(n=(n=(n=n>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])])>>>8^e[255&(n^t[o++])];for(;o<i+3;)n=n>>>8^e[255&(n^t[o++])];return-1^n},t.str=function(t,r){for(var n,i,o=-1^r,s=0,a=t.length;s<a;)(n=t.charCodeAt(s++))<128?o=o>>>8^e[255&(o^n)]:n<2048?o=(o=o>>>8^e[255&(o^(192|n>>6&31))])>>>8^e[255&(o^(128|63&n))]:n>=55296&&n<57344?(n=64+(1023&n),i=1023&t.charCodeAt(s++),o=(o=(o=(o=o>>>8^e[255&(o^(240|n>>8&7))])>>>8^e[255&(o^(128|n>>2&63))])>>>8^e[255&(o^(128|i>>6&15|(3&n)<<4))])>>>8^e[255&(o^(128|63&i))]):o=(o=(o=o>>>8^e[255&(o^(224|n>>12&15))])>>>8^e[255&(o^(128|n>>6&63))])>>>8^e[255&(o^(128|63&n))];return-1^o}},"undefined"==typeof DO_NOT_EXPORT_CRC?r(e):r({})},6393:(t,e,r)=>{var n=r(8764).Buffer,i=r(6266),o=r(3550);t.exports=function(t){return new a(t)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(t){this.curveType=s[t],this.curveType||(this.curveType={name:t}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function u(t,e,r){Array.isArray(t)||(t=t.toArray());var i=new n(t);if(r&&i.length<r){var o=new n(r-i.length);o.fill(0),i=n.concat([o,i])}return e?i.toString(e):i}s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1,a.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},a.prototype.computeSecret=function(t,e,r){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),u(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},a.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),u(r,t)},a.prototype.getPrivateKey=function(t){return u(this.keys.getPrivate(),t)},a.prototype.setPublicKey=function(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this.keys._importPublic(t),this},a.prototype.setPrivateKey=function(t,e){e=e||"utf8",n.isBuffer(t)||(t=new n(t,e));var r=new o(t);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}},3482:(t,e,r)=>{"use strict";var n=r(5717),i=r(2318),o=r(9785),s=r(9072),a=r(1027);function u(t){a.call(this,"digest"),this._hash=t}n(u,a),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(s(t))}},8028:(t,e,r)=>{var n=r(2318);t.exports=function(t){return(new n).update(t).digest()}},8355:(t,e,r)=>{"use strict";var n=r(5717),i=r(1031),o=r(1027),s=r(9509).Buffer,a=r(8028),u=r(9785),f=r(9072),h=s.alloc(128);function c(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>r?e=("rmd160"===t?new u:f(t)).update(e).digest():e.length<r&&(e=s.concat([e,h],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),a=0;a<r;a++)n[a]=54^e[a],i[a]=92^e[a];this._hash="rmd160"===t?new u:f(t),this._hash.update(n)}n(c,o),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new u:f(this._alg)).update(this._opad).update(t).digest()},t.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new c("rmd160",e):"md5"===t?new i(a,e):new c(t,e)}},1031:(t,e,r)=>{"use strict";var n=r(5717),i=r(9509).Buffer,o=r(1027),s=i.alloc(128),a=64;function u(t,e){o.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>a?e=t(e):e.length<a&&(e=i.concat([e,s],a));for(var r=this._ipad=i.allocUnsafe(a),n=this._opad=i.allocUnsafe(a),u=0;u<a;u++)r[u]=54^e[u],n[u]=92^e[u];this._hash=[r]}n(u,o),u.prototype._update=function(t){this._hash.push(t)},u.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},t.exports=u},5835:(t,e,r)=>{"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(1798),e.createHash=e.Hash=r(3482),e.createHmac=e.Hmac=r(8355);var n=r(6042),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var s=r(5632);e.pbkdf2=s.pbkdf2,e.pbkdf2Sync=s.pbkdf2Sync;var a=r(3614);e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var u=r(2607);e.DiffieHellmanGroup=u.DiffieHellmanGroup,e.createDiffieHellmanGroup=u.createDiffieHellmanGroup,e.getDiffieHellman=u.getDiffieHellman,e.createDiffieHellman=u.createDiffieHellman,e.DiffieHellman=u.DiffieHellman;var f=r(4743);e.createSign=f.createSign,e.Sign=f.Sign,e.createVerify=f.createVerify,e.Verify=f.Verify,e.createECDH=r(6393);var h=r(7900);e.publicEncrypt=h.publicEncrypt,e.privateEncrypt=h.privateEncrypt,e.publicDecrypt=h.publicDecrypt,e.privateDecrypt=h.privateDecrypt;var c=r(7963);e.randomFill=c.randomFill,e.randomFillSync=c.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},4289:(t,e,r)=>{"use strict";var n=r(2215),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,u=a&&function(){var t={};try{for(var e in a(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),f=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(u?a(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},h=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a<o.length;a+=1)f(t,o[a],e[o[a]],r[o[a]])};h.supportsDescriptors=!!u,t.exports=h},5251:(t,e,r)=>{"use strict";e.utils=r(1278),e.Cipher=r(5756),e.DES=r(778),e.CBC=r(9051),e.EDE=r(651)},9051:(t,e,r)=>{"use strict";var n=r(9746),i=r(5717),o={};function s(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new s(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];for(o._update.call(this,s,0,r,n),a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{for(o._update.call(this,t,e,r,n),a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},5756:(t,e,r)=>{"use strict";var n=r(9746);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},778:(t,e,r)=>{"use strict";var n=r(9746),i=r(5717),o=r(1278),s=r(5756);function a(){this.tmp=new Array(2),this.keys=null}function u(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}i(u,s),t.exports=u,u.create=function(t){return new u(t)};var f=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=f[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,t.keys,s)}},u.prototype._update=function(t,e,r,n){var i=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},u.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},u.prototype._encrypt=function(t,e,r,n,i){for(var s=e,a=r,u=0;u<t.keys.length;u+=2){var f=t.keys[u],h=t.keys[u+1];o.expand(a,t.tmp,0),f^=t.tmp[0],h^=t.tmp[1];var c=o.substitute(f,h),l=a;a=(s^o.permute(c))>>>0,s=l}o.rip(a,s,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var s=r,a=e,u=t.keys.length-2;u>=0;u-=2){var f=t.keys[u],h=t.keys[u+1];o.expand(s,t.tmp,0),f^=t.tmp[0],h^=t.tmp[1];var c=o.substitute(f,h),l=s;s=(a^o.permute(c))>>>0,a=l}o.rip(s,a,n,i)}},651:(t,e,r)=>{"use strict";var n=r(9746),i=r(5717),o=r(5756),s=r(778);function a(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}i(u,o),t.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},1278:(t,e)=>{"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+s&1,i<<=1,i|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,i){for(var o=0,s=0,a=r.length>>>1,u=0;u<a;u++)o<<=1,o|=t>>>r[u]&1;for(u=a;u<r.length;u++)s<<=1,s|=e>>>r[u]&1;n[i+0]=o>>>0,n[i+1]=s>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(t>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)];return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r<i.length;r++)e<<=1,e|=t>>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],o=0;o<e;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},2607:(t,e,r)=>{var n=r(8764).Buffer,i=r(3590),o=r(9799),s=r(7426),a={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(t){var e=new n(o[t].prime,"hex"),r=new n(o[t].gen,"hex");return new s(e,r)},e.createDiffieHellman=e.DiffieHellman=function t(e,r,o,u){return n.isBuffer(r)||void 0===a[r]?t(e,"binary",r,o):(r=r||"binary",u=u||"binary",o=o||new n([2]),n.isBuffer(o)||(o=new n(o,u)),"number"==typeof e?new s(i(e,o),o,!0):(n.isBuffer(e)||(e=new n(e,r)),new s(e,o,!0)))}},7426:(t,e,r)=>{var n=r(8764).Buffer,i=r(3550),o=new(r(3047)),s=new i(24),a=new i(11),u=new i(10),f=new i(3),h=new i(7),c=r(3590),l=r(1798);function d(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._pub=new i(t),this}function p(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._priv=new i(t),this}t.exports=g;var m={};function g(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=p):this._primeCode=8}function y(t,e){var r=new n(t.toArray());return e?r.toString(e):r}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in m)return m[n];var i,l=0;if(t.isEven()||!c.simpleSieve||!c.fermatTest(t)||!o.test(t))return l+=1,l+="02"===r||"05"===r?8:4,m[n]=l,l;switch(o.test(t.shrn(1))||(l+=2),r){case"02":t.mod(s).cmp(a)&&(l+=8);break;case"05":(i=t.mod(u)).cmp(f)&&i.cmp(h)&&(l+=8);break;default:l+=4}return m[n]=l,l}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new i(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(t){var e=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new n(e.toArray()),o=this.getPrime();if(r.length<o.length){var s=new n(o.length-r.length);s.fill(0),r=n.concat([s,r])}return r},g.prototype.getPublicKey=function(t){return y(this._pub,t)},g.prototype.getPrivateKey=function(t){return y(this._priv,t)},g.prototype.getPrime=function(t){return y(this.__prime,t)},g.prototype.getGenerator=function(t){return y(this._gen,t)},g.prototype.setGenerator=function(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this.__gen=t,this._gen=new i(t),this}},3590:(t,e,r)=>{var n=r(1798);t.exports=b,b.simpleSieve=g,b.fermatTest=y;var i=r(3550),o=new i(24),s=new(r(3047)),a=new i(1),u=new i(2),f=new i(5),h=(new i(16),new i(8),new i(10)),c=new i(3),l=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function m(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<e&&t[i]<=n&&r%t[i]!=0;i++);e!==i&&t[i]<=n||(t[e++]=r)}return p=t,t}function g(t){for(var e=m(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function y(t){var e=i.mont(t);return 0===u.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function b(t,e){if(t<16)return new i(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new i(e);;){for(r=new i(n(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(f))for(;r.mod(h).cmp(c);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&y(p)&&y(r)&&s.test(p)&&s.test(r))return r}}},6215:(t,e,r)=>{"use strict";var n=r(8764).Buffer,i=new(0,r(6266).ec)("secp256k1"),o=r.g.crypto||r.g.msCrypto||{},s=o.subtle||o.webkitSubtle,a=r(5835);const u=n.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),f=n.alloc(32,0);function h(t,e){if(!t)throw new Error(e||"Assertion failed")}function c(t){return e=t,!(!n.isBuffer(e)||32!==e.length)&&t.compare(f)>0&&t.compare(u)<0;var e}function l(t){var e=new Uint8Array(t);return void 0===o.getRandomValues?n.from(a.randomBytes(t)):(o.getRandomValues(e),n.from(e))}function d(t){return new Promise((function(e){var r=a.createHash("sha512").update(t).digest();e(new Uint8Array(r))}))}function p(t){return function(e,r,i){return new Promise((function(o){if(s)return s.importKey("raw",r,{name:"AES-CBC"},!1,[t]).then((function(r){var n={name:"AES-CBC",iv:e};return s[t](n,r,i)})).then((function(t){o(n.from(new Uint8Array(t)))}));if("encrypt"===t){var u=a.createCipheriv("aes-256-cbc",r,e);let t=u.update(i),s=u.final();o(n.concat([t,s]))}else if("decrypt"===t){var f=a.createDecipheriv("aes-256-cbc",r,e);let t=f.update(i),s=f.final();o(n.concat([t,s]))}}))}}var m=p("encrypt"),g=p("decrypt"),y=function(t,e){return new Promise((function(r){h(n.isBuffer(t),"Bad private key"),h(n.isBuffer(e),"Bad public key"),h(32===t.length,"Bad private key"),h(c(t),"Bad private key"),h(65===e.length||33===e.length,"Bad public key"),65===e.length&&h(4===e[0],"Bad public key"),33===e.length&&h(2===e[0]||3===e[0],"Bad public key");var o=i.keyFromPrivate(t),s=i.keyFromPublic(e),a=o.derive(s.getPublic());r(n.from(a.toArray()))}))};e.HI=function(t,e,r){var o,s,u,f;return r=r||{},new Promise((function(e){for(var o=r.ephemPrivateKey||l(32);!c(o);)o=r.ephemPrivateKey||l(32);var a;h(32===(a=o).length,"Bad private key"),h(c(a),"Bad private key"),s=n.from(i.keyFromPrivate(a).getPublic("arr")),e(y(o,t))})).then((function(t){return d(t)})).then((function(t){o=r.iv||l(16);var n=t.slice(0,32);return f=t.slice(32),m(o,n,e)})).then((function(t){u=t;var e=n.concat([o,s,u]);return function(t,e){return new Promise((function(r){var i=a.createHmac("sha256",n.from(t));i.update(e),r(i.digest())}))}(f,e)})).then((function(t){return{iv:o,ephemPublicKey:s,ciphertext:u,mac:t}}))},e.pe=function(t,e){var r;return y(t,e.ephemPublicKey).then((function(t){return d(t)})).then((function(t){r=t.slice(0,32);var i,o,s,u=t.slice(32),f=n.concat([e.iv,e.ephemPublicKey,e.ciphertext]);return i=u,o=f,s=e.mac,new Promise((function(t){var e=a.createHmac("sha256",n.from(i));e.update(o),t(function(t,e){if(t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r}(e.digest(),s))}))})).then((function(t){return h(t,"Bad MAC"),g(e.iv,r,e.ciphertext)})).then((function(t){return n.from(new Uint8Array(t))}))}},6266:(t,e,r)=>{"use strict";var n=e;n.version=r(8597).i8,n.utils=r(953),n.rand=r(9931),n.curve=r(8254),n.curves=r(5427),n.ec=r(7954),n.eddsa=r(5980)},4918:(t,e,r)=>{"use strict";var n=r(3550),i=r(953),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(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))}function f(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,u,f=[];for(s=0;s<n.length;s+=r.step){u=0;for(var h=s+r.step-1;h>=s;h--)u=(u<<1)+n[h];f.push(u)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s<f.length;s++)(u=f[s])===d?l=l.mixedAdd(r.points[s]):u===-d&&(l=l.mixedAdd(r.points[s].neg()));c=c.add(l)}return c.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),f=s.length-1;f>=0;f--){for(var h=0;f>=0&&0===s[f];f--)h++;if(f>=0&&h++,u=u.dblp(h),f<0)break;var c=s[f];a(0!==c),u="affine"===t.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var a,u,f,h=this._wnafT1,c=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<n;a++){var p=(f=e[a])._getNAFPoints(t);h[a]=p.wnd,c[a]=p.points}for(a=n-1;a>=1;a-=2){var m=a-1,g=a;if(1===h[m]&&1===h[g]){var y=[e[m],null,null,e[g]];0===e[m].y.cmp(e[g].y)?(y[1]=e[m].add(e[g]),y[2]=e[m].toJ().mixedAdd(e[g].neg())):0===e[m].y.cmp(e[g].y.redNeg())?(y[1]=e[m].toJ().mixedAdd(e[g]),y[2]=e[m].add(e[g].neg())):(y[1]=e[m].toJ().mixedAdd(e[g]),y[2]=e[m].toJ().mixedAdd(e[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[m],r[g]);for(d=Math.max(v[0].length,d),l[m]=new Array(d),l[g]=new Array(d),u=0;u<d;u++){var w=0|v[0][u],M=0|v[1][u];l[m][u]=b[3*(w+1)+(M+1)],l[g][u]=0,c[m]=y}}else l[m]=o(r[m],h[m],this._bitLength),l[g]=o(r[g],h[g],this._bitLength),d=Math.max(l[m].length,d),d=Math.max(l[g].length,d)}var _=this.jpoint(null,null,null),E=this._wnafT4;for(a=d;a>=0;a--){for(var S=0;a>=0;){var A=!0;for(u=0;u<n;u++)E[u]=0|l[u][a],0!==E[u]&&(A=!1);if(!A)break;S++,a--}if(a>=0&&S++,_=_.dblp(S),a<0)break;for(u=0;u<n;u++){var x=E[u];0!==x&&(x>0?f=c[u][x-1>>1]:x<0&&(f=c[u][-x-1>>1].neg()),_="affine"===f.type?_.mixedAdd(f):_.add(f))}}for(a=0;a<n;a++)c[a]=null;return i?_:_.toP()},u.BasePoint=f,f.prototype.eq=function(){throw new Error("Not implemented")},f.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.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]?a(t[t.length-1]%2==0):7===t[0]&&a(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")},f.prototype.encodeCompressed=function(t){return this.encode(t,!0)},f.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))},f.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},f.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},f.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)},f.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},f.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(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},f.prototype._getBeta=function(){return null},f.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},1138:(t,e,r)=>{"use strict";var n=r(953),i=r(3550),o=r(5717),s=r(4918),a=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function f(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(f,s.BasePoint),u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new f(this,t,e,r,n)},f.fromJSON=function(t,e){return new f(t,e[0],e[1],e[2])},f.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)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),u=i.redMul(s),f=o.redMul(a),h=i.redMul(a),c=s.redMul(o);return this.curve.point(u,f,c,h)},f.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var f=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(t=s.redSub(a).redSub(u).redMul(f.redSub(this.curve.two)),e=f.redMul(n.redSub(u)),r=f.redSqr().redSub(f).redSub(f)):(i=this.z.redSqr(),o=f.redSub(i).redISub(i),t=s.redSub(a).redISub(u).redMul(o),e=f.redMul(n.redSub(u)),r=f.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(t,e,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(e),f=o.redMul(s),h=a.redMul(u),c=o.redMul(u),l=s.redMul(a);return this.curve.point(f,h,l,c)},f.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),f=i.redAdd(a),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),c=n.redMul(u).redMul(h);return this.curve.twisted?(e=n.redMul(f).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(f)):(e=n.redMul(f).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(c,e,r)},f.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},f.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},f.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},f.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},8254:(t,e,r)=>{"use strict";var n=e;n.base=r(4918),n.short=r(6673),n.mont=r(2881),n.edwards=r(1138)},2881:(t,e,r)=>{"use strict";var n=r(3550),i=r(5717),o=r(4918),s=r(953);function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new u(this,t,e)},a.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),u=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:(t,e,r)=>{"use strict";var n=r(953),i=r(3550),o=r(5717),s=r(4918),a=n.assert;function u(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(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)}function f(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(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 i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(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 i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,f,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new i(1),m=new i(0),g=new i(0),y=new i(1),b=0;0!==l.cmpn(0);){var v=d.div(l);f=d.sub(v.mul(l)),h=g.sub(v.mul(p));var w=y.sub(v.mul(m));if(!n&&f.cmp(c)<0)e=u.neg(),r=p,n=f.neg(),o=h;else if(n&&2==++b)break;u=f,d=l,l=f,g=p,p=h,y=m,m=w}s=f.neg(),a=h;var M=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(M)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(f).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(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 o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var f=this._wnafMulAdd(1,n,i,2*o,r),h=0;h<2*o;h++)n[h]=null,i[h]=null;return f},o(f,s.BasePoint),u.prototype.point=function(t,e,r){return new f(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return f.fromJSON(this,t,e)},f.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}},f.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]},f.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 i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},f.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)+">"},f.prototype.isInfinity=function(){return this.inf},f.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)},f.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(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(t){return t=new i(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)},f.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.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))},f.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},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.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)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.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),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),h=f.redMul(a),c=n.redMul(f),l=u.redSqr().redIAdd(h).redISub(c).redISub(c),d=u.redMul(c.redISub(l)).redISub(o.redMul(h)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},h.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),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),h=r.redMul(u),c=a.redSqr().redIAdd(f).redISub(h).redISub(h),l=a.redMul(h.redISub(c)).redISub(i.redMul(f)),d=this.z.redMul(s);return this.curve.jpoint(c,l,d)},h.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,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),f=s.redAdd(s);for(e=0;e<t;e++){var h=o.redSqr(),c=f.redSqr(),l=c.redSqr(),d=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(u)),p=o.redMul(c),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=d.redMul(g);y=y.redIAdd(y).redISub(l);var b=f.redMul(a);e+1<t&&(u=u.redMul(l)),o=m,a=b,f=y}return this.curve.jpoint(o,f.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),t=u,e=a.redMul(s.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),c=this.y.redSqr(),l=c.redSqr(),d=this.x.redAdd(c).redSqr().redISub(h).redISub(l);d=d.redIAdd(d);var p=h.redAdd(h).redIAdd(h),m=p.redSqr(),g=l.redIAdd(l);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},h.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),e=a.redMul(s.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),c=this.y.redSqr(),l=this.x.redMul(c),d=this.x.redSub(h).redMul(this.x.redAdd(h));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),m=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(h);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},h.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),f=(u=u.redIAdd(u)).redMul(s),h=a.redSqr().redISub(f.redAdd(f)),c=f.redISub(h),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(c).redISub(l),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,d,p)},h.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(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),h=e.redMul(f);h=(h=h.redIAdd(h)).redIAdd(h);var c=this.x.redMul(a).redISub(h);c=(c=c.redIAdd(c)).redIAdd(c);var l=this.y.redMul(f.redMul(u.redISub(f)).redISub(s.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(c,l,d)},h.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},h.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),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},h.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(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.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)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},5427:(t,e,r)=>{"use strict";var n,i=e,o=r(3715),s=r(8254),a=r(953).assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:o.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"]}),f("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:o.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),f("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(1037)}catch(t){n=void 0}f("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},7954:(t,e,r)=>{"use strict";var n=r(3550),i=r(2156),o=r(953),s=r(5427),a=r(9931),u=o.assert,f=r(1251),h=r(611);function c(t){if(!(this instanceof c))return new c(t);"string"==typeof t&&(u(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.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}t.exports=c,c.prototype.keyPair=function(t){return new f(this,t)},c.prototype.keyFromPrivate=function(t,e){return f.fromPrivate(this,t,e)},c.prototype.keyFromPublic=function(t,e){return f.fromPublic(this,t,e)},c.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},c.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},c.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),u=t.toArray("be",s),f=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),c=this.n.sub(new n(1)),l=0;;l++){var d=o.k?o.k(l):new n(f.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(c)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var y=d.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new h({r:g,s:y,recoveryParam:b})}}}}}},c.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new h(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),f=u.mul(t).umod(this.n),c=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(f,r.getPublic(),c)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(f,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new h(e,i);var o=this.n,s=new n(t),a=e.r,f=e.s,c=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=f.mul(d).umod(o);return this.g.mulAdd(p,a,m)},c.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new h(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},1251:(t,e,r)=>{"use strict";var n=r(3550),i=r(953).assert;function o(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)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.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"}},o.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},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(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)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},611:(t,e,r)=>{"use strict";var n=r(3550),i=r(953),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(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 i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function f(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 h(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)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=u(t,r);if(!1===s)return!1;var f=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var h=u(t,r);if(!1===h)return!1;if(t.length!==h+r.place)return!1;var c=t.slice(r.place,h+r.place);if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new n(f),this.s=new n(c),this.recoveryParam=null,!0},s.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=f(e),r=f(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];h(n,e.length),(n=n.concat(e)).push(2),h(n,r.length);var o=n.concat(r),s=[48];return h(s,o.length),s=s.concat(o),i.encode(s,t)}},5980:(t,e,r)=>{"use strict";var n=r(3715),i=r(5427),o=r(953),s=o.assert,a=o.parseBytes,u=r(9087),f=r(3622);function h(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof h))return new h(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=h,h.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},h.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},h.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},h.prototype.makeSignature=function(t){return t instanceof f?t:new f(this,t)},h.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},h.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},h.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(t){return o.intFromLE(t)},h.prototype.isPoint=function(t){return t instanceof this.pointClass}},9087:(t,e,r)=>{"use strict";var n=r(953),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=a},3622:(t,e,r)=>{"use strict";var n=r(3550),i=r(953),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},1037:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},953:(t,e,r)=>{"use strict";var n=e,i=r(3550),o=r(9746),s=r(4504);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,f=e.andln(3)+o&3;3===u&&(u=-1),3===f&&(f=-1),s=0==(1&u)?0:3!=(n=t.andln(7)+i&7)&&5!==n||2!==f?u:-u,r[0].push(s),a=0==(1&f)?0:3!=(n=e.andln(7)+o&7)&&5!==n||2!==u?f:-f,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},8091:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var u=o[s],f=Object.getOwnPropertyDescriptor(i,u);void 0!==f&&f.enumerable&&(r[u]=i[u])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},6818:(t,e,r)=>{"use strict";r.r(e),r.d(e,{calculateContractAddress:()=>Pr,cipher:()=>o,createIdentity:()=>M,decryptWithPrivateKey:()=>T,default:()=>Hr,encryptWithPublicKey:()=>N,hash:()=>s,hex:()=>a,publicKey:()=>i,publicKeyByPrivateKey:()=>m,recover:()=>C,recoverPublicKey:()=>L,sign:()=>D,signTransaction:()=>F,txDataByCompiled:()=>Br,util:()=>n,vrs:()=>u});var n={};r.r(n),r.d(n,{addLeading0x:()=>l,hexToUnit8Array:()=>p,removeLeading0x:()=>c,uint8ArrayToHex:()=>d});var i={};r.r(i),r.d(i,{compress:()=>S,decompress:()=>A,toAddress:()=>x});var o={};r.r(o),r.d(o,{parse:()=>I,stringify:()=>P});var s={};r.r(s),r.d(s,{SIGN_PREFIX:()=>Cr,keccak256:()=>Lr});var a={};r.r(a),r.d(a,{compress:()=>Dr,decompress:()=>Ur});var u={};r.r(u),r.d(u,{fromString:()=>zr,toString:()=>Fr});var f=r(7093),h=r(8764).Buffer;function c(t){return t.startsWith("0x")?t.substring(2):t}function l(t){return t.startsWith("0x")?t:"0x"+t}function d(t){return h.from(t).toString("hex")}function p(t){return new Uint8Array(h.from(t,"hex"))}function m(t){return t=l(t),(0,f.privateToPublic)((0,f.toBuffer)(t)).toString("hex")}var g=r(3608),y=r(1538),b=r(9494),v=r.n(b),w=r(8764).Buffer;function M(t){var e=function(t){if(t){if(!w.isBuffer(t))throw new Error("EthCrypto.createPrivateKey(): given entropy is no Buffer");if(w.byteLength(t,"utf8")<128)throw new Error("EthCrypto.createPrivateKey(): Entropy-size must be at least 128");return(0,y.keccak256)(t)}var e=(0,y.keccak256)(v().concat(v().random(32),v().random(32))),r=v().concat(v().concat(v().random(32),e),v().random(32));return(0,y.keccak256)(r)}(t),r=(0,g.fromPrivate)(e);return r.publicKey=m(r.privateKey),r}var _=r(7221),E=r(8764).Buffer;function S(t){return 64===E.from(t,"hex").length&&(t="04"+t),d((0,_.publicKeyConvert)(p(t),!0))}function A(t){64===E.from(t,"hex").length&&(t="04"+t);var e=d((0,_.publicKeyConvert)(p(t),!1));return e.substring(2)}function x(t){t=A(t);var e=(0,f.pubToAddress)((0,f.toBuffer)(l(t)));return(0,f.toChecksumAddress)(l(e.toString("hex")))}var k=r(6215),B=r(8764).Buffer;function P(t){if("string"==typeof t)return t;var e=S(t.ephemPublicKey);return B.concat([B.from(t.iv,"hex"),B.from(e,"hex"),B.from(t.mac,"hex"),B.from(t.ciphertext,"hex")]).toString("hex")}function I(t){if("string"!=typeof t)return t;var e=B.from(t,"hex"),r={iv:e.toString("hex",0,16),ephemPublicKey:e.toString("hex",16,49),mac:e.toString("hex",49,81),ciphertext:e.toString("hex",81,e.length)};return r.ephemPublicKey="04"+A(r.ephemPublicKey),r}var O=r(8764).Buffer;function T(t,e){e=I(e);var r=c(t),n={iv:O.from(e.iv,"hex"),ephemPublicKey:O.from(e.ephemPublicKey,"hex"),ciphertext:O.from(e.ciphertext,"hex"),mac:O.from(e.mac,"hex")};return(0,k.pe)(O.from(r,"hex"),n).then((function(t){return t.toString()}))}var R=r(8764).Buffer;function N(t,e){var r="04"+(t=A(t));return(0,k.HI)(R.from(r,"hex"),R.from(e)).then((function(t){return{iv:t.iv.toString("hex"),ephemPublicKey:t.ephemPublicKey.toString("hex"),ciphertext:t.ciphertext.toString("hex"),mac:t.mac.toString("hex")}}))}function L(t,e){var r=(t=c(t)).substring(0,t.length-2),n="1c"===t.slice(-2)?1:0,i=d((0,_.ecdsaRecover)(p(r),n,p(c(e)),!1));return i.slice(2)}function C(t,e){return x(L(t,e))}var j=r(8764).Buffer;function D(t,e){if(66!==(e=l(e)).length)throw new Error("EthCrypto.sign(): Can only sign hashes, given: "+e);var r=(0,_.ecdsaSign)(new Uint8Array(j.from(c(e),"hex")),new Uint8Array(j.from(c(t),"hex"))),n=1===r.recid?"1c":"1b";return"0x"+j.from(r.signature).toString("hex")+n}var U=r(6052),z=r(8764).Buffer;function F(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=m(e),i=x(n);if(i!=t.from)throw new Error("EthCrypto.signTransaction(): rawTx.from does not match the address of the privateKey");var o=z.from(e.replace(/^.{2}/g,""),"hex"),s=U.Transaction.fromTxData(t,r),a=s.sign(o),u=a.serialize().toString("hex");return u}let H=!1,q=!1;const K={debug:1,default:2,info:2,warning:3,error:4,off:5};let G=K.default,V=null;const Z=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((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}();var W,J;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(W||(W={})),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"}(J||(J={}));class ${constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==K[r]&&this.throwArgumentError("invalid log level name","logLevel",t),G>K[r]||console.log.apply(console,e)}debug(...t){this._log($.levels.DEBUG,t)}info(...t){this._log($.levels.INFO,t)}warn(...t){this._log($.levels.WARNING,t)}makeError(t,e,r){if(q)return this.makeError("censored error",e,{});e||(e=$.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((t=>{try{n.push(t+"="+JSON.stringify(r[t]))}catch(e){n.push(t+"="+JSON.stringify(r[t].toString()))}})),n.push(`code=${e}`),n.push(`version=${this.version}`);const i=t;n.length&&(t+=" ("+n.join(", ")+")");const o=new Error(t);return o.reason=i,o.code=e,Object.keys(r).forEach((function(t){o[t]=r[t]})),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,$.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),Z&&this.throwError("platform missing String.prototype.normalize",$.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Z})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,$.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,$.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",t<e&&this.throwError("missing argument"+r,$.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+r,$.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",$.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",$.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",$.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return V||(V=new $("logger/5.4.0")),V}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",$.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),H){if(!t)return;this.globalLogger().throwError("error censorship permanent",$.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}q=!!t,H=!!e}static setLogLevel(t){const e=K[t.toLowerCase()];null!=e?G=e:$.globalLogger().warn("invalid log level - "+t)}static from(t){return new $(t)}}$.errors=J,$.levels=W;const X=new $("bytes/5.4.0");function Y(t){return!!t.toHexString}function Q(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Q(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function tt(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(null==t.length)return!1;for(let e=0;e<t.length;e++){const r=t[e];if("number"!=typeof r||r<0||r>=256||r%1)return!1}return!0}function et(t,e){if(e||(e={}),"number"==typeof t){X.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),Q(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Y(t)&&(t=t.toHexString()),it(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0x0"+r.substring(2):"right"===e.hexPad?r+="0":X.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let t=0;t<r.length;t+=2)n.push(parseInt(r.substring(t,t+2),16));return Q(new Uint8Array(n))}return tt(t)?Q(new Uint8Array(t)):X.throwArgumentError("invalid arrayify value","value",t)}function rt(t){const e=t.map((t=>et(t))),r=e.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(r);return e.reduce(((t,e)=>(n.set(e,t),t+e.length)),0),Q(n)}function nt(t,e){(t=et(t)).length>e&&X.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Q(r)}function it(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const ot="0123456789abcdef";function st(t,e){if(e||(e={}),"number"==typeof t){X.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=ot[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"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),Y(t))return t.toHexString();if(it(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":X.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(tt(t)){let e="0x";for(let r=0;r<t.length;r++){let n=t[r];e+=ot[(240&n)>>4]+ot[15&n]}return e}return X.throwArgumentError("invalid hexlify value","value",t)}function at(t,e,r){return"string"!=typeof t?t=st(t):(!it(t)||t.length%2)&&X.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function ut(t,e){for("string"!=typeof t?t=st(t):it(t)||X.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&X.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}var ft=r(3550),ht=r.n(ft)().BN;const ct=new $("bignumber/5.4.0"),lt={},dt=9007199254740991;let pt=!1;class mt{constructor(t,e){ct.checkNew(new.target,mt),t!==lt&&ct.throwError("cannot call constructor directly; use BigNumber.from",$.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return yt(bt(this).fromTwos(t))}toTwos(t){return yt(bt(this).toTwos(t))}abs(){return"-"===this._hex[0]?mt.from(this._hex.substring(1)):this}add(t){return yt(bt(this).add(bt(t)))}sub(t){return yt(bt(this).sub(bt(t)))}div(t){return mt.from(t).isZero()&&vt("division by zero","div"),yt(bt(this).div(bt(t)))}mul(t){return yt(bt(this).mul(bt(t)))}mod(t){const e=bt(t);return e.isNeg()&&vt("cannot modulo negative values","mod"),yt(bt(this).umod(e))}pow(t){const e=bt(t);return e.isNeg()&&vt("cannot raise to negative values","pow"),yt(bt(this).pow(e))}and(t){const e=bt(t);return(this.isNegative()||e.isNeg())&&vt("cannot 'and' negative values","and"),yt(bt(this).and(e))}or(t){const e=bt(t);return(this.isNegative()||e.isNeg())&&vt("cannot 'or' negative values","or"),yt(bt(this).or(e))}xor(t){const e=bt(t);return(this.isNegative()||e.isNeg())&&vt("cannot 'xor' negative values","xor"),yt(bt(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&vt("cannot mask negative values","mask"),yt(bt(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&vt("cannot shift negative values","shl"),yt(bt(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&vt("cannot shift negative values","shr"),yt(bt(this).shrn(t))}eq(t){return bt(this).eq(bt(t))}lt(t){return bt(this).lt(bt(t))}lte(t){return bt(this).lte(bt(t))}gt(t){return bt(this).gt(bt(t))}gte(t){return bt(this).gte(bt(t))}isNegative(){return"-"===this._hex[0]}isZero(){return bt(this).isZero()}toNumber(){try{return bt(this).toNumber()}catch(t){vt("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return ct.throwError("this platform does not support BigInt",$.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?pt||(pt=!0,ct.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?ct.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",$.errors.UNEXPECTED_ARGUMENT,{}):ct.throwError("BigNumber.toString does not accept parameters",$.errors.UNEXPECTED_ARGUMENT,{})),bt(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof mt)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new mt(lt,gt(t)):t.match(/^-?[0-9]+$/)?new mt(lt,gt(new ht(t))):ct.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&vt("underflow","BigNumber.from",t),(t>=dt||t<=-dt)&&vt("overflow","BigNumber.from",t),mt.from(String(t));const e=t;if("bigint"==typeof e)return mt.from(e.toString());if(tt(e))return mt.from(st(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return mt.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(it(t)||"-"===t[0]&&it(t.substring(1))))return mt.from(t)}return ct.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function gt(t){if("string"!=typeof t)return gt(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&ct.throwArgumentError("invalid hex","value",t),"0x00"===(t=gt(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 yt(t){return mt.from(gt(t))}function bt(t){const e=mt.from(t).toHexString();return"-"===e[0]?new ht("-"+e.substring(3),16):new ht(e.substring(2),16)}function vt(t,e,r){const n={fault:t,operation:e};return null!=r&&(n.value=r),ct.throwError(t,$.errors.NUMERIC_FAULT,n)}const wt=new $("properties/5.4.0");function Mt(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function _t(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!=typeof t.prototype)break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function Et(t){return e=this,r=void 0,i=function*(){const e=Object.keys(t).map((e=>{const r=t[e];return Promise.resolve(r).then((t=>({key:e,value:t})))}));return(yield Promise.all(e)).reduce(((t,e)=>(t[e.key]=e.value,t)),{})},new((n=void 0)||(n=Promise))((function(t,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(s,a)}u((i=i.apply(e,r||[])).next())}));var e,r,n,i}function St(t){const e={};for(const r in t)e[r]=t[r];return e}const At={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function xt(t){if(null==t||At[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;r<e.length;r++)if(!xt(t[e[r]]))return!1;return!0}return wt.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function kt(t){if(xt(t))return t;if(Array.isArray(t))return Object.freeze(t.map((t=>Bt(t))));if("object"==typeof t){const e={};for(const r in t){const n=t[r];void 0!==n&&Mt(e,r,Bt(n))}return e}return wt.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function Bt(t){return kt(t)}class Pt{constructor(t){for(const e in t)this[e]=Bt(t[e])}}const It="abi/5.4.0",Ot=new $(It);class Tt{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){Ot.throwArgumentError(t,this.localName,e)}}class Rt{constructor(t){Mt(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return function(t){let e="0x";return t.forEach((t=>{e+=st(t).substring(2)})),e}(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData(rt(t._data))}writeBytes(t){let e=et(t);const r=e.length%this.wordSize;return r&&(e=rt([e,this._padding.slice(r)])),this._writeData(e)}_getValue(t){let e=et(mt.from(t));return e.length>this.wordSize&&Ot.throwError("value out-of-bounds",$.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=rt([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class Nt{constructor(t,e,r,n){Mt(this,"_data",et(t)),Mt(this,"wordSize",e||32),Mt(this,"_coerceFunc",r),Mt(this,"allowLoose",n),this._offset=0}get data(){return st(this._data)}get consumed(){return this._offset}static coerce(t,e){let r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):Nt.coerce(t,e)}_peekBytes(t,e,r){let 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:Ot.throwError("data out-of-bounds",$.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new Nt(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}readValue(){return mt.from(this.readBytes(this.wordSize))}}var Lt=r(4867),Ct=r.n(Lt);function jt(t){return"0x"+Ct().keccak_256(et(t))}const Dt=new $("rlp/5.4.0");function Ut(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function zt(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(zt(t))})),e.length<=55)return e.unshift(192+e.length),e;const r=Ut(e.length);return r.unshift(247+r.length),r.concat(e)}var e;it(e=t)&&!(e.length%2)||tt(e)||Dt.throwArgumentError("RLP object must be BytesLike","object",t);const r=Array.prototype.slice.call(et(t));if(1===r.length&&r[0]<=127)return r;if(r.length<=55)return r.unshift(128+r.length),r;const n=Ut(r.length);return n.unshift(183+n.length),n.concat(r)}const Ft=new $("address/5.4.0");function Ht(t){it(t,20)||Ft.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const n=et(jt(r));for(let t=0;t<40;t+=2)n[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&n[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const qt={};for(let t=0;t<10;t++)qt[String(t)]=String(t);for(let t=0;t<26;t++)qt[String.fromCharCode(65+t)]=String(10+t);const Kt=Math.floor((Gt=9007199254740991,Math.log10?Math.log10(Gt):Math.log(Gt)/Math.LN10));var Gt;function Vt(t){let e=null;if("string"!=typeof t&&Ft.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=Ht(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Ft.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)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>qt[t])).join("");for(;e.length>=Kt;){let t=e.substring(0,Kt);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&Ft.throwArgumentError("bad icap checksum","address",t),r=t.substring(4),e=new ht(r,36).toString(16);e.length<40;)e="0"+e;e=Ht("0x"+e)}else Ft.throwArgumentError("invalid address","address",t);var r;return e}function Zt(t){let e=null;try{e=Vt(t.from)}catch(e){Ft.throwArgumentError("missing from address","transaction",t)}return Vt(at(jt(st(zt([e,function(t){let e=et(t);if(0===e.length)return e;let r=0;for(;r<e.length&&0===e[r];)r++;return r&&(e=e.slice(r)),e}(et(mt.from(t.nonce).toHexString()))]))),12))}const Wt=new $("strings/5.4.0");var Jt,$t;function Xt(t,e,r,n,i){if(t===$t.BAD_PREFIX||t===$t.UNEXPECTED_CONTINUE){let t=0;for(let n=e+1;n<r.length&&r[n]>>6==2;n++)t++;return t}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"}(Jt||(Jt={})),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={}));const Yt=Object.freeze({error:function(t,e,r,n,i){return Wt.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:Xt,replace:function(t,e,r,n,i){return t===$t.OVERLONG?(n.push(i),0):(n.push(65533),Xt(t,e,r))}});function Qt(t,e=Jt.current){e!=Jt.current&&(Wt.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e<t.length;e++){const n=t.charCodeAt(e);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return et(r)}function te(t,e){return function(t,e){null==e&&(e=Yt.error),t=et(t);const r=[];let n=0;for(;n<t.length;){const i=t[n++];if(i>>7==0){r.push(i);continue}let o=null,s=null;if(192==(224&i))o=1,s=127;else if(224==(240&i))o=2,s=2047;else{if(240!=(248&i)){n+=e(128==(192&i)?$t.UNEXPECTED_CONTINUE:$t.BAD_PREFIX,n-1,t,r);continue}o=3,s=65535}if(n-1+o>=t.length){n+=e($t.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-o-1)-1;for(let i=0;i<o;i++){let i=t[n];if(128!=(192&i)){n+=e($t.MISSING_CONTINUE,n,t,r),a=null;break}a=a<<6|63&i,n++}null!==a&&(a>1114111?n+=e($t.OUT_OF_RANGE,n-1-o,t,r,a):a>=55296&&a<=57343?n+=e($t.UTF16_SURROGATE,n-1-o,t,r,a):a<=s?n+=e($t.OVERLONG,n-1-o,t,r,a):r.push(a))}return r}(t,e).map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function ee(t){return jt(Qt(t))}class re extends Tt{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{Vt(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return Vt(ut(t.readValue().toHexString(),20))}}class ne extends Tt{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const ie=new $(It);function oe(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let t={};n=e.map((e=>{const n=e.localName;return n||ie.throwError("cannot encode object for signature with missing names",$.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]&&ie.throwError("cannot encode object for signature with duplicate names",$.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]=!0,r[n]}))}else ie.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&ie.throwArgumentError("types/value length mismatch","tuple",r);let i=new Rt(t.wordSize),o=new Rt(t.wordSize),s=[];e.forEach(((t,e)=>{let r=n[e];if(t.dynamic){let e=o.length;t.encode(o,r);let n=i.writeUpdatableValue();s.push((t=>{n(t+e)}))}else t.encode(i,r)})),s.forEach((t=>{t(i.length)}));let a=t.appendWriter(i);return a+=t.appendWriter(o),a}function se(t,e){let r=[],n=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let r=t.readValue(),o=n.subReader(r.toNumber());try{i=e.decode(o)}catch(t){if(t.code===$.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===$.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&r.push(i)}));const i=e.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach(((t,e)=>{let n=t.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[e];o instanceof Error?Object.defineProperty(r,n,{get:()=>{throw o}}):r[n]=o}));for(let t=0;t<r.length;t++){const e=r[t];e instanceof Error&&Object.defineProperty(r,t,{get:()=>{throw e}})}return Object.freeze(r)}class ae extends Tt{constructor(t,e,r){super("array",t.type+"["+(e>=0?e:"")+"]",r,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let r=0;r<this.length;r++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),ie.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let t=0;t<e.length;t++)n.push(this.coder);return oe(t,n,e)}decode(t){let e=this.length;-1===e&&(e=t.readValue().toNumber(),32*e>t._data.length&&ie.throwError("insufficient data length",$.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let r=[];for(let t=0;t<e;t++)r.push(new ne(this.coder));return t.coerce(this.name,se(t,r))}}class ue extends Tt{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class fe extends Tt{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=et(e);let r=t.writeValue(e.length);return r+=t.writeBytes(e),r}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class he extends fe{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,st(super.decode(t)))}}class ce extends Tt{constructor(t,e){let r="bytes"+String(t);super(r,r,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let r=et(e);return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return t.coerce(this.name,st(t.readBytes(this.size)))}}class le extends Tt{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}const de=mt.from(-1),pe=mt.from(0),me=mt.from(1),ge=mt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class ye extends Tt{constructor(t,e,r){const n=(e?"int":"uint")+8*t;super(n,n,r,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let r=mt.from(e),n=ge.mask(8*t.wordSize);if(this.signed){let t=n.mask(8*this.size-1);(r.gt(t)||r.lt(t.add(me).mul(de)))&&this._throwError("value out-of-bounds",e)}else(r.lt(pe)||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)}decode(t){let e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}class be extends fe{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,Qt(e))}decode(t){return te(super.decode(t))}}class ve extends Tt{constructor(t,e){let r=!1;const n=[];t.forEach((t=>{t.dynamic&&(r=!0),n.push(t.type)})),super("tuple","tuple("+n.join(",")+")",e,r),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))})),Object.freeze(t)}encode(t,e){return oe(t,this.coders,e)}decode(t){return t.coerce(this.name,se(t,this.coders))}}const we=new $(It),Me={};let _e={calldata:!0,memory:!0,storage:!0},Ee={calldata:!0,memory:!0};function Se(t,e){if("bytes"===t||"string"===t){if(_e[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&Ee[e])return!0;return(_e[e]||"payable"===e)&&we.throwArgumentError("invalid modifier","name",e),!1}function Ae(t,e){for(let r in e)Mt(t,r,e[r])}const xe=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ke=new RegExp(/^(.*)\[([0-9]*)\]$/);class Be{constructor(t,e){t!==Me&&we.throwError("use fromString",$.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ae(this,e);let r=this.type.match(ke);Ae(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Be.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=xe.sighash),xe[t]||we.throwArgumentError("invalid format type","format",t),t===xe.json){let 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((e=>JSON.parse(e.format(t))))),JSON.stringify(e)}let e="";return"array"===this.baseType?(e+=this.arrayChildren.format(t),e+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==xe.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===xe.full?", ":",")+")"):e+=this.type,t!==xe.sighash&&(!0===this.indexed&&(e+=" indexed"),t===xe.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?Be.fromString(t,e):Be.fromObject(t)}static fromObject(t){return Be.isParamType(t)?t:new Be(Me,{name:t.name||null,type:Ue(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(Be.fromObject):null})}static fromString(t,e){return r=function(t,e){let r=t;function n(e){we.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function i(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let r=0;r<t.length;r++){let o=t[r];switch(o){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(r),s.state.allowType=!1,s.type=Ue(s.type),s.components=[i(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(e||n(r),s.indexed=!0,s.name=""),Se(s.type,s.name)&&(s.name=""),s.type=Ue(s.type);let t=s;s=s.parent,s||n(r),delete t.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(e||n(r),s.indexed=!0,s.name=""),Se(s.type,s.name)&&(s.name=""),s.type=Ue(s.type);let a=i(s.parent);s.parent.components.push(a),delete s.parent,s=a;break;case" ":s.state.allowType&&""!==s.type&&(s.type=Ue(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(e||n(r),s.indexed&&n(r),s.indexed=!0,s.name=""):Se(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(r),s.type+=o,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(r),s.type+=o,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=o,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=o,delete s.state.allowArray):s.state.readArray?s.type+=o:n(r)}}return s.parent&&we.throwArgumentError("unexpected eof","param",t),delete o.state,"indexed"===s.name?(e||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):Se(s.type,s.name)&&(s.name=""),o.type=Ue(o.type),o}(t,!!e),Be.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(t){return!(null==t||!t._isParamType)}}function Pe(t,e){return function(t){t=t.trim();let e=[],r="",n=0;for(let i=0;i<t.length;i++){let o=t[i];","===o&&0===n?(e.push(r),r=""):(r+=o,"("===o?n++:")"===o&&(n--,-1===n&&we.throwArgumentError("unbalanced parenthesis","value",t)))}return r&&e.push(r),e}(t).map((t=>Be.fromString(t,e)))}class Ie{constructor(t,e){t!==Me&&we.throwError("use a static from method",$.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ae(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return Ie.isFragment(t)?t:"string"==typeof t?Ie.fromString(t):Ie.fromObject(t)}static fromObject(t){if(Ie.isFragment(t))return t;switch(t.type){case"function":return Ce.fromObject(t);case"event":return Oe.fromObject(t);case"constructor":return Le.fromObject(t);case"error":return De.fromObject(t);case"fallback":case"receive":return null}return we.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Oe.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?Ce.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?Le.fromString(t.trim()):"error"===t.split(" ")[0]?De.fromString(t.substring(5).trim()):we.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!(!t||!t._isFragment)}}class Oe extends Ie{format(t){if(t||(t=xe.sighash),xe[t]||we.throwArgumentError("invalid format type","format",t),t===xe.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==xe.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===xe.full?", ":",")+") ",t!==xe.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?Oe.fromString(t):Oe.fromObject(t)}static fromObject(t){if(Oe.isEventFragment(t))return t;"event"!==t.type&&we.throwArgumentError("invalid event object","value",t);const e={name:Fe(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Be.fromObject):[],type:"event"};return new Oe(Me,e)}static fromString(t){let e=t.match(He);e||we.throwArgumentError("invalid event string","value",t);let r=!1;return e[3].split(" ").forEach((t=>{switch(t.trim()){case"anonymous":r=!0;break;case"":break;default:we.warn("unknown modifier: "+t)}})),Oe.fromObject({name:e[1].trim(),anonymous:r,inputs:Pe(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function Te(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&we.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||we.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=mt.from(r[1]),r[0]):t}function Re(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((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 Ne(t){let 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&&we.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&we.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||we.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&&we.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&&we.throwArgumentError("unable to determine stateMutability","value",t),e}class Le extends Ie{format(t){if(t||(t=xe.sighash),xe[t]||we.throwArgumentError("invalid format type","format",t),t===xe.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((e=>JSON.parse(e.format(t))))});t===xe.sighash&&we.throwError("cannot format a constructor for sighash",$.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map((e=>e.format(t))).join(t===xe.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?Le.fromString(t):Le.fromObject(t)}static fromObject(t){if(Le.isConstructorFragment(t))return t;"constructor"!==t.type&&we.throwArgumentError("invalid constructor object","value",t);let e=Ne(t);e.constant&&we.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Be.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?mt.from(t.gas):null};return new Le(Me,r)}static fromString(t){let e={type:"constructor"},r=(t=Te(t,e)).match(He);return r&&"constructor"===r[1].trim()||we.throwArgumentError("invalid constructor string","value",t),e.inputs=Pe(r[2].trim(),!1),Re(r[3].trim(),e),Le.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class Ce extends Le{format(t){if(t||(t=xe.sighash),xe[t]||we.throwArgumentError("invalid format type","format",t),t===xe.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((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==xe.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===xe.full?", ":",")+") ",t!==xe.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((e=>e.format(t))).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?Ce.fromString(t):Ce.fromObject(t)}static fromObject(t){if(Ce.isFunctionFragment(t))return t;"function"!==t.type&&we.throwArgumentError("invalid function object","value",t);let e=Ne(t);const r={type:t.type,name:Fe(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(Be.fromObject):[],outputs:t.outputs?t.outputs.map(Be.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?mt.from(t.gas):null};return new Ce(Me,r)}static fromString(t){let e={type:"function"},r=(t=Te(t,e)).split(" returns ");r.length>2&&we.throwArgumentError("invalid function string","value",t);let n=r[0].match(He);if(n||we.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&Fe(e.name),e.inputs=Pe(n[2],!1),Re(n[3].trim(),e),r.length>1){let n=r[1].match(He);""==n[1].trim()&&""==n[3].trim()||we.throwArgumentError("unexpected tokens","value",t),e.outputs=Pe(n[2],!1)}else e.outputs=[];return Ce.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function je(t){const e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||we.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class De extends Ie{format(t){if(t||(t=xe.sighash),xe[t]||we.throwArgumentError("invalid format type","format",t),t===xe.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==xe.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===xe.full?", ":",")+") ",e.trim()}static from(t){return"string"==typeof t?De.fromString(t):De.fromObject(t)}static fromObject(t){if(De.isErrorFragment(t))return t;"error"!==t.type&&we.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:Fe(t.name),inputs:t.inputs?t.inputs.map(Be.fromObject):[]};return je(new De(Me,e))}static fromString(t){let e={type:"error"},r=t.match(He);return r||we.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&Fe(e.name),e.inputs=Pe(r[2],!1),je(De.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function Ue(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const ze=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Fe(t){return t&&t.match(ze)||we.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const He=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),qe=new $(It),Ke=new RegExp(/^bytes([0-9]*)$/),Ge=new RegExp(/^(u?int)([0-9]*)$/);class Ve{constructor(t){qe.checkNew(new.target,Ve),Mt(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new re(t.name);case"bool":return new ue(t.name);case"string":return new be(t.name);case"bytes":return new he(t.name);case"array":return new ae(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new ve((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new le(t.name)}let e=t.type.match(Ge);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&qe.throwArgumentError("invalid "+e[1]+" bit length","param",t),new ye(r/8,"int"===e[1],t.name)}if(e=t.type.match(Ke),e){let r=parseInt(e[1]);return(0===r||r>32)&&qe.throwArgumentError("invalid bytes length","param",t),new ce(r,t.name)}return qe.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new Nt(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new Rt(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(Be.from(t))));return new ve(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&qe.throwError("types/values length mismatch",$.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const r=t.map((t=>this._getCoder(Be.from(t)))),n=new ve(r,"_"),i=this._getWriter();return n.encode(i,e),i.data}decode(t,e,r){const n=t.map((t=>this._getCoder(Be.from(t))));return new ve(n,"_").decode(this._getReader(et(e),r))}}const Ze=new Ve,We=new $(It);class Je extends Pt{}class $e extends Pt{}class Xe extends Pt{}class Ye extends Pt{static isIndexed(t){return!(!t||!t._isIndexed)}}const Qe={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function tr(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class er{constructor(t){We.checkNew(new.target,er);let e=[];e="string"==typeof t?JSON.parse(t):t,Mt(this,"fragments",e.map((t=>Ie.from(t))).filter((t=>null!=t))),Mt(this,"_abiCoder",_t(new.target,"getAbiCoder")()),Mt(this,"functions",{}),Mt(this,"errors",{}),Mt(this,"events",{}),Mt(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void We.warn("duplicate definition - constructor"):void Mt(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let r=t.format();e[r]?We.warn("duplicate definition - "+r):e[r]=t})),this.deploy||Mt(this,"deploy",Le.from({payable:!1,type:"constructor"})),Mt(this,"_isInterface",!0)}format(t){t||(t=xe.full),t===xe.sighash&&We.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===xe.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return Ze}static getAddress(t){return Vt(t)}static getSighash(t){return at(ee(t.format()),0,4)}static getEventTopic(t){return ee(t.format())}getFunction(t){if(it(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];We.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===r.length?We.throwArgumentError("no matching function","name",e):r.length>1&&We.throwArgumentError("multiple matching functions","name",e),this.functions[r[0]]}const e=this.functions[Ce.fromString(t).format()];return e||We.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(it(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];We.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===r.length?We.throwArgumentError("no matching event","name",e):r.length>1&&We.throwArgumentError("multiple matching events","name",e),this.events[r[0]]}const e=this.events[Oe.fromString(t).format()];return e||We.throwArgumentError("no matching event","signature",t),e}getError(t){if(it(t)){const e=_t(this.constructor,"getSighash");for(const r in this.errors)if(t===e(this.errors[r]))return this.errors[r];We.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===r.length?We.throwArgumentError("no matching error","name",e):r.length>1&&We.throwArgumentError("multiple matching errors","name",e),this.errors[r[0]]}const e=this.errors[Ce.fromString(t).format()];return e||We.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return _t(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),_t(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const r=et(e);return st(r.slice(0,4))!==this.getSighash(t)&&We.throwArgumentError(`data signature does not match error ${t.name}.`,"data",st(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),st(rt([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const r=et(e);return st(r.slice(0,4))!==this.getSighash(t)&&We.throwArgumentError(`data signature does not match function ${t.name}.`,"data",st(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),st(rt([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=et(e),n=null,i=null,o=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(t){}break;case 4:{const t=st(r.slice(0,4)),e=Qe[t];if(e)i=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,s=e.signature,e.reason&&(n=i[0]);else try{const e=this.getError(t);i=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,s=e.format()}catch(t){console.log(t)}break}}return We.throwError("call revert exception",$.errors.CALL_EXCEPTION,{method:t.format(),errorArgs:i,errorName:o,errorSignature:s,reason:n})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),st(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&We.throwError("too many arguments for "+t.format(),$.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));const n=(t,e)=>"string"===t.type?ee(e):"bytes"===t.type?jt(st(e)):("address"===t.type&&this._abiCoder.encode(["address"],[e]),ut(st(e),32));for(e.forEach(((e,i)=>{let o=t.inputs[i];o.indexed?null==e?r.push(null):"array"===o.baseType||"tuple"===o.baseType?We.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?r.push(e.map((t=>n(o,t)))):r.push(n(o,e)):null!=e&&We.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const r=[],n=[],i=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&We.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,o)=>{const s=e[o];if(t.indexed)if("string"===t.type)r.push(ee(s));else if("bytes"===t.type)r.push(jt(s));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([t.type],[s]))}else n.push(t),i.push(s)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){let e=this.getEventTopic(t);it(r[0],32)&&r[0].toLowerCase()===e||We.throwError("fragment/topic mismatch",$.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(n.push(Be.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(n.push(t),o.push(!1)):(i.push(t),o.push(!1))}));let s=null!=r?this._abiCoder.decode(n,rt(r)):null,a=this._abiCoder.decode(i,e,!0),u=[],f=0,h=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==s)u[e]=new Ye({_isIndexed:!0,hash:null});else if(o[e])u[e]=new Ye({_isIndexed:!0,hash:s[h++]});else try{u[e]=s[h++]}catch(t){u[e]=t}else try{u[e]=a[f++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const r=u[e];r instanceof Error?Object.defineProperty(u,t.name,{get:()=>{throw tr(`property ${JSON.stringify(t.name)}`,r)}}):u[t.name]=r}}));for(let t=0;t<u.length;t++){const e=u[t];e instanceof Error&&Object.defineProperty(u,t,{get:()=>{throw tr(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new $e({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:mt.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new Je({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=st(t);let r=this.getError(e.substring(0,10).toLowerCase());return r?new Xe({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(t){return!(!t||!t._isInterface)}}const rr=new $("abstract-provider/5.4.0");class nr{constructor(){rr.checkAbstract(new.target,nr),Mt(this,"_isProvider",!0)}getFeeData(){return t=this,e=void 0,n=function*(){const{block:t,gasPrice:e}=yield Et({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let r=null,n=null;return t&&t.baseFeePerGas&&(n=mt.from("1000000000"),r=t.baseFeePerGas.mul(2).add(n)),{maxFeePerGas:r,maxPriorityFeePerGas:n,gasPrice:e}},new((r=void 0)||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}));var t,e,r,n}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}var ir=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const or=new $("abstract-signer/5.4.0"),sr=["accessList","chainId","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],ar=[$.errors.INSUFFICIENT_FUNDS,$.errors.NONCE_EXPIRED,$.errors.REPLACEMENT_UNDERPRICED];class ur{constructor(){or.checkAbstract(new.target,ur),Mt(this,"_isSigner",!0)}getBalance(t){return ir(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return ir(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return ir(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield Et(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return ir(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield Et(this.checkTransaction(t));return yield this.provider.call(r,e)}))}sendTransaction(t){return this._checkProvider("sendTransaction"),this.populateTransaction(t).then((t=>this.signTransaction(t).then((t=>this.provider.sendTransaction(t)))))}getChainId(){return ir(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return ir(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return ir(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return ir(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const e in t)-1===sr.indexOf(e)&&or.throwArgumentError("invalid transaction key: "+e,"transaction",t);const e=St(t);return null==e.from?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then((e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&or.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return ir(this,void 0,void 0,(function*(){const e=yield Et(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>ir(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&or.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})))));const r=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null==e.gasPrice||2!==e.type&&!r?0!==e.type&&1!==e.type||!r||or.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):or.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==e.type&&null!=e.type||null==e.maxFeePerGas||null==e.maxPriorityFeePerGas)if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(null==e.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(e.type=2,null!=e.gasPrice){const t=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=t,e.maxPriorityFeePerGas=t}else null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(r&&or.throwError("network does not support EIP-1559",$.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):or.throwError("failed to get consistent fee data",$.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else e.type=2;return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch((t=>{if(ar.indexOf(t.code)>=0)throw t;return or.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",$.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})}))),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then((e=>(0!==e[1]&&e[0]!==e[1]&&or.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield Et(e)}))}_checkProvider(t){this.provider||or.throwError("missing provider",$.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}class fr extends ur{constructor(t,e){or.checkNew(new.target,fr),super(),Mt(this,"address",t),Mt(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then((()=>{or.throwError(t,$.errors.UNSUPPORTED_OPERATION,{operation:e})}))}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new fr(this.address,t)}}const hr=new $("transactions/5.4.0");var cr;function lr(t,e){return{address:Vt(t),storageKeys:(e||[]).map(((e,r)=>(32!==function(t){if("string"!=typeof t)t=st(t);else if(!it(t)||t.length%2)return null;return(t.length-2)/2}(e)&&hr.throwArgumentError("invalid access list storageKey",`accessList[${t}:${r}]`,e),e.toLowerCase())))}}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(cr||(cr={}));var dr=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const pr=new $("contracts/5.4.0"),mr={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};function gr(t,e){return dr(this,void 0,void 0,(function*(){const r=yield e;try{return Vt(r)}catch(t){}t||pr.throwError("a provider or signer is needed to resolve ENS names",$.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return null==n&&pr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function yr(t,e,r){return dr(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>yr(t,Array.isArray(e)?e[n]:e[r.name],r)))):"address"===r.type?yield gr(t,e):"tuple"===r.type?yield yr(t,e,r.components):"array"===r.baseType?Array.isArray(e)?yield Promise.all(e.map((e=>yr(t,e,r.arrayChildren)))):Promise.reject(new Error("invalid value for array")):e}))}function br(t,e,r){return dr(this,void 0,void 0,(function*(){let n={};r.length===e.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=St(r.pop())),pr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=Et({override:gr(t.signer,n.from),signer:t.signer.getAddress()}).then((t=>dr(this,void 0,void 0,(function*(){return Vt(t.signer)!==t.override&&pr.throwError("Contract with a Signer cannot override from",$.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})))):n.from=t.signer.getAddress():n.from&&(n.from=gr(t.provider,n.from));const i=yield Et({args:yr(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:Et(n)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},a=i.overrides;if(null!=a.nonce&&(s.nonce=mt.from(a.nonce).toNumber()),null!=a.gasLimit&&(s.gasLimit=mt.from(a.gasLimit)),null!=a.gasPrice&&(s.gasPrice=mt.from(a.gasPrice)),null!=a.maxFeePerGas&&(s.maxFeePerGas=mt.from(a.maxFeePerGas)),null!=a.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=mt.from(a.maxPriorityFeePerGas)),null!=a.from&&(s.from=a.from),null!=a.type&&(s.type=a.type),null!=a.accessList&&(s.accessList=function(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&hr.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),lr(t[0],t[1])):lr(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const r=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return lr(e,Object.keys(r).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}(a.accessList)),null==s.gasLimit&&null!=e.gas){let t=21e3;const r=et(o);for(let e=0;e<r.length;e++)t+=4,r[e]&&(t+=64);s.gasLimit=mt.from(e.gas).add(t)}if(a.value){const t=mt.from(a.value);t.isZero()||e.payable||pr.throwError("non-payable method cannot override value",$.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),s.value=t}delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas;const u=Object.keys(n).filter((t=>null!=n[t]));return u.length&&pr.throwError(`cannot override ${u.map((t=>JSON.stringify(t))).join(",")}`,$.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),s}))}function vr(t,e,r){const n=t.signer||t.provider;return function(...i){return dr(this,void 0,void 0,(function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){const t=St(i.pop());null!=t.blockTag&&(o=yield t.blockTag),delete t.blockTag,i.push(t)}null!=t.deployTransaction&&(yield t._deployed(o));const s=yield br(t,e,i),a=yield n.call(s,o);try{let n=t.interface.decodeFunctionResult(e,a);return r&&1===e.outputs.length&&(n=n[0]),n}catch(e){throw e.code===$.errors.CALL_EXCEPTION&&(e.address=t.address,e.args=i,e.transaction=s),e}}))}}function wr(t,e,r){return e.constant?vr(t,e,r):function(t,e){return function(...r){return dr(this,void 0,void 0,(function*(){t.signer||pr.throwError("sending a transaction requires a signer",$.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());const n=yield br(t,e,r),i=yield t.signer.sendTransaction(n),o=i.wait.bind(i);return i.wait=e=>o(e).then((e=>(e.events=e.logs.map((r=>{let n=Bt(r),i=null;try{i=t.interface.parseLog(r)}catch(t){}return i&&(n.args=i.args,n.decode=(e,r)=>t.interface.decodeEventLog(i.eventFragment,e,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>t.provider,n.getBlock=()=>t.provider.getBlock(e.blockHash),n.getTransaction=()=>t.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(e),n})),e))),i}))}}(t,e)}function Mr(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((t=>Array.isArray(t)?t.join("|"):t)).join(":"):""):"*"}class _r{constructor(t,e){Mt(this,"tag",t),Mt(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter((r=>!(!e&&r.listener===t&&(e=!0,1))))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((t=>t.listener))}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter((e=>{const r=t.slice();return setTimeout((()=>{e.listener.apply(this,r)}),0),!e.once})),e}prepareEvent(t){}getEmit(t){return[t]}}class Er extends _r{constructor(){super("error",null)}}class Sr extends _r{constructor(t,e,r,n){const i={address:t};let o=e.getEventTopic(r);n?(o!==n[0]&&pr.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Mr(i),i),Mt(this,"address",t),Mt(this,"interface",e),Mt(this,"fragment",r)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=function(t){const e=[],r=function(t,n){if(Array.isArray(n))for(let i in n){const o=t.slice();o.push(i);try{r(o,n[i])}catch(t){e.push({path:o,error:t})}}};return r([],t),e}(t.args);if(e.length)throw e[0].error;const r=(t.args||[]).slice();return r.push(t),r}}class Ar extends _r{constructor(t,e){super("*",{address:t}),Mt(this,"address",t),Mt(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,r)=>this.interface.decodeEventLog(e.eventFragment,t,r),t.args=e.args}catch(t){}}}class xr extends class{constructor(t,e,r){pr.checkNew(new.target,xr),Mt(this,"interface",_t(new.target,"getInterface")(e)),null==r?(Mt(this,"provider",null),Mt(this,"signer",null)):ur.isSigner(r)?(Mt(this,"provider",r.provider||null),Mt(this,"signer",r)):nr.isProvider(r)?(Mt(this,"provider",r),Mt(this,"signer",null)):pr.throwArgumentError("invalid signer or provider","signerOrProvider",r),Mt(this,"callStatic",{}),Mt(this,"estimateGas",{}),Mt(this,"functions",{}),Mt(this,"populateTransaction",{}),Mt(this,"filters",{});{const t={};Object.keys(this.interface.events).forEach((e=>{const r=this.interface.events[e];Mt(this.filters,e,((...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,t)}))),t[r.name]||(t[r.name]=[]),t[r.name].push(e)})),Object.keys(t).forEach((e=>{const r=t[e];1===r.length?Mt(this.filters,e,this.filters[r[0]]):pr.warn(`Duplicate definition of ${e} (${r.join(", ")})`)}))}if(Mt(this,"_runningEvents",{}),Mt(this,"_wrappedEmits",{}),null==t&&pr.throwArgumentError("invalid contract address or ENS name","addressOrName",t),Mt(this,"address",t),this.provider)Mt(this,"resolvedAddress",gr(this.provider,t));else try{Mt(this,"resolvedAddress",Promise.resolve(Vt(t)))}catch(t){pr.throwError("provider is required to use ENS name as contract address",$.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}const n={},i={};Object.keys(this.interface.functions).forEach((t=>{const e=this.interface.functions[t];if(i[t])pr.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);else{i[t]=!0;{const r=e.name;n[r]||(n[r]=[]),n[r].push(t)}null==this[t]&&Mt(this,t,wr(this,e,!0)),null==this.functions[t]&&Mt(this.functions,t,wr(this,e,!1)),null==this.callStatic[t]&&Mt(this.callStatic,t,vr(this,e,!0)),null==this.populateTransaction[t]&&Mt(this.populateTransaction,t,function(t,e){return function(...r){return br(t,e,r)}}(this,e)),null==this.estimateGas[t]&&Mt(this.estimateGas,t,function(t,e){const r=t.signer||t.provider;return function(...n){return dr(this,void 0,void 0,(function*(){r||pr.throwError("estimate require a provider or signer",$.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield br(t,e,n);return yield r.estimateGas(i)}))}}(this,e))}})),Object.keys(n).forEach((t=>{const e=n[t];if(e.length>1)return;const r=e[0];try{null==this[t]&&Mt(this,t,this[r])}catch(t){}null==this.functions[t]&&Mt(this.functions,t,this.functions[r]),null==this.callStatic[t]&&Mt(this.callStatic,t,this.callStatic[r]),null==this.populateTransaction[t]&&Mt(this.populateTransaction,t,this.populateTransaction[r]),null==this.estimateGas[t]&&Mt(this.estimateGas,t,this.estimateGas[r])}))}static getContractAddress(t){return Zt(t)}static getInterface(t){return er.isInterface(t)?t:new er(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,t).then((t=>("0x"===t&&pr.throwError("contract not deployed",$.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(t){this.signer||pr.throwError("sending a transactions require a signer",$.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=St(t||{});return["from","to"].forEach((function(t){null!=e[t]&&pr.throwError("cannot override "+t,$.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(e)))}connect(t){"string"==typeof t&&(t=new fr(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&Mt(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return Ye.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new Er);if("event"===t)return this._normalizeRunningEvent(new _r("event",null));if("*"===t)return this._normalizeRunningEvent(new Ar(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new Sr(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const e=t.topics[0];if("string"!=typeof e)throw new Error("invalid topic");const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new Sr(this.address,this.interface,r,t.topics))}catch(t){}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new _r(Mr(e),e))}return this._normalizeRunningEvent(new Ar(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,r){const n=Bt(e);return n.removeListener=()=>{r&&(t.removeListener(r),this._checkRunningEvents(t))},n.getBlock=()=>this.provider.getBlock(e.blockHash),n.getTransaction=()=>this.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(n),n}_addEventListener(t,e,r){if(this.provider||pr.throwError("events require a provider or a signer with a provider",$.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const r=r=>{let n=this._wrapEvent(t,r,e);if(null==n.decodeError)try{const e=t.getEmit(n);this.emit(t.filter,...e)}catch(t){n.decodeError=t.error}null!=t.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[t.tag]=r,null!=t.filter&&this.provider.on(t.filter,r)}}queryFilter(t,e,r){const n=this._getRunningEvent(t),i=St(n.filter);return"string"==typeof e&&it(e,32)?(null!=r&&pr.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((t=>t.map((t=>this._wrapEvent(n,t,null)))))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const r=this._getRunningEvent(t),n=r.run(e)>0;return this._checkRunningEvents(r),n}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce(((t,e)=>t+this._runningEvents[e].listenerCount()),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){const t=[];for(let e in this._runningEvents)this._runningEvents[e].listeners().forEach((e=>{t.push(e)}));return t}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(const t in this._runningEvents){const e=this._runningEvents[t];e.removeAllListeners(),this._checkRunningEvents(e)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}removeListener(t,e){return this.off(t,e)}}{}class kr{constructor(t,e,r){let n=null;n="string"==typeof e?e:tt(e)?st(e):e&&"string"==typeof e.object?e.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!it(n)||n.length%2)&&pr.throwArgumentError("invalid bytecode","bytecode",e),r&&!ur.isSigner(r)&&pr.throwArgumentError("invalid signer","signer",r),Mt(this,"bytecode",n),Mt(this,"interface",_t(new.target,"getInterface")(t)),Mt(this,"signer",r||null)}getDeployTransaction(...t){let e={};if(t.length===this.interface.deploy.inputs.length+1&&"object"==typeof t[t.length-1]){e=St(t.pop());for(const t in e)if(!mr[t])throw new Error("unknown transaction override "+t)}return["data","from","to"].forEach((t=>{null!=e[t]&&pr.throwError("cannot override "+t,$.errors.UNSUPPORTED_OPERATION,{operation:t})})),pr.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=st(rt([this.bytecode,this.interface.encodeDeploy(t)])),e}deploy(...t){return dr(this,void 0,void 0,(function*(){let e={};t.length===this.interface.deploy.inputs.length+1&&(e=t.pop()),pr.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield yr(this.signer,t,this.interface.deploy.inputs);r.push(e);const n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=_t(this.constructor,"getContractAddress")(i),s=_t(this.constructor,"getContract")(o,this.interface,this.signer);return Mt(s,"deployTransaction",i),s}))}attach(t){return this.constructor.getContract(t,this.interface,this.signer)}connect(t){return new this.constructor(this.interface,this.bytecode,t)}static fromSolidity(t,e){null==t&&pr.throwError("missing compiler output",$.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));const r=t.abi;let n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}static getInterface(t){return xr.getInterface(t)}static getContractAddress(t){return Zt(t)}static getContract(t,e,r){return new xr(t,e,r)}}function Br(t,e,r){"string"==typeof t&&(t=JSON.parse(t));var n=new kr(t,"0x"+e);return n.getDeployTransaction.apply(n,r).data}function Pr(t,e){var r=(0,f.generateAddress)((0,f.toBuffer)(l(t)),(0,f.toBuffer)(e)).toString("hex");return(0,f.toChecksumAddress)(l(r))}const Ir=new RegExp("^bytes([0-9]+)$"),Or=new RegExp("^(u?int)([0-9]*)$"),Tr=new RegExp("^(.*)\\[([0-9]*)\\]$");function Rr(t,e,r){switch(t){case"address":return r?nt(e,32):et(e);case"string":return Qt(e);case"bytes":return et(e);case"bool":return e=e?"0x01":"0x00",r?nt(e,32):et(e)}let n=t.match(Or);if(n){let i=parseInt(n[2]||"256");if(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)throw new Error("invalid number type - "+t);return r&&(i=256),nt(e=mt.from(e).toTwos(i),i/8)}if(n=t.match(Ir),n){const i=parseInt(n[1]);if(String(i)!==n[1]||0===i||i>32)throw new Error("invalid bytes type - "+t);if(et(e).byteLength!==i)throw new Error("invalid value for "+t);return r?et((e+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):e}if(n=t.match(Tr),n&&Array.isArray(e)){const r=n[1];if(parseInt(n[2]||String(e.length))!=e.length)throw new Error("invalid value for "+t);const i=[];return e.forEach((function(t){i.push(Rr(r,t,!0))})),rt(i)}throw new Error("invalid type - "+t)}function Nr(t,e){if(t.length!=e.length)throw new Error("type/value count mismatch");const r=[];return t.forEach((function(t,n){r.push(Rr(t,e[n]))})),st(rt(r))}function Lr(t){var e=[],r=[];return Array.isArray(t)?t.forEach((function(t){e.push(t.type),r.push(t.value)})):(e.push("string"),r.push(t)),function(t,e){return jt(Nr(t,e))}(e,r)}var Cr="Ethereum Signed Message:\n32",jr=r(8764).Buffer;function Dr(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t=c(t),!0===e)return jr.from(t,"hex").toString("base64");for(var r="";t.length%4!=0;)t="0"+t;for(var n=0;n<t.length;n+=4)r+=String.fromCharCode(parseInt(t.substring(n,n+4),16));return r}function Ur(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!0===e){var r=jr.from(t,"base64").toString("hex");return l(r)}for(var n="",i=0;i<t.length;i++)n+=((0==i?"":"000")+t.charCodeAt(i).toString(16)).slice(-4);return l(n=n.toLowerCase())}function zr(t){var e=(0,g.decodeSignature)(t);return{v:e[0],r:e[1],s:e[2]}}function Fr(t){var e=[t.v,t.r,t.s];return(0,g.encodeSignature)(e)}const Hr={createIdentity:M,publicKey:i,decryptWithPrivateKey:T,encryptWithPublicKey:N,cipher:o,publicKeyByPrivateKey:m,recover:C,recoverPublicKey:L,sign:D,signTransaction:F,txDataByCompiled:Br,calculateContractAddress:Pr,hash:s,hex:a,vrs:u,util:n}},8502:function(t,e,r){!function(t,e){"use strict";function n(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 o(t,e,r){if(o.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 s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8955).Buffer}catch(t){}function a(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 n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function f(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var f=t.charCodeAt(u)-48;o*=i,s=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&s<i,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(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 i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.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},o.prototype._move=function(t){h(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){o.prototype.inspect=c}else o.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,l=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=l;d++){var p=f-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.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 f=d[t],h=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var m=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?m+r:l[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var 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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.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},o.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},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.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},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(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()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.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()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.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()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.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 i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(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)},o.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,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,l=h>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,_=0|s[4],E=8191&_,S=_>>>13,A=0|s[5],x=8191&A,k=A>>>13,B=0|s[6],P=8191&B,I=B>>>13,O=0|s[7],T=8191&O,R=O>>>13,N=0|s[8],L=8191&N,C=N>>>13,j=0|s[9],D=8191&j,U=j>>>13,z=0|a[0],F=8191&z,H=z>>>13,q=0|a[1],K=8191&q,G=q>>>13,V=0|a[2],Z=8191&V,W=V>>>13,J=0|a[3],$=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,lt=ht>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(f+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,H))+Math.imul(l,F)|0))<<13)|0;f=((o=Math.imul(l,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,H))+Math.imul(m,F)|0,o=Math.imul(m,H);var yt=(f+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,K)|0))<<13)|0;f=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,H))+Math.imul(b,F)|0,o=Math.imul(b,H),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var bt=(f+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Z)|0))<<13)|0;f=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,H))+Math.imul(M,F)|0,o=Math.imul(M,H),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,W)|0;var vt=(f+(n=n+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,$)|0))<<13)|0;f=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,H))+Math.imul(S,F)|0,o=Math.imul(S,H),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,X)|0;var wt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;f=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,H))+Math.imul(k,F)|0,o=Math.imul(k,H),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;f=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,H))+Math.imul(I,F)|0,o=Math.imul(I,H),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var _t=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;f=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,H))+Math.imul(R,F)|0,o=Math.imul(R,H),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(l,ut)|0))<<13)|0;f=((o=o+Math.imul(l,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,H))+Math.imul(C,F)|0,o=Math.imul(C,H),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ft)|0;var St=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;f=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,H))+Math.imul(U,F)|0,o=Math.imul(U,H),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var At=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;f=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,lt)|0;var xt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;f=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,W))+Math.imul(U,Z)|0,o=Math.imul(U,W),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ft)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var kt=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,X))+Math.imul(U,$)|0,o=Math.imul(U,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,lt)|0;var Bt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,lt)|0;var Pt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;f=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Ot=(f+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ft))+Math.imul(U,ut)|0,o=Math.imul(U,ft),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Tt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,lt))+Math.imul(U,ct)|0,o=Math.imul(U,lt);var Rt=(f+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(f+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return f=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=Et,u[8]=St,u[9]=At,u[10]=xt,u[11]=kt,u[12]=Bt,u[13]=Pt,u[14]=It,u[15]=Ot,u[16]=Tt,u[17]=Rt,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(t,e,r){return y(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):b(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,l=f,d=0;d<s;d++){var p=r[h+d],m=n[h+d],g=r[h+d+s],y=n[h+d+s],b=c*g-l*y;y=c*y+l*g,g=b,r[h+d]=p+g,n[h+d]=m+y,r[h+d+s]=p-g,n[h+d+s]=m-y,d!==a&&(b=u*c-f*l,l=u*l+f*c,c=b)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.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,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(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 i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(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)},o.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},o.prototype.isubn=function(t){if(n("number"==typeof t),n(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.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),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.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 i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.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],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.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},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},i(_,M),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.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(E,M),i(S,M),i(A,M),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return w[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(c,new o(1).iushln(p-g-1));l=l.redMul(y),c=y.redSqr(),d=d.redMul(c),p=g}return l},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},981:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const u=a(r(9282)),f=a(r(8502)),h=s(r(6636)),c=r(5053),l=r(884),d=r(2365),p=r(9342),m=r(3846),g=r(4363),y=r(7476);class b{constructor(t=new f.default(0),e=new f.default(0),r=d.KECCAK256_RLP,n=d.KECCAK256_NULL){this.nonce=t,this.balance=e,this.stateRoot=r,this.codeHash=n,this._validate()}static fromAccountData(t){const{nonce:e,balance:r,stateRoot:n,codeHash:i}=t;return new b(e?new f.default(p.toBuffer(e)):void 0,r?new f.default(p.toBuffer(r)):void 0,n?p.toBuffer(n):void 0,i?p.toBuffer(i):void 0)}static fromRlpSerializedAccount(t){const e=h.decode(t);if(!Array.isArray(e))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(e)}static fromValuesArray(t){const[e,r,n,i]=t;return new b(new f.default(e),new f.default(r),n,i)}_validate(){if(this.nonce.lt(new f.default(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new f.default(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")}raw(){return[y.bnToRlp(this.nonce),y.bnToRlp(this.balance),this.stateRoot,this.codeHash]}serialize(){return h.encode(this.raw())}isContract(){return!this.codeHash.equals(d.KECCAK256_NULL)}isEmpty(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(d.KECCAK256_NULL)}}e.Account=b,e.isValidAddress=function(t){try{g.assertIsString(t)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(t)},e.toChecksumAddress=function(t,e){g.assertIsHexString(t);const r=l.stripHexPrefix(t).toLowerCase();let n="";e&&(n=y.toType(e,y.TypeOutput.BN).toString()+"0x");const i=m.keccakFromString(n+r).toString("hex");let o="0x";for(let t=0;t<r.length;t++)parseInt(i[t],16)>=8?o+=r[t].toUpperCase():o+=r[t];return o},e.isValidChecksumAddress=function(t,r){return e.isValidAddress(t)&&e.toChecksumAddress(t,r)===t},e.generateAddress=function(t,e){g.assertIsBuffer(t),g.assertIsBuffer(e);const r=new f.default(e);return r.isZero()?m.rlphash([t,null]).slice(-20):m.rlphash([t,n.from(r.toArray())]).slice(-20)},e.generateAddress2=function(t,e,r){return g.assertIsBuffer(t),g.assertIsBuffer(e),g.assertIsBuffer(r),u.default(20===t.length),u.default(32===e.length),m.keccak256(n.concat([n.from("ff","hex"),t,e,m.keccak256(r)])).slice(-20)},e.isValidPrivate=function(t){return c.privateKeyVerify(t)},e.isValidPublic=function(t,e=!1){return g.assertIsBuffer(t),64===t.length?c.publicKeyVerify(n.concat([n.from([4]),t])):!!e&&c.publicKeyVerify(t)},e.pubToAddress=function(t,e=!1){return g.assertIsBuffer(t),e&&64!==t.length&&(t=n.from(c.publicKeyConvert(t,!1).slice(1))),u.default(64===t.length),m.keccak(t).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToPublic=function(t){return g.assertIsBuffer(t),n.from(c.publicKeyCreate(t,!1)).slice(1)},e.privateToAddress=function(t){return e.publicToAddress(e.privateToPublic(t))},e.importPublic=function(t){return g.assertIsBuffer(t),64!==t.length&&(t=n.from(c.publicKeyConvert(t,!1).slice(1))),t},e.zeroAddress=function(){const t=p.zeros(20);return p.bufferToHex(t)},e.isZeroAddress=function(t){try{g.assertIsString(t)}catch(t){return!1}return e.zeroAddress()===t}},8342:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Address=void 0;const o=i(r(9282)),s=i(r(8502)),a=r(9342),u=r(981);class f{constructor(t){o.default(20===t.length,"Invalid address length"),this.buf=t}static zero(){return new f(a.zeros(20))}static fromString(t){return o.default(u.isValidAddress(t),"Invalid address"),new f(a.toBuffer(t))}static fromPublicKey(t){o.default(n.isBuffer(t),"Public key should be Buffer");const e=u.pubToAddress(t);return new f(e)}static fromPrivateKey(t){o.default(n.isBuffer(t),"Private key should be Buffer");const e=u.privateToAddress(t);return new f(e)}static generate(t,e){return o.default(s.default.isBN(e)),new f(u.generateAddress(t.buf,e.toArrayLike(n)))}static generate2(t,e,r){return o.default(n.isBuffer(e)),o.default(n.isBuffer(r)),new f(u.generateAddress2(t.buf,e,r))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(f.zero())}isPrecompileOrSystemAddress(){const t=new s.default(this.buf),e=new s.default(0),r=new s.default("ffff","hex");return t.gte(e)&&t.lte(r)}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return n.from(this.buf)}}e.Address=f},9342:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.baToJSON=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=void 0;const o=i(r(8502)),s=r(884),a=r(4363);e.zeros=function(t){return n.allocUnsafe(t).fill(0)};const u=function(t,r,n){const i=e.zeros(r);return n?t.length<r?(t.copy(i),i):t.slice(0,r):t.length<r?(t.copy(i,r-t.length),i):t.slice(-r)};e.setLengthLeft=function(t,e){return a.assertIsBuffer(t),u(t,e,!1)},e.setLengthRight=function(t,e){return a.assertIsBuffer(t),u(t,e,!0)};const f=function(t){let e=t[0];for(;t.length>0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t};e.unpadBuffer=function(t){return a.assertIsBuffer(t),f(t)},e.unpadArray=function(t){return a.assertIsArray(t),f(t)},e.unpadHexString=function(t){return a.assertIsHexString(t),t=s.stripHexPrefix(t),f(t)},e.toBuffer=function(t){if(null==t)return n.allocUnsafe(0);if(n.isBuffer(t))return n.from(t);if(Array.isArray(t)||t instanceof Uint8Array)return n.from(t);if("string"==typeof t){if(!s.isHexString(t))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${t}`);return n.from(s.padToEven(s.stripHexPrefix(t)),"hex")}if("number"==typeof t)return s.intToBuffer(t);if(o.default.isBN(t))return t.toArrayLike(n);if(t.toArray)return n.from(t.toArray());if(t.toBuffer)return n.from(t.toBuffer());throw new Error("invalid type")},e.bufferToInt=function(t){return new o.default(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new o.default(t).fromTwos(256)},e.toUnsigned=function(t){return n.from(t.toTwos(256).toArray())},e.addHexPrefix=function(t){return"string"!=typeof t||s.isHexPrefixed(t)?t:"0x"+t},e.baToJSON=function(t){if(n.isBuffer(t))return`0x${t.toString("hex")}`;if(t instanceof Array){const r=[];for(let n=0;n<t.length;n++)r.push(e.baToJSON(t[n]));return r}}},2365:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.MAX_INTEGER=void 0;const i=r(8764).Buffer,o=n(r(8502));e.MAX_INTEGER=new o.default("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new o.default("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=i.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=i.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=i.from(e.KECCAK256_RLP_S,"hex")},6381:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.rlp=e.BN=void 0;const a=s(r(8502));e.BN=a.default;const u=o(r(6636));e.rlp=u},3846:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.rlphash=e.ripemd160FromArray=e.ripemd160FromString=e.ripemd160=e.sha256FromArray=e.sha256FromString=e.sha256=e.keccakFromArray=e.keccakFromHexString=e.keccakFromString=e.keccak256=e.keccak=void 0;const a=r(2192),u=r(3482),f=s(r(6636)),h=r(9342),c=r(4363);e.keccak=function(t,e=256){switch(c.assertIsBuffer(t),e){case 224:return a.keccak224(t);case 256:return a.keccak256(t);case 384:return a.keccak384(t);case 512:return a.keccak512(t);default:throw new Error(`Invald algorithm: keccak${e}`)}},e.keccak256=function(t){return e.keccak(t)},e.keccakFromString=function(t,r=256){c.assertIsString(t);const i=n.from(t,"utf8");return e.keccak(i,r)},e.keccakFromHexString=function(t,r=256){return c.assertIsHexString(t),e.keccak(h.toBuffer(t),r)},e.keccakFromArray=function(t,r=256){return c.assertIsArray(t),e.keccak(h.toBuffer(t),r)};const l=function(t){return t=h.toBuffer(t),u("sha256").update(t).digest()};e.sha256=function(t){return c.assertIsBuffer(t),l(t)},e.sha256FromString=function(t){return c.assertIsString(t),l(t)},e.sha256FromArray=function(t){return c.assertIsArray(t),l(t)};const d=function(t,e){t=h.toBuffer(t);const r=u("rmd160").update(t).digest();return!0===e?h.setLengthLeft(r,32):r};e.ripemd160=function(t,e){return c.assertIsBuffer(t),d(t,e)},e.ripemd160FromString=function(t,e){return c.assertIsString(t),d(t,e)},e.ripemd160FromArray=function(t,e){return c.assertIsArray(t),d(t,e)},e.rlphash=function(t){return e.keccak(f.encode(t))}},4363:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.assertIsString=e.assertIsArray=e.assertIsBuffer=e.assertIsHexString=void 0;const i=r(884);e.assertIsHexString=function(t){if(!i.isHexString(t))throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${t}`)},e.assertIsBuffer=function(t){if(!n.isBuffer(t))throw new Error(`This method only supports Buffer but input was: ${t}`)},e.assertIsArray=function(t){if(!Array.isArray(t))throw new Error(`This method only supports number arrays but input was: ${t}`)},e.assertIsString=function(t){if("string"!=typeof t)throw new Error(`This method only supports strings but input was: ${t}`)}},7093:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2365),e),i(r(981),e),i(r(8342),e),i(r(3846),e),i(r(364),e),i(r(9342),e),i(r(2211),e),i(r(6381),e),i(r(7476),e),i(r(884),e)},2211:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.defineProperties=void 0;const u=a(r(9282)),f=s(r(884)),h=s(r(6636)),c=r(9342);e.defineProperties=function(t,e,r){if(t.raw=[],t._fields=[],t.toJSON=function(e=!1){if(e){const e={};return t._fields.forEach((r=>{e[r]=`0x${t[r].toString("hex")}`})),e}return c.baToJSON(t.raw)},t.serialize=function(){return h.encode(t.raw)},e.forEach(((e,r)=>{function i(){return t.raw[r]}function o(i){"00"!==(i=c.toBuffer(i)).toString("hex")||e.allowZero||(i=n.allocUnsafe(0)),e.allowLess&&e.length?(i=c.unpadBuffer(i),u.default(e.length>=i.length,`The field ${e.name} must not have more ${e.length} bytes`)):e.allowZero&&0===i.length||!e.length||u.default(e.length===i.length,`The field ${e.name} must have byte length of ${e.length}`),t.raw[r]=i}t._fields.push(e.name),Object.defineProperty(t,e.name,{enumerable:!0,configurable:!0,get:i,set:o}),e.default&&(t[e.name]=e.default),e.alias&&Object.defineProperty(t,e.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),r)if("string"==typeof r&&(r=n.from(f.stripHexPrefix(r),"hex")),n.isBuffer(r)&&(r=h.decode(r)),Array.isArray(r)){if(r.length>t._fields.length)throw new Error("wrong number of fields in data");r.forEach(((e,r)=>{t[t._fields[r]]=c.toBuffer(e)}))}else{if("object"!=typeof r)throw new Error("invalid data");{const n=Object.keys(r);e.forEach((e=>{-1!==n.indexOf(e.name)&&(t[e.name]=r[e.name]),-1!==n.indexOf(e.alias)&&(t[e.alias]=r[e.alias])}))}}}},364:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;const o=r(5053),s=i(r(8502)),a=r(9342),u=r(3846),f=r(4363),h=r(7476);function c(t,e){const r=h.toType(t,h.TypeOutput.BN);if(!e)return r.subn(27);const n=h.toType(e,h.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function l(t){const e=new s.default(t);return e.eqn(0)||e.eqn(1)}e.ecsign=function(t,e,r){const{signature:i,recid:s}=o.ecdsaSign(t,e),a=n.from(i.slice(0,32)),u=n.from(i.slice(32,64));if(!r||"number"==typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:a,s:u,v:r?s+(2*r+35):s+27}}return{r:a,s:u,v:h.toType(r,h.TypeOutput.BN).muln(2).addn(35).addn(s).toArrayLike(n)}},e.ecrecover=function(t,e,r,i,s){const u=n.concat([a.setLengthLeft(r,32),a.setLengthLeft(i,32)],64),f=c(e,s);if(!l(f))throw new Error("Invalid signature v value");const h=o.ecdsaRecover(u,f.toNumber(),t);return n.from(o.publicKeyConvert(h,!1).slice(1))},e.toRpcSig=function(t,e,r,i){if(!l(c(t,i)))throw new Error("Invalid signature v value");return a.bufferToHex(n.concat([a.setLengthLeft(e,32),a.setLengthLeft(r,32),a.toBuffer(t)]))},e.fromRpcSig=function(t){const e=a.toBuffer(t);if(e.length<65)throw new Error("Invalid signature length");let r=a.bufferToInt(e.slice(64));return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},e.isValidSignature=function(t,e,r,n=!0,i){const o=new s.default("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new s.default("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!l(c(t,i)))return!1;const u=new s.default(e),f=new s.default(r);return!(u.isZero()||u.gt(a)||f.isZero()||f.gt(a)||n&&1===f.cmp(o))},e.hashPersonalMessage=function(t){f.assertIsBuffer(t);const e=n.from(`Ethereum Signed Message:\n${t.length.toString()}`,"utf-8");return u.keccak(n.concat([e,t]))}},7476:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=e.bnToRlp=e.bnToHex=void 0;const o=i(r(8502)),s=r(884),a=r(9342);var u;e.bnToHex=function(t){return`0x${t.toString(16)}`},e.bnToRlp=function(t){return a.unpadBuffer(t.toArrayLike(n))},function(t){t[t.Number=0]="Number",t[t.BN=1]="BN",t[t.Buffer=2]="Buffer",t[t.PrefixedHexString=3]="PrefixedHexString"}(u=e.TypeOutput||(e.TypeOutput={})),e.toType=function(t,e){if("string"==typeof t&&!s.isHexString(t))throw new Error(`A string must be provided with a 0x-prefix, given: ${t}`);if("number"==typeof t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");if(t=a.toBuffer(t),e===u.Buffer)return t;if(e===u.BN)return new o.default(t);if(e===u.Number){const e=new o.default(t),r=new o.default(Number.MAX_SAFE_INTEGER.toString());if(e.gt(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return e.toNumber()}return`0x${t.toString("hex")}`}},3608:(t,e,r)=>{var n=r(8764).Buffer;const i=r(9494),o=r(3091),s=r(6266),a=(r(3390),new s.ec("secp256k1")),{keccak256:u,keccak256s:f}=r(1538),h=t=>{const e=f(t.slice(2));let r="0x";for(let n=0;n<40;n++)r+=parseInt(e[n+2],16)>7?t[n+2].toUpperCase():t[n+2];return r},c=t=>{const e=new n(t.slice(2),"hex"),r="0x"+a.keyFromPrivate(e).getPublic(!1,"hex").slice(2),i=u(r);return{address:h("0x"+i.slice(-40)),privateKey:t}},l=([t,e,r])=>i.flatten([e,r,t]),d=t=>[i.slice(64,i.length(t),t),i.slice(0,32,t),i.slice(32,64,t)],p=t=>(e,r)=>{const s=a.keyFromPrivate(new n(r.slice(2),"hex")).sign(new n(e.slice(2),"hex"),{canonical:!0});return l([o.fromString(i.fromNumber(t+s.recoveryParam)),i.pad(32,i.fromNat("0x"+s.r.toString(16))),i.pad(32,i.fromNat("0x"+s.s.toString(16)))])},m=p(27);t.exports={create:t=>{const e=u(i.concat(i.random(32),t||i.random(32))),r=i.concat(i.concat(i.random(32),e),i.random(32)),n=u(r);return c(n)},toChecksum:h,fromPrivate:c,sign:m,makeSigner:p,recover:(t,e)=>{const r=d(e),o={v:i.toNumber(r[0]),r:r[1].slice(2),s:r[2].slice(2)},s="0x"+a.recoverPubKey(new n(t.slice(2),"hex"),o,o.v<2?o.v:1-o.v%2).encode("hex",!1).slice(2),f=u(s);return h("0x"+f.slice(-40))},encodeSignature:l,decodeSignature:d}},458:t=>{const e=(t,e)=>{let r=[];for(var n=0;n<t;++n)r.push(e(n));return r};t.exports={generate:e,replicate:(t,r)=>e(t,(()=>r)),concat:(t,e)=>t.concat(e),flatten:t=>{let e=[];for(let r=0,n=t.length;r<n;++r)for(let n=0,i=t[r].length;n<i;++n)e.push(t[r][n]);return e},chunksOf:(t,e)=>{let r=[];for(let n=0,i=e.length;n<i;n+=t)r.push(e.slice(n,n+t));return r}}},9494:(t,e,r)=>{r(458);const n=(t,e)=>parseInt(t.slice(2*e+2,2*e+4),16),i=t=>(t.length-2)/2,o=(t,e)=>e.length===2*t+2?e:o(t,"0x0"+e.slice(2)),s=(t,e)=>e.length===2*t+2?e:s(t,e+"0"),a=t=>{let e=[];for(let r=2,n=t.length;r<n;r+=2)e.push(parseInt(t.slice(r,r+2),16));return e},u=t=>{let e="0x";for(let r=0,n=t.length;r<n;++r){let n=t[r];e+=(n<16?"0":"")+n.toString(16)}return e};t.exports={random:t=>{let e;e="undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues?window.crypto.getRandomValues(new Uint8Array(t)):r(5835).randomBytes(t);let n="0x";for(let r=0;r<t;++r)n+=("00"+e[r].toString(16)).slice(-2);return n},length:i,concat:(t,e)=>t.concat(e.slice(2)),flatten:t=>"0x"+t.reduce(((t,e)=>t+e.slice(2)),""),slice:(t,e,r)=>"0x"+r.slice(2*t+2,2*e+2),reverse:t=>{let e="0x";for(let r=0,n=i(t);r<n;++r)e+=t.slice(2*(n-r),2*(n-r+1));return e},pad:o,padRight:s,fromAscii:t=>{let e="0x";for(let r=0;r<t.length;++r)e+=("00"+t.charCodeAt(r).toString(16)).slice(-2);return e},toAscii:t=>{let e="";for(let r=2;r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.slice(r,r+2),16));return e},fromString:t=>{const e=t=>{const e=t.toString(16);return e.length<2?"0"+e:e};let r="0x";for(let n=0;n!=t.length;n++){let i=t.charCodeAt(n);if(i<128)r+=e(i);else{if(i<2048)r+=e(i>>6|192);else{if(i>55295&&i<56320){if(++n==t.length)return null;let o=t.charCodeAt(n);if(o<56320||o>57343)return null;i=65536+((1023&i)<<10)+(1023&o),r+=e(i>>18|240),r+=e(i>>12&63|128)}else r+=e(i>>12|224);r+=e(i>>6&63|128)}r+=e(63&i|128)}}return r},toString:t=>{let e="",r=0,o=i(t);for(;r<o;){let i=n(t,r++);if(i>127){if(i>191&&i<224){if(r>=o)return null;i=(31&i)<<6|63&n(t,r)}else if(i>223&&i<240){if(r+1>=o)return null;i=(15&i)<<12|(63&n(t,r))<<6|63&n(t,++r)}else{if(!(i>239&&i<248))return null;if(r+2>=o)return null;i=(7&i)<<18|(63&n(t,r))<<12|(63&n(t,++r))<<6|63&n(t,++r)}++r}if(i<=65535)e+=String.fromCharCode(i);else{if(!(i<=1114111))return null;i-=65536,e+=String.fromCharCode(i>>10|55296),e+=String.fromCharCode(1023&i|56320)}}return e},fromNumber:t=>{let e=t.toString(16);return e.length%2==0?"0x"+e:"0x0"+e},toNumber:t=>parseInt(t.slice(2),16),fromNat:t=>"0x0"===t?"0x":t.length%2==0?t:"0x0"+t.slice(2),toNat:t=>"0"===t[2]?"0x"+t.slice(3):t,fromArray:u,toArray:a,fromUint8Array:t=>u([].slice.call(t,0)),toUint8Array:t=>new Uint8Array(a(t))}},1538:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[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],o=t=>{var e,r,n,o,s,a,u,f,h,c,l,d,p,m,g,y,b,v,w,M,_,E,S,A,x,k,B,P,I,O,T,R,N,L,C,j,D,U,z,F,H,q,K,G,V,Z,W,J,$,X,Y,Q,tt,et,rt,nt,it,ot,st,at,ut,ft,ht;for(n=0;n<48;n+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=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],f=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=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^(f<<1|h>>>31),r=s^(h<<1|f>>>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^(c<<1|l>>>31),r=u^(l<<1|c>>>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=f^(d<<1|p>>>31),r=h^(p<<1|d>>>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=c^(o<<1|s>>>31),r=l^(s<<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,m=t[0],g=t[1],Z=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,q=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,L=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,b=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,$=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ft=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,j=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,N=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~y&v,t[1]=g^~b&w,t[10]=A^~k&P,t[11]=x^~B&I,t[20]=L^~j&U,t[21]=C^~D&z,t[30]=G^~Z&J,t[31]=V^~W&$,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~v&M,t[3]=b^~w&_,t[12]=k^~P&O,t[13]=B^~I&T,t[22]=j^~U&F,t[23]=D^~z&H,t[32]=Z^~J&X,t[33]=W^~$&Y,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=v^~M&E,t[5]=w^~_&S,t[14]=P^~O&R,t[15]=I^~T&N,t[24]=U^~F&q,t[25]=z^~H&K,t[34]=J^~X&Q,t[35]=$^~Y&tt,t[44]=ot^~at&ft,t[45]=st^~ut&ht,t[6]=M^~E&m,t[7]=_^~S&g,t[16]=O^~R&A,t[17]=T^~N&x,t[26]=F^~q&L,t[27]=H^~K&C,t[36]=X^~Q&G,t[37]=Y^~tt&V,t[46]=at^~ft&et,t[47]=ut^~ht&rt,t[8]=E^~m&y,t[9]=S^~g&b,t[18]=R^~A&k,t[19]=N^~x&B,t[28]=q^~L&j,t[29]=K^~C&D,t[38]=Q^~G&Z,t[39]=tt^~V&W,t[48]=ft^~et&nt,t[49]=ht^~rt&it,t[0]^=i[n],t[1]^=i[n+1]},s=t=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a<u;a+=2)s.push(parseInt(i.slice(a,a+2),16))}else s=i;return((t,i)=>{for(var s,a=i.length,u=t.blocks,f=t.blockCount<<2,h=t.blockCount,c=t.outputBlocks,l=t.s,d=0;d<a;){if(t.reset)for(t.reset=!1,u[0]=t.block,g=1;g<h+1;++g)u[g]=0;if("string"!=typeof i)for(g=t.start;d<a&&g<f;++d)u[g>>2]|=i[d]<<n[3&g++];else for(g=t.start;d<a&&g<f;++d)(s=i.charCodeAt(d))<128?u[g>>2]|=s<<n[3&g++]:s<2048?(u[g>>2]|=(192|s>>6)<<n[3&g++],u[g>>2]|=(128|63&s)<<n[3&g++]):s<55296||s>=57344?(u[g>>2]|=(224|s>>12)<<n[3&g++],u[g>>2]|=(128|s>>6&63)<<n[3&g++],u[g>>2]|=(128|63&s)<<n[3&g++]):(s=65536+((1023&s)<<10|1023&i.charCodeAt(++d)),u[g>>2]|=(240|s>>18)<<n[3&g++],u[g>>2]|=(128|s>>12&63)<<n[3&g++],u[g>>2]|=(128|s>>6&63)<<n[3&g++],u[g>>2]|=(128|63&s)<<n[3&g++]);if(t.lastByteIndex=g,g>=f){for(t.start=g-f,t.block=u[h],g=0;g<h;++g)l[g]^=u[g];o(l),t.reset=!0}else t.start=g}if(u[(g=t.lastByteIndex)>>2]|=r[3&g],t.lastByteIndex===f)for(u[0]=u[h],g=1;g<h+1;++g)u[g]=0;for(u[h-1]|=2147483648,g=0;g<h;++g)l[g]^=u[g];o(l);for(var p,m="",g=0,y=0;y<c;){for(g=0;g<h&&y<c;++g,++y)p=l[g],m+=e[p>>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];y%h==0&&(o(l),g=0)}return"0x"+m})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},3091:(t,e,r)=>{const n=r(3550),i=r(9494),o=t=>new n(t.slice(2),16),s=t=>{const e="0x"+("0x"===t.slice(0,2)?new n(t.slice(2),16):new n(t,10)).toString("hex");return"0x0"===e?"0x":e},a=t=>"string"==typeof t?/^0x/.test(t)?t:"0x"+t:"0x"+new n(t).toString("hex"),u=t=>o(t).toNumber(),f=t=>(e,r)=>"0x"+o(e)[t](o(r)).toString("hex"),h=f("add"),c=f("mul"),l=f("div"),d=f("sub");t.exports={toString:t=>o(t).toString(10),fromString:s,toNumber:u,fromNumber:a,toEther:t=>u(l(t,s("10000000000")))/1e8,fromEther:t=>c(a(Math.floor(1e8*t)),s("10000000000")),toUint256:t=>i.pad(32,t),add:h,mul:c,div:l,sub:d}},3390:t=>{t.exports={encode:t=>{const e=t=>{return(e=t.toString(16)).length%2==0?e:"0"+e;var e},r=(t,r)=>t<56?e(r+t):e(r+e(t).length/2+55)+e(t),n=t=>{if("string"==typeof t){const e=t.slice(2);return(2!=e.length||e>="80"?r(e.length/2,128):"")+e}{const e=t.map(n).join("");return r(e.length/2,192)+e}};return"0x"+n(t)},decode:t=>{let e=2;const r=()=>{if(e>=t.length)throw"";const r=t.slice(e,e+2);return r<"80"?(e+=2,"0x"+r):r<"c0"?i():o()},n=()=>{const r=parseInt(t.slice(e,e+=2),16)%64;return r<56?r:parseInt(t.slice(e,e+=2*(r-55)),16)},i=()=>{const r=n();return"0x"+t.slice(e,e+=2*r)},o=()=>{const t=2*n()+e;let i=[];for(;e<t;)i.push(r());return i};try{return r()}catch(t){return[]}}}},3230:(t,e,r)=>{"use strict";var n=r(8764).Buffer,i=r(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(r(4575)),s=i(r(3913)),a=i(r(9713)),u=r(1094),f=function(){function t(){(0,o.default)(this,t)}return(0,s.default)(t,[{key:"hashStruct",value:function(){return n.from((0,u.keccak256)(this.encodeData()),"hex")}},{key:"encodeData",value:function(){throw new Error("This is an abstract class, Subclasses of AbstractType should override encodeData()")}},{key:"toObject",value:function(){throw new Error("This is an abstract class, Subclasses of AbstractType should override toObject()")}}],[{key:"encodeTypeFragment",value:function(){return"".concat(this.name,"(").concat(this.properties.map((function(t){var e=t.name,r=t.type;return"".concat(r," ").concat(e)})).join(","),")")}},{key:"encodeDependentTypes",value:function(){return""}},{key:"encodeType",value:function(){return"".concat(this.encodeTypeFragment()).concat(this.encodeDependentTypes())}},{key:"typeHash",value:function(){return n.from((0,u.keccak256)(this.encodeType()),"hex")}},{key:"typeDef",value:function(){return this.properties.map((function(t){return{name:t.name,type:t.type}}))}}]),t}();e.default=f,(0,a.default)(f,"name",void 0),(0,a.default)(f,"properties",void 0)},5693:(t,e,r)=>{"use strict";var n=r(8764).Buffer,i=r(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=w,e.EIP712DomainProperties=void 0;var o=i(r(693)),s=i(r(4575)),a=i(r(3913)),u=i(r(8585)),f=i(r(9754)),h=i(r(2205)),c=i(r(1506)),l=i(r(9713)),d=i(r(319)),p=i(r(8142)),m=r(1094),g=i(r(3230)),y=i(r(9613)),b=r(4673),v=[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"}];function w(t){var e={},r=v.reduce((function(r,n){var i=n.name,o=n.type;return i in t?(e[i]=b.validate[o](t[i]),(0,d.default)(r).concat([{name:i,type:o}])):r}),[]);if(Object.keys(e).length!==Object.keys(t).length)throw new Error("Extra key in EIP712Domain definition");if(0===Object.keys(t).length)throw new Error("Must supply at least one EIP712Domain property");var i=function(t){function e(t){var r;return(0,s.default)(this,e),(r=(0,u.default)(this,(0,f.default)(e).call(this))).vals=(0,o.default)({},t),r.types={},r.domainSeparator=r.hashStruct(),r.createType=y.default.bind((0,c.default)((0,c.default)(r))),r}return(0,h.default)(e,t),(0,a.default)(e,[{key:"validate",value:function(t,e){var r=this;if((0,b.isArrayType)(t))return e.map((function(e){return r.validate((0,b.getElementaryType)(t),e)}));if((0,b.isPrimitiveType)(t))return b.validate[t](e);if(t in this.types){var n=this.types[t];return e instanceof n?e:new n(e)}throw new Error("Type ".concat(t," not recognized in this domain"))}},{key:"serialize",value:function(t,e){var r=this;if(t in this.types)return e.toObject();if((0,b.isArrayType)(t))return e.map((function(e){return r.serialize((0,b.getElementaryType)(t),e)}));if((0,b.isPrimitiveType)(t))return e;throw new Error("Type ".concat(t," is not a valid type in this domain"))}},{key:"listTypes",value:function(){var t=this;return Object.keys(this.types).reduce((function(e,r){return(0,o.default)({},e,(0,l.default)({},r,t.types[r].typeDef()))}),{})}},{key:"toDomainDef",value:function(){return(0,o.default)((0,l.default)({},this.constructor.name,this.constructor.typeDef()),this.listTypes())}},{key:"encodeData",value:function(){var t=this,e=this.constructor.properties.map((function(t){var e=t.type;return"string"===e?"bytes32":e})),r=this.constructor.properties.map((function(e){var r=e.name;return"string"===e.type?n.from((0,m.keccak256)(t.vals[r]),"hex"):t.vals[r]}));return p.default.rawEncode(["bytes32"].concat((0,d.default)(e)),[n.from(this.constructor.typeHash(),"hex")].concat((0,d.default)(r)))}},{key:"toObject",value:function(){return(0,o.default)({},this.vals)}}]),e}(g.default);return(0,l.default)(i,"name","EIP712Domain"),(0,l.default)(i,"properties",r),(0,l.default)(i,"dependencies",[]),new i(e)}e.EIP712DomainProperties=v,w.fromSignatureRequest=function(t){for(var e=t.types,r=t.message,n=t.primaryType,i=new w(t.domain),o=[],s=new Set,a=new Set,u=function t(r){var n=!0,i=!1,u=void 0;try{for(var f,h=e[r][Symbol.iterator]();!(n=(f=h.next()).done);n=!0){var c=f.value.type;if(!s.has(c)&&!(0,b.isNotStructureType)(c)){if(a.has(c))throw new Error("Cannot construct domain from signature request with cyclic dependencies");a.add(c),t(c)}}}catch(t){i=!0,u=t}finally{try{n||null==h.return||h.return()}finally{if(i)throw u}}o.push(r),s.add(r)},f=Object.keys(e),h=0;h<f.length;h++){var c=f[h];"EIP712Domain"===c||s.has(c)||u(c)}for(var l=0;l<o.length;l++){var d=o[l];"EIP712Domain"!==d&&i.createType(d,e[d])}return{domain:i,message:new(0,i.types[n])(r)}}},9613:(t,e,r)=>{"use strict";var n=r(8764).Buffer,i=r(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var r=this||{types:{}};r.types||(r.types={});var i=Array.isArray(e)?e.map((function(t){return w({name:t.name,type:t.type},r)})):Object.keys(e).map((function(t){return w({name:t,type:e[t]},r)})),o=M(i,r,[]).sort(),s=function(e){function o(e){var n;(0,u.default)(this,o),(n=(0,h.default)(this,(0,c.default)(o).call(this))).name=t,n.properties=i,n._object={};var s=!0,a=!1,f=void 0;try{for(var l,p=function(){var t=l.value;if(!(t.name in e))throw new Error("Type ".concat(n.name," missing required property ").concat(t.name));Object.defineProperty((0,d.default)((0,d.default)(n)),t.name,{get:function(){return n._object[t.name]},set:function(e){return n._object[t.name]=r.validate(t.type,e)}}),n._object[t.name]=r.validate(t.type,e[t.name])},m=i[Symbol.iterator]();!(s=(l=m.next()).done);s=!0)p()}catch(t){a=!0,f=t}finally{try{s||null==m.return||m.return()}finally{if(a)throw f}}return n}return(0,l.default)(o,e),(0,f.default)(o,[{key:"toObject",value:function(){var t=this;return i.reduce((function(e,n){var i=n.name,o=n.type;return(0,a.default)({},e,(0,p.default)({},i,r.serialize(o,t._object[i])))}),{})}},{key:"toSignatureRequest",value:function(){return{types:r.toDomainDef(),domain:r.toObject(),primaryType:this.name,message:this.toObject()}}},{key:"encodeData",value:function(){var t=["bytes32"],e=[n.from(this.constructor.typeHash(),"hex")],i=!0,o=!1,s=void 0;try{for(var a,u=this.constructor.properties[Symbol.iterator]();!(i=(a=u.next()).done);i=!0){var f=a.value,h=f.type,c=f.name;if((0,v.isDynamicType)(h))t.push("bytes32"),e.push(n.from((0,g.keccak256)(this[c]),"hex"));else if(h in r.types)t.push("bytes32"),e.push(n.from((0,g.keccak256)(this[c].encodeData()),"hex"));else{if((0,v.isArrayType)(h))throw new Error("[DEV] Array types not yet supported");if(!(0,v.isAtomicType)(h))throw new Error("Unknown type: ".concat(h));t.push(h),e.push(this[c])}}}catch(t){o=!0,s=t}finally{try{i||null==u.return||u.return()}finally{if(o)throw s}}return m.default.rawEncode(t,e)}},{key:"encode",value:function(){return n.concat([n.from([25,1]),r.domainSeparator,this.hashStruct()])}},{key:"signHash",value:function(){return n.from((0,g.keccak256)(this.encode()),"hex")}},{key:"sign",value:function(t){if("function"!=typeof t)throw new Error("Must provide a signer function");return t(this.signHash())}},{key:"verifySignature",value:function(t,e){var r=this.signHash();return(0,b.verifyRawSignatureFromAddress)(r,t,e)}}],[{key:"encodeDependentTypes",value:function(){return this.dependencies.map((function(t){return r.types[t].encodeTypeFragment()}))}}]),o}(y.default);return(0,p.default)(s,"name",t),(0,p.default)(s,"properties",i),(0,p.default)(s,"dependencies",o),r.types[t]=s,s};var o=i(r(319)),s=i(r(8)),a=i(r(693)),u=i(r(4575)),f=i(r(3913)),h=i(r(8585)),c=i(r(9754)),l=i(r(2205)),d=i(r(1506)),p=i(r(9713)),m=i(r(8142)),g=r(1094),y=i(r(3230)),b=r(8087),v=r(4673);function w(t,e){var r=t.name,n=t.type;if(!r||!n)throw new Error("Invalid type definition: all entries must specify name and type");if("object"===(0,s.default)(n))throw new Error("Nested type definitions not supported");if(!(0,v.isPrimitiveType)(n)&&!(n in e.types))throw new Error("Type ".concat(n," is undefined in this domain"));return{name:r,type:n}}function M(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=!0,i=!1,s=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var f=a.value,h=f.type;(0,v.isPrimitiveType)(h)||(r=r.concat([h].concat((0,o.default)(M(e.types[h].properties,e,r))).filter((function(t){return!r.includes(t)}))))}}catch(t){i=!0,s=t}finally{try{n||null==u.return||u.return()}finally{if(i)throw s}}return r}},7728:(t,e,r)=>{"use strict";var n=r(5318);e.ZP=void 0;var i=n(r(5693)),o=(r(8087),i.default);e.ZP=o},4673:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.isArrayType=s,e.getElementaryType=a,e.isAtomicType=u,e.isDynamicType=f,e.isPrimitiveType=h,e.isNotStructureType=function t(e){return!!h(e)||!!s(e)&&t(a(e))},e.validate=e.DYNAMICS=e.ATOMICS=void 0;var i=["bytes1","bytes2","bytes4","bytes8","bytes16","bytes32","uint8","uint16","uint32","uint64","uint128","uint256","int8","int16","int32","int64","int128","int256","address","bool"];e.ATOMICS=i;var o=["string","bytes"];function s(t){return t.length>2&&"[]"===t.slice(-2)}function a(t){if(s(t))return t.slice(0,-2);throw new Error("Can't get element of non-array type")}function u(t){return i.includes(t)}function f(t){return o.includes(t)}function h(t){return u(t)||f(t)}e.DYNAMICS=o;var c={bytes1:function(t){return t},bytes2:function(t){return t},bytes4:function(t){return t},bytes8:function(t){return t},bytes16:function(t){return t},bytes32:function(t){return t},uint8:function(t){return t},uint16:function(t){return t},uint32:function(t){return t},uint64:function(t){return t},uint128:function(t){return t},uint256:function(t){return t},int8:function(t){return t},int16:function(t){return t},int32:function(t){return t},int64:function(t){return t},int128:function(t){return t},int256:function(t){return t},address:function(t){return t},bool:function(t){return t},string:function(t){return t},bytes:function(t){return n.from(t)}};e.validate=c},8087:(t,e,r)=>{"use strict";var n=r(8764).Buffer,i=r(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.verify=function(t,e,r){var n=a.default.fromSignatureRequest(t),i=n.domain,o=n.message;if(!o.verifySignature(e,r))throw new Error("Invalid signature for address over this object");return{domain:i,message:o}},e.verifyRawSignatureFromAddress=function(t,e,r){var i,o=("string"==typeof(i=e)&&(i={r:n.from(i.slice(0,64),"hex"),s:n.from(i.slice(64,128),"hex"),v:parseInt(i[128])}),{r:i.r,s:i.s,v:"recoveryParam"in i?i.recoveryParam:i.v}),s=o.r,a=o.s,h=o.v;return f(u.recoverPubKey(t,{r:s,s:a},h).encode("hex"))===r},e.toEthereumAddress=f;var o=r(6266),s=r(1094),a=i(r(5693)),u=new o.ec("secp256k1");function f(t){return t=t.startsWith("0x")?t.slice(2):t,"0x".concat((0,s.keccak256)(n.from(t,"hex")).slice(-20).toString("hex"))}},5443:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.createHashFunction=function(t){return function(e){var r=t();return r.update(e),n.from(r.digest())}}},2192:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(5443),i=r(5811);e.keccak224=n.createHashFunction((function(){return i("keccak224")})),e.keccak256=n.createHashFunction((function(){return i("keccak256")})),e.keccak384=n.createHashFunction((function(){return i("keccak384")})),e.keccak512=n.createHashFunction((function(){return i("keccak512")}))},472:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1798);e.getRandomBytes=function(t){return new Promise((function(e,r){n(t,(function(t,n){t?r(t):e(n)}))}))},e.getRandomBytesSync=function(t){return n(t)}},5053:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(7221),s=r(472);e.createPrivateKey=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(e){switch(e.label){case 0:return[4,s.getRandomBytes(32)];case 1:return t=e.sent(),o.privateKeyVerify(t)?[2,t]:[3,0];case 2:return[2]}}))}))},e.createPrivateKeySync=function(){for(;;){var t=s.getRandomBytesSync(32);if(o.privateKeyVerify(t))return t}},function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(7221))},8142:(t,e,r)=>{t.exports=r(5437)},5437:(t,e,r)=>{var n=r(8764).Buffer;const i=r(1964),o=r(3550);var s=function(){};function a(t){return t.startsWith("int[")?"int256"+t.slice(3):"int"===t?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):"uint"===t?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):"fixed"===t?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):"ufixed"===t?"ufixed128x128":t}function u(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function f(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function h(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?""===e[2]?"dynamic":parseInt(e[2],10):null}function c(t){var e=typeof t;if("string"===e)return i.isHexPrefixed(t)?new o(i.stripHexPrefix(t),16):new o(t,10);if("number"===e)return new o(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function l(t){var e=/^(\w+)\((.*)\)$/.exec(t);if(3!==e.length)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(e[2]);if(null!==r&&3===r.length)return{method:e[1],args:r[1].split(","),retargs:r[2].split(",")};var n=e[2].split(",");return 1===n.length&&""===n[0]&&(n=[]),{method:e[1],args:n}}function d(t,e){var r,s,a,l;if("address"===t)return d("uint160",c(e));if("bool"===t)return d("uint8",e?1:0);if("string"===t)return d("bytes",n.from(e,"utf8"));if(y(t)){if(void 0===e.length)throw new Error("Not an array?");if("dynamic"!==(r=h(t))&&0!==r&&e.length>r)throw new Error("Elements exceed array size: "+r);for(l in a=[],t=t.slice(0,t.lastIndexOf("[")),"string"==typeof e&&(e=JSON.parse(e)),e)a.push(d(t,e[l]));if("dynamic"===r){var p=d("uint256",e.length);a.unshift(p)}return n.concat(a)}if("bytes"===t)return e=n.from(e),a=n.concat([d("uint256",e.length),e]),e.length%32!=0&&(a=n.concat([a,i.zeros(32-e.length%32)])),a;if(t.startsWith("bytes")){if((r=u(t))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return i.setLengthRight(e,32)}if(t.startsWith("uint")){if((r=u(t))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((s=c(e)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+s.bitLength());if(s<0)throw new Error("Supplied uint is negative");return s.toArrayLike(n,"be",32)}if(t.startsWith("int")){if((r=u(t))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((s=c(e)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+s.bitLength());return s.toTwos(256).toArrayLike(n,"be",32)}if(t.startsWith("ufixed")){if(r=f(t),(s=c(e))<0)throw new Error("Supplied ufixed is negative");return d("uint256",s.mul(new o(2).pow(new o(r[1]))))}if(t.startsWith("fixed"))return r=f(t),d("int256",c(e).mul(new o(2).pow(new o(r[1]))));throw new Error("Unsupported or invalid type: "+t)}function p(t,e,r){var i,s,a,u;if("string"==typeof t&&(t=m(t)),"address"===t.name)return p(t.rawType,e,r).toArrayLike(n,"be",20).toString("hex");if("bool"===t.name)return p(t.rawType,e,r).toString()===new o(1).toString();if("string"===t.name){var f=p(t.rawType,e,r);return n.from(f,"utf8").toString()}if(t.isArray){for(a=[],i=t.size,"dynamic"===t.size&&(r=p("uint256",e,r).toNumber(),i=p("uint256",e,r).toNumber(),r+=32),u=0;u<i;u++){var h=p(t.subArray,e,r);a.push(h),r+=t.subArray.memoryUsage}return a}if("bytes"===t.name)return r=p("uint256",e,r).toNumber(),i=p("uint256",e,r).toNumber(),e.slice(r+32,r+32+i);if(t.name.startsWith("bytes"))return e.slice(r,r+t.size);if(t.name.startsWith("uint")){if((s=new o(e.slice(r,r+32),16,"be")).bitLength()>t.size)throw new Error("Decoded int exceeds width: "+t.size+" vs "+s.bitLength());return s}if(t.name.startsWith("int")){if((s=new o(e.slice(r,r+32),16,"be").fromTwos(256)).bitLength()>t.size)throw new Error("Decoded uint exceeds width: "+t.size+" vs "+s.bitLength());return s}if(t.name.startsWith("ufixed")){if(i=new o(2).pow(new o(t.size[1])),!(s=p("uint256",e,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return s.div(i)}if(t.name.startsWith("fixed")){if(i=new o(2).pow(new o(t.size[1])),!(s=p("int256",e,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return s.div(i)}throw new Error("Unsupported or invalid type: "+t.name)}function m(t){var e,r,n;if(y(t)){e=h(t);var i=t.slice(0,t.lastIndexOf("["));return i=m(i),{isArray:!0,name:t,size:e,memoryUsage:"dynamic"===e?32:i.memoryUsage*e,subArray:i}}switch(t){case"address":n="uint160";break;case"bool":n="uint8";break;case"string":n="bytes"}if(r={rawType:n,name:t,memoryUsage:32},t.startsWith("bytes")&&"bytes"!==t||t.startsWith("uint")||t.startsWith("int")?r.size=u(t):(t.startsWith("ufixed")||t.startsWith("fixed"))&&(r.size=f(t)),t.startsWith("bytes")&&"bytes"!==t&&(r.size<1||r.size>32))throw new Error("Invalid bytes<N> width: "+r.size);if((t.startsWith("uint")||t.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint<N> width: "+r.size);return r}function g(t){return"string"===t||"bytes"===t||"dynamic"===h(t)}function y(t){return t.lastIndexOf("]")===t.length-1}function b(t,e){return t.startsWith("address")||t.startsWith("bytes")?"0x"+e.toString("hex"):e.toString()}s.eventID=function(t,e){var r=t+"("+e.map(a).join(",")+")";return i.keccak256(n.from(r))},s.methodID=function(t,e){return s.eventID(t,e).slice(0,4)},s.rawEncode=function(t,e){var r=[],i=[],o=0;t.forEach((function(t){if(y(t)){var e=h(t);o+="dynamic"!==e?32*e:32}else o+=32}));for(var s=0;s<t.length;s++){var u=a(t[s]),f=d(u,e[s]);g(u)?(r.push(d("uint256",o)),i.push(f),o+=f.length):r.push(f)}return n.concat(r.concat(i))},s.rawDecode=function(t,e){var r=[];e=n.from(e);for(var i=0,o=0;o<t.length;o++){var s=m(a(t[o])),u=p(s,e,i);i+=s.memoryUsage,r.push(u)}return r},s.simpleEncode=function(t){var e=Array.prototype.slice.call(arguments).slice(1),r=l(t);if(e.length!==r.args.length)throw new Error("Argument count mismatch");return n.concat([s.methodID(r.method,r.args),s.rawEncode(r.args,e)])},s.simpleDecode=function(t,e){var r=l(t);if(!r.retargs)throw new Error("No return values in method");return s.rawDecode(r.retargs,e)},s.stringify=function(t,e){var r=[];for(var n in t){var i=t[n],o=e[n];o=/^[^\[]+\[.*\]$/.test(i)?o.map((function(t){return b(i,t)})).join(", "):b(i,o),r.push(o)}return r},s.solidityHexValue=function(t,e,r){var o,a;if(y(t)){var f=t.replace(/\[.*?\]/,"");if(!y(f)){var l=h(t);if("dynamic"!==l&&0!==l&&e.length>l)throw new Error("Elements exceed array size: "+l)}var d=e.map((function(t){return s.solidityHexValue(f,t,256)}));return n.concat(d)}if("bytes"===t)return e;if("string"===t)return n.from(e,"utf8");if("bool"===t){r=r||8;var p=Array(r/4).join("0");return n.from(e?p+"1":p+"0","hex")}if("address"===t){var m=20;return r&&(m=r/8),i.setLengthLeft(e,m)}if(t.startsWith("bytes")){if((o=u(t))<1||o>32)throw new Error("Invalid bytes<N> width: "+o);return i.setLengthRight(e,o)}if(t.startsWith("uint")){if((o=u(t))%8||o<8||o>256)throw new Error("Invalid uint<N> width: "+o);if((a=c(e)).bitLength()>o)throw new Error("Supplied uint exceeds width: "+o+" vs "+a.bitLength());return r=r||o,a.toArrayLike(n,"be",r/8)}if(t.startsWith("int")){if((o=u(t))%8||o<8||o>256)throw new Error("Invalid int<N> width: "+o);if((a=c(e)).bitLength()>o)throw new Error("Supplied int exceeds width: "+o+" vs "+a.bitLength());return r=r||o,a.toTwos(o).toArrayLike(n,"be",r/8)}throw new Error("Unsupported or invalid type: "+t)},s.solidityPack=function(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r=[],i=0;i<t.length;i++){var o=a(t[i]),u=e[i];r.push(s.solidityHexValue(o,u,null))}return n.concat(r)},s.soliditySHA3=function(t,e){return i.keccak256(s.solidityPack(t,e))},s.soliditySHA256=function(t,e){return i.sha256(s.solidityPack(t,e))},s.solidityRIPEMD160=function(t,e){return i.ripemd160(s.solidityPack(t,e),!0)},s.fromSerpent=function(t){for(var e,r=[],n=0;n<t.length;n++){var i=t[n];if("s"===i)r.push("bytes");else if("b"===i){for(var o="bytes",s=n+1;s<t.length&&(e=t[s])>="0"&&e<="9";)o+=t[s]-"0",s++;n=s-1,r.push(o)}else if("i"===i)r.push("int256");else{if("a"!==i)throw new Error("Unsupported or invalid type: "+i);r.push("int256[]")}}return r},s.toSerpent=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];if("bytes"===n)e.push("s");else if(n.startsWith("bytes"))e.push("b"+u(n));else if("int256"===n)e.push("i");else{if("int256[]"!==n)throw new Error("Unsupported or invalid type: "+n);e.push("a")}}return e.join("")},t.exports=s},8604:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.importPublic=e.privateToPublic=e.privateToAddress=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.isPrecompiled=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isZeroAddress=e.isValidAddress=e.zeroAddress=void 0;var i=r(9282),o=r(884),s=r(7104),a=r(3550),u=r(277),f=r(1440);e.zeroAddress=function(){var t=u.zeros(20);return u.bufferToHex(t)},e.isValidAddress=function(t){return/^0x[0-9a-fA-F]{40}$/.test(t)},e.isZeroAddress=function(t){return e.zeroAddress()===u.addHexPrefix(t)},e.toChecksumAddress=function(t,e){t=o.stripHexPrefix(t).toLowerCase();for(var r=void 0!==e?e.toString()+"0x":"",n=f.keccak(r+t).toString("hex"),i="0x",s=0;s<t.length;s++)parseInt(n[s],16)>=8?i+=t[s].toUpperCase():i+=t[s];return i},e.isValidChecksumAddress=function(t,r){return e.isValidAddress(t)&&e.toChecksumAddress(t,r)===t},e.generateAddress=function(t,e){t=u.toBuffer(t);var r=new a(e);return r.isZero()?f.rlphash([t,null]).slice(-20):f.rlphash([t,n.from(r.toArray())]).slice(-20)},e.generateAddress2=function(t,e,r){var o=u.toBuffer(t),s=u.toBuffer(e),a=u.toBuffer(r);return i(20===o.length),i(32===s.length),f.keccak256(n.concat([n.from("ff","hex"),o,s,f.keccak256(a)])).slice(-20)},e.isPrecompiled=function(t){var e=u.unpad(t);return 1===e.length&&e[0]>=1&&e[0]<=8},e.isValidPrivate=function(t){return s.privateKeyVerify(t)},e.isValidPublic=function(t,e){return void 0===e&&(e=!1),64===t.length?s.publicKeyVerify(n.concat([n.from([4]),t])):!!e&&s.publicKeyVerify(t)},e.pubToAddress=function(t,e){return void 0===e&&(e=!1),t=u.toBuffer(t),e&&64!==t.length&&(t=s.publicKeyConvert(t,!1).slice(1)),i(64===t.length),f.keccak(t).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToAddress=function(t){return e.publicToAddress(e.privateToPublic(t))},e.privateToPublic=function(t){return t=u.toBuffer(t),s.publicKeyCreate(t,!1).slice(1)},e.importPublic=function(t){return 64!==(t=u.toBuffer(t)).length&&(t=s.publicKeyConvert(t,!1).slice(1)),t}},277:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.baToJSON=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.stripZeros=e.unpad=e.setLengthRight=e.setLength=e.setLengthLeft=e.zeros=void 0;var i=r(884),o=r(3550);e.zeros=function(t){return n.allocUnsafe(t).fill(0)},e.setLengthLeft=function(t,r,n){void 0===n&&(n=!1);var i=e.zeros(r);return t=e.toBuffer(t),n?t.length<r?(t.copy(i),i):t.slice(0,r):t.length<r?(t.copy(i,r-t.length),i):t.slice(-r)},e.setLength=e.setLengthLeft,e.setLengthRight=function(t,r){return e.setLength(t,r,!0)},e.unpad=function(t){for(var e=(t=i.stripHexPrefix(t))[0];t.length>0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t},e.stripZeros=e.unpad,e.toBuffer=function(t){if(!n.isBuffer(t))if(Array.isArray(t))t=n.from(t);else if("string"==typeof t){if(!i.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=n.from(i.padToEven(i.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=i.intToBuffer(t);else if(null==t)t=n.allocUnsafe(0);else if(o.isBN(t))t=t.toArrayLike(n);else{if(!t.toArray)throw new Error("invalid type");t=n.from(t.toArray())}return t},e.bufferToInt=function(t){return new o(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new o(t).fromTwos(256)},e.toUnsigned=function(t){return n.from(t.toTwos(256).toArray())},e.addHexPrefix=function(t){return"string"!=typeof t||i.isHexPrefixed(t)?t:"0x"+t},e.baToJSON=function(t){if(n.isBuffer(t))return"0x"+t.toString("hex");if(t instanceof Array){for(var r=[],i=0;i<t.length;i++)r.push(e.baToJSON(t[i]));return r}}},4964:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.MAX_INTEGER=void 0;var i=r(3550);e.MAX_INTEGER=new i("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new i("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=n.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=n.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=n.from(e.KECCAK256_RLP_S,"hex")},1440:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.rlphash=e.ripemd160=e.sha256=e.keccak256=e.keccak=void 0;var i=r(2192),o=i.keccak224,s=i.keccak384,a=i.keccak256,u=i.keccak512,f=r(3482),h=r(884),c=r(6636),l=r(277);e.keccak=function(t,e){switch(void 0===e&&(e=256),t="string"!=typeof t||h.isHexString(t)?l.toBuffer(t):n.from(t,"utf8"),e||(e=256),e){case 224:return o(t);case 256:return a(t);case 384:return s(t);case 512:return u(t);default:throw new Error("Invald algorithm: keccak"+e)}},e.keccak256=function(t){return e.keccak(t)},e.sha256=function(t){return t=l.toBuffer(t),f("sha256").update(t).digest()},e.ripemd160=function(t,e){t=l.toBuffer(t);var r=f("rmd160").update(t).digest();return!0===e?l.setLength(r,32):r},e.rlphash=function(t){return e.keccak(c.encode(t))}},1964:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=e.rlp=e.BN=void 0;var o=r(7104);e.secp256k1=o;var s=r(884),a=r(3550);e.BN=a;var u=r(6636);e.rlp=u,Object.assign(e,s),i(r(4964),e),i(r(8604),e),i(r(1440),e),i(r(6346),e),i(r(277),e),i(r(9810),e)},9810:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.defineProperties=void 0;var i=r(9282),o=r(884),s=r(6636),a=r(277);e.defineProperties=function(t,e,r){if(t.raw=[],t._fields=[],t.toJSON=function(e){if(void 0===e&&(e=!1),e){var r={};return t._fields.forEach((function(e){r[e]="0x"+t[e].toString("hex")})),r}return a.baToJSON(t.raw)},t.serialize=function(){return s.encode(t.raw)},e.forEach((function(e,r){function o(){return t.raw[r]}function s(o){"00"!==(o=a.toBuffer(o)).toString("hex")||e.allowZero||(o=n.allocUnsafe(0)),e.allowLess&&e.length?(o=a.stripZeros(o),i(e.length>=o.length,"The field "+e.name+" must not have more "+e.length+" bytes")):e.allowZero&&0===o.length||!e.length||i(e.length===o.length,"The field "+e.name+" must have byte length of "+e.length),t.raw[r]=o}t._fields.push(e.name),Object.defineProperty(t,e.name,{enumerable:!0,configurable:!0,get:o,set:s}),e.default&&(t[e.name]=e.default),e.alias&&Object.defineProperty(t,e.alias,{enumerable:!1,configurable:!0,set:s,get:o})})),r)if("string"==typeof r&&(r=n.from(o.stripHexPrefix(r),"hex")),n.isBuffer(r)&&(r=s.decode(r)),Array.isArray(r)){if(r.length>t._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(e,r){t[t._fields[r]]=a.toBuffer(e)}))}else{if("object"!=typeof r)throw new Error("invalid data");var u=Object.keys(r);e.forEach((function(e){-1!==u.indexOf(e.name)&&(t[e.name]=r[e.name]),-1!==u.indexOf(e.alias)&&(t[e.alias]=r[e.alias])}))}}},7104:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.ecdhUnsafe=e.ecdh=e.recover=e.verify=e.sign=e.signatureImportLax=e.signatureImport=e.signatureExport=e.signatureNormalize=e.publicKeyCombine=e.publicKeyTweakMul=e.publicKeyTweakAdd=e.publicKeyVerify=e.publicKeyConvert=e.publicKeyCreate=e.privateKeyTweakMul=e.privateKeyTweakAdd=e.privateKeyModInverse=e.privateKeyNegate=e.privateKeyImport=e.privateKeyExport=e.privateKeyVerify=void 0;var i=r(5053),o=r(2235),s=r(6909);e.privateKeyVerify=function(t){return 32===t.length&&i.privateKeyVerify(Uint8Array.from(t))},e.privateKeyExport=function(t,e){if(32!==t.length)throw new RangeError("private key length is invalid");var r=o.privateKeyExport(t,e);return s.privateKeyExport(t,r,e)},e.privateKeyImport=function(t){if(null!==(t=s.privateKeyImport(t))&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error("couldn't import from DER format")},e.privateKeyNegate=function(t){return n.from(i.privateKeyNegate(Uint8Array.from(t)))},e.privateKeyModInverse=function(t){if(32!==t.length)throw new Error("private key length is invalid");return n.from(o.privateKeyModInverse(Uint8Array.from(t)))},e.privateKeyTweakAdd=function(t,e){return n.from(i.privateKeyTweakAdd(Uint8Array.from(t),e))},e.privateKeyTweakMul=function(t,e){return n.from(i.privateKeyTweakMul(Uint8Array.from(t),Uint8Array.from(e)))},e.publicKeyCreate=function(t,e){return n.from(i.publicKeyCreate(Uint8Array.from(t),e))},e.publicKeyConvert=function(t,e){return n.from(i.publicKeyConvert(Uint8Array.from(t),e))},e.publicKeyVerify=function(t){return(33===t.length||65===t.length)&&i.publicKeyVerify(Uint8Array.from(t))},e.publicKeyTweakAdd=function(t,e,r){return n.from(i.publicKeyTweakAdd(Uint8Array.from(t),Uint8Array.from(e),r))},e.publicKeyTweakMul=function(t,e,r){return n.from(i.publicKeyTweakMul(Uint8Array.from(t),Uint8Array.from(e),r))},e.publicKeyCombine=function(t,e){var r=[];return t.forEach((function(t){r.push(Uint8Array.from(t))})),n.from(i.publicKeyCombine(r,e))},e.signatureNormalize=function(t){return n.from(i.signatureNormalize(Uint8Array.from(t)))},e.signatureExport=function(t){return n.from(i.signatureExport(Uint8Array.from(t)))},e.signatureImport=function(t){return n.from(i.signatureImport(Uint8Array.from(t)))},e.signatureImportLax=function(t){if(0===t.length)throw new RangeError("signature length is invalid");var e=s.signatureImportLax(t);if(null===e)throw new Error("couldn't parse DER signature");return o.signatureImport(e)},e.sign=function(t,e,r){if(null===r)throw new TypeError("options should be an Object");var o=void 0;if(r){if(o={},null===r.data)throw new TypeError("options.data should be a Buffer");if(r.data){if(32!=r.data.length)throw new RangeError("options.data length is invalid");o.data=new Uint8Array(r.data)}if(null===r.noncefn)throw new TypeError("options.noncefn should be a Function");r.noncefn&&(o.noncefn=function(t,e,i,o,s){var a=null!=i?n.from(i):null,u=null!=o?n.from(o):null,f=n.from("");return r.noncefn&&(f=r.noncefn(n.from(t),n.from(e),a,u,s)),new Uint8Array(f)})}var s=i.ecdsaSign(Uint8Array.from(t),Uint8Array.from(e),o);return{signature:n.from(s.signature),recovery:s.recid}},e.verify=function(t,e,r){return i.ecdsaVerify(Uint8Array.from(e),Uint8Array.from(t),r)},e.recover=function(t,e,r,o){return n.from(i.ecdsaRecover(Uint8Array.from(e),r,Uint8Array.from(t),o))},e.ecdh=function(t,e){return n.from(i.ecdh(Uint8Array.from(t),Uint8Array.from(e),{}))},e.ecdhUnsafe=function(t,e,r){if(33!==t.length&&65!==t.length)throw new RangeError("public key length is invalid");if(32!==e.length)throw new RangeError("private key length is invalid");return n.from(o.ecdhUnsafe(Uint8Array.from(t),Uint8Array.from(e),r))}},6909:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var i=n.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),o=n.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);e.privateKeyExport=function(t,e,r){void 0===r&&(r=!0);var s=n.from(r?i:o);return t.copy(s,r?8:9),e.copy(s,r?181:214),s},e.privateKeyImport=function(t){var e=t.length,r=0;if(e<r+1||48!==t[r])return null;if(e<(r+=1)+1||!(128&t[r]))return null;var n=127&t[r];if(n<1||n>2)return null;if(e<(r+=1)+n)return null;var i=t[r+n-1]|(n>1?t[r+n-2]<<8:0);return e<(r+=n)+i||e<r+3||2!==t[r]||1!==t[r+1]||1!==t[r+2]||e<(r+=3)+2||4!==t[r]||t[r+1]>32||e<r+2+t[r+1]?null:t.slice(r+2,r+2+t[r+1])},e.signatureImportLax=function(t){var e=n.alloc(32,0),r=n.alloc(32,0),i=t.length,o=0;if(48!==t[o++])return null;var s=t[o++];if(128&s&&(o+=s-128)>i)return null;if(2!==t[o++])return null;var a=t[o++];if(128&a){if(o+(s=a-128)>i)return null;for(;s>0&&0===t[o];o+=1,s-=1);for(a=0;s>0;o+=1,s-=1)a=(a<<8)+t[o]}if(a>i-o)return null;var u=o;if(o+=a,2!==t[o++])return null;var f=t[o++];if(128&f){if(o+(s=f-128)>i)return null;for(;s>0&&0===t[o];o+=1,s-=1);for(f=0;s>0;o+=1,s-=1)f=(f<<8)+t[o]}if(f>i-o)return null;var h=o;for(o+=f;a>0&&0===t[u];a-=1,u+=1);if(a>32)return null;var c=t.slice(u,u+a);for(c.copy(e,32-c.length);f>0&&0===t[h];f-=1,h+=1);if(f>32)return null;var l=t.slice(h,h+f);return l.copy(r,32-l.length),{r:e,s:r}}},2235:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var i=r(3550),o=new(0,r(6266).ec)("secp256k1"),s=o.curve;e.privateKeyExport=function(t,e){void 0===e&&(e=!0);var r=new i(t);if(r.ucmp(s.n)>=0)throw new Error("couldn't export to DER format");var n=o.g.mul(r);return a(n.getX(),n.getY(),e)},e.privateKeyModInverse=function(t){var e=new i(t);if(e.ucmp(s.n)>=0||e.isZero())throw new Error("private key range is invalid");return e.invm(s.n).toArrayLike(n,"be",32)},e.signatureImport=function(t){var e=new i(t.r);e.ucmp(s.n)>=0&&(e=new i(0));var r=new i(t.s);return r.ucmp(s.n)>=0&&(r=new i(0)),n.concat([e.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},e.ecdhUnsafe=function(t,e,r){void 0===r&&(r=!0);var n=o.keyFromPublic(t),u=new i(e);if(u.ucmp(s.n)>=0||u.isZero())throw new Error("scalar was invalid (zero or overflow)");var f=n.pub.mul(u);return a(f.getX(),f.getY(),r)};var a=function(t,e,r){var i;return r?((i=n.alloc(33))[0]=e.isOdd()?3:2,t.toArrayLike(n,"be",32).copy(i,1)):((i=n.alloc(65))[0]=4,t.toArrayLike(n,"be",32).copy(i,1),e.toArrayLike(n,"be",32).copy(i,33)),i}},6346:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;var i=r(7104),o=r(3550),s=r(277),a=r(1440);function u(t,e){return e?t-(2*e+35):t-27}function f(t){return 0===t||1===t}e.ecsign=function(t,e,r){var n=i.sign(t,e),o=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?o+(2*r+35):o+27}},e.ecrecover=function(t,e,r,o,a){var h=n.concat([s.setLength(r,32),s.setLength(o,32)],64),c=u(e,a);if(!f(c))throw new Error("Invalid signature v value");var l=i.recover(t,h,c);return i.publicKeyConvert(l,!1).slice(1)},e.toRpcSig=function(t,e,r,i){if(!f(u(t,i)))throw new Error("Invalid signature v value");return s.bufferToHex(n.concat([s.setLengthLeft(e,32),s.setLengthLeft(r,32),s.toBuffer(t)]))},e.fromRpcSig=function(t){var e=s.toBuffer(t);if(65!==e.length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},e.isValidSignature=function(t,e,r,n,i){void 0===n&&(n=!0);var s=new o("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new o("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!f(u(t,i)))return!1;var h=new o(e),c=new o(r);return!(h.isZero()||h.gt(a)||c.isZero()||c.gt(a)||n&&1===c.cmp(s))},e.hashPersonalMessage=function(t){var e=n.from("Ethereum Signed Message:\n"+t.length.toString(),"utf-8");return a.keccak(n.concat([e,t]))}},884:(t,e,r)=>{"use strict";var n=r(8764).Buffer,i=r(3944),o=r(9604);function s(t){var e=t;if("string"!=typeof e)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof e+", while padToEven.");return e.length%2&&(e="0"+e),e}function a(t){return"0x"+t.toString(16)}t.exports={arrayContainsArray:function(t,e,r){if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof t+"'");if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof e+"'");return e[Boolean(r)?"some":"every"]((function(e){return t.indexOf(e)>=0}))},intToBuffer:function(t){var e=a(t);return new n(s(e.slice(2)),"hex")},getBinarySize:function(t){if("string"!=typeof t)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof t+"'.");return n.byteLength(t,"utf8")},isHexPrefixed:i,stripHexPrefix:o,padToEven:s,intToHex:a,fromAscii:function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r).toString(16);e+=n.length<2?"0"+n:n}return"0x"+e},fromUtf8:function(t){return"0x"+s(new n(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(t){var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(t.substr(r,2),16);e+=String.fromCharCode(i)}return e},toUtf8:function(t){return new n(s(o(t).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(t,e,r){if(!Array.isArray(t))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof t+"'");if("string"!=typeof e)throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof e+"'.");for(var n=[],i=0;i<t.length;i++){var o=t[i][e];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("invalid abi");n.push(o)}return n},isHexString:function(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}}},7187:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}m(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&m(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){var i,o,s,f;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,f=h,console&&console.warn&&console.warn(f)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function l(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):p(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function m(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var f=u.length,h=p(u,f);for(r=0;r<f;++r)n(h[r],this,e)}return!0},o.prototype.addListener=function(t,e){return f(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return f(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,c(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,c(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(a(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},3048:(t,e,r)=>{var n=r(9509).Buffer,i=r(2318);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),u=n.alloc(o||0),f=n.alloc(0);s>0||o>0;){var h=new i;h.update(f),h.update(t),e&&h.update(e),f=h.digest();var c=0;if(s>0){var l=a.length-s;c=Math.min(s,f.length),f.copy(a,l,0,c),s-=c}if(c<f.length&&o>0){var d=u.length-o,p=Math.min(o,f.length-c);f.copy(u,d,c,c+p),o-=p}}return f.fill(0),{key:a,iv:u}}},9804:t=>{var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var s=0;s<o;s++)n.call(i,t[s],s,t);else for(var a in t)e.call(t,a)&&n.call(i,t[a],a,t)}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},f=Math.max(0,o.length-a.length),h=[],c=0;c<f;c++)h.push("$"+c);if(s=Function("binder","return function ("+h.join(",")+"){ return binder.apply(this,arguments); }")(u),o.prototype){var l=function(){};l.prototype=o.prototype,s.prototype=new l,l.prototype=null}return s}},8612:(t,e,r)=>{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var f=function(){throw new s},h=u?function(){try{return f}catch(t){try{return u(arguments,"callee").get}catch(t){return f}}}():f,c=r(1405)(),l=Object.getPrototypeOf||function(t){return t.__proto__},d={},p="undefined"==typeof Uint8Array?n:l(Uint8Array),m={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":c?l([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c?l(l([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c?l((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c?l((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c?l(""[Symbol.iterator]()):n,"%Symbol%":c?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":h,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=l(i.prototype))}return m[e]=r,r},y={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(8612),v=r(7642),w=b.call(Function.call,Array.prototype.concat),M=b.call(Function.apply,Array.prototype.splice),_=b.call(Function.call,String.prototype.replace),E=b.call(Function.call,String.prototype.slice),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,x=function(t){var e=E(t,0,1),r=E(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,S,(function(t,e,r,i){n[n.length]=r?_(i,A,"$1"):e||t})),n},k=function(t,e){var r,n=t;if(v(y,n)&&(n="%"+(r=y[n])[0]+"%"),v(m,n)){var o=m[n];if(o===d&&(o=g(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var r=x(t),n=r.length>0?r[0]:"",o=k("%"+n+"%",e),a=o.name,f=o.value,h=!1,c=o.alias;c&&(n=c[0],M(r,w([0,1],c)));for(var l=1,d=!0;l<r.length;l+=1){var p=r[l],g=E(p,0,1),y=E(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===y||"'"===y||"`"===y)&&g!==y)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&d||(h=!0),v(m,a="%"+(n+="."+p)+"%"))f=m[a];else if(null!=f){if(!(p in f)){if(!e)throw new s("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&l+1>=r.length){var b=u(f,p);f=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:f[p]}else d=v(f,p),f=f[p];d&&!h&&(m[a]=f)}}return f}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(t,e,r)=>{"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},3349:(t,e,r)=>{"use strict";var n=r(9509).Buffer,i=r(8473).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(5717)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},3715:(t,e,r)=>{var n=e;n.utils=r(6436),n.common=r(5772),n.sha=r(9041),n.ripemd=r(2949),n.hmac=r(2344),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},5772:(t,e,r)=>{"use strict";var n=r(6436),i=r(9746);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.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 i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.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 i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},2344:(t,e,r)=>{"use strict";var n=r(6436),i=r(9746);function o(t,e,r){if(!(this instanceof o))return new o(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=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(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)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},2949:(t,e,r)=>{"use strict";var n=r(6436),i=r(5772),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,f=i.BlockHash;function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(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 l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(h,f),e.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],f=this.h[3],h=this.h[4],b=r,v=n,w=i,M=f,_=h,E=0;E<80;E++){var S=s(o(u(r,c(E,n,i,f),t[p[E]+e],l(E)),g[E]),h);r=h,h=f,f=o(i,10),i=n,n=S,S=s(o(u(b,c(79-E,v,w,M),t[m[E]+e],d(E)),y[E]),_),b=_,_=M,M=o(w,10),w=v,v=S}S=a(this.h[1],i,M),this.h[1]=a(this.h[2],f,_),this.h[2]=a(this.h[3],h,b),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=S},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[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]},9041:(t,e,r)=>{"use strict";e.sha1=r(4761),e.sha224=r(799),e.sha256=r(9344),e.sha384=r(772),e.sha512=r(5900)},4761:(t,e,r)=>{"use strict";var n=r(6436),i=r(5772),o=r(7038),s=n.rotl32,a=n.sum32,u=n.sum32_5,f=o.ft_1,h=i.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,h),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.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(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],h=this.h[2],l=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),m=u(s(i,5),f(p,o,h,l),d,r[n],c[p]);d=l,l=h,h=s(o,30),o=i,i=m}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},799:(t,e,r)=>{"use strict";var n=r(6436),i=r(9344);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},9344:(t,e,r)=>{"use strict";var n=r(6436),i=r(5772),o=r(7038),s=r(9746),a=n.sum32,u=n.sum32_4,f=n.sum32_5,h=o.ch32,c=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,g=i.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 b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(b,g),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.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]=u(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],y=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],M=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var _=f(M,d(b),h(b,v,w),this.k[n],r[n]),E=a(l(i),c(i,o,g));M=w,w=v,v=b,b=a(y,_),y=g,g=o,o=i,i=a(_,E)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],y),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],M)},b.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},772:(t,e,r)=>{"use strict";var n=r(6436),i=r(5900);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},5900:(t,e,r)=>{"use strict";var n=r(6436),i=r(5772),o=r(9746),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,f=n.shr64_lo,h=n.sum64,c=n.sum64_hi,l=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,g=n.sum64_5_lo,y=i.BlockHash,b=[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 v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function M(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function _(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function S(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function k(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=a(t,e,1)^a(t,e,8)^f(t,e,7);return r<0&&(r+=4294967296),r}function P(t,e){var r=a(t,e,19)^a(e,t,29)^f(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,y),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.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 i=(g=r[n-4],y=r[n-3],b=void 0,(b=s(g,y,19)^s(y,g,29)^u(g,y,6))<0&&(b+=4294967296),b),o=P(r[n-4],r[n-3]),a=r[n-14],f=r[n-13],h=k(r[n-30],r[n-29]),c=B(r[n-30],r[n-29]),l=r[n-32],m=r[n-31];r[n]=d(i,o,a,f,h,c,l,m),r[n+1]=p(i,o,a,f,h,c,l,m)}var g,y,b},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r,n,i,a=this.W,u=this.h[0],f=this.h[1],d=this.h[2],p=this.h[3],y=this.h[4],b=this.h[5],v=this.h[6],k=this.h[7],B=this.h[8],P=this.h[9],I=this.h[10],O=this.h[11],T=this.h[12],R=this.h[13],N=this.h[14],L=this.h[15];o(this.k.length===a.length);for(var C=0;C<a.length;C+=2){var j=N,D=L,U=(i=void 0,(i=s(r=B,n=P,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),z=x(B,P),F=w(B,0,I,0,T),H=M(0,P,0,O,0,R),q=this.k[C],K=this.k[C+1],G=a[C],V=a[C+1],Z=m(j,D,U,z,F,H,q,K,G,V),W=g(j,D,U,z,F,H,q,K,G,V);j=S(u,f),D=A(u,f),U=_(u,0,d,0,y),z=E(0,f,0,p,0,b);var J=c(j,D,U,z),$=l(j,D,U,z);N=T,L=R,T=I,R=O,I=B,O=P,B=c(v,k,Z,W),P=l(k,k,Z,W),v=y,k=b,y=d,b=p,d=u,p=f,u=c(Z,W,J,$),f=l(Z,W,J,$)}h(this.h,0,u,f),h(this.h,2,d,p),h(this.h,4,y,b),h(this.h,6,v,k),h(this.h,8,B,P),h(this.h,10,I,O),h(this.h,12,T,R),h(this.h,14,N,L)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7038:(t,e,r)=>{"use strict";var n=r(6436).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,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}},6436:(t,e,r)=>{"use strict";var n=r(9746),i=r(5717);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(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=i,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),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=u(i.toString(16))}return r},e.zero2=a,e.zero8=u,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var f;f="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=f>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},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,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},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,i,o,s,a){var u=0,f=e;return u+=(f=f+n>>>0)<e?1:0,u+=(f=f+o>>>0)<o?1:0,t+r+i+s+(u+=(f=f+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,f){var h=0,c=e;return h+=(c=c+n>>>0)<e?1:0,h+=(c=c+o>>>0)<o?1:0,h+=(c=c+a>>>0)<a?1:0,t+r+i+s+u+(h+=(c=c+f>>>0)<f?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,f){return e+n+o+a+f>>>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}},2156:(t,e,r)=>{"use strict";var n=r(3715),i=r(4504),o=r(9746);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=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=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 i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.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=i.toArray(t,e),r=i.toArray(r,n),o(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=i.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 s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,h=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=f}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<<f)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;t[r+d]=255&s,d+=p,s/=256,f-=8);t[r+d-p]|=128*m}},5717: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}}},2584:(t,e,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},8662:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},3944:t=>{t.exports=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},8611:t=>{"use strict";t.exports=function(t){return t!=t}},360:(t,e,r)=>{"use strict";var n=r(5559),i=r(4289),o=r(8611),s=r(9415),a=r(3194),u=n(s(),Number);i(u,{getPolyfill:s,implementation:o,shim:a}),t.exports=u},9415:(t,e,r)=>{"use strict";var n=r(8611);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3194:(t,e,r)=>{"use strict";var n=r(4289),i=r(9415);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},5692:(t,e,r)=>{"use strict";var n=r(9804),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u=i(),f=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},h=o("String.prototype.slice"),c={},l=r(882),d=Object.getPrototypeOf;a&&l&&d&&n(u,(function(t){var e=new r.g[t];if(Symbol.toStringTag in e){var n=d(e),i=l(n,Symbol.toStringTag);if(!i){var o=d(n);i=l(o,Symbol.toStringTag)}c[t]=i.get}})),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!a||!(Symbol.toStringTag in t)){var e=h(s(t),8,-1);return f(u,e)>-1}return!!l&&function(t){var e=!1;return n(c,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},1094:(t,e,r)=>{var n,i=r(4155);!function(){"use strict";var o="input is invalid type",s="object"==typeof window,a=s?window:{};a.JS_SHA3_NO_WINDOW&&(s=!1);var u=!s&&"object"==typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?a=r.g:u&&(a=self);var f=!a.JS_SHA3_NO_COMMON_JS&&t.exports,h=r.amdO,c=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),d=[4,1024,262144,67108864],p=[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],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!c||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var w=function(t,e,r){return function(n){return new L(t,e,t).update(n)[r]()}},M=function(t,e,r){return function(n,i){return new L(t,e,i).update(n)[r]()}},_=function(t,e,r){return function(e,n,i,o){return k["cshake"+t].update(e,n,i,o)[r]()}},E=function(t,e,r){return function(e,n,i,o){return k["kmac"+t].update(e,n,i,o)[r]()}},S=function(t,e,r,n){for(var i=0;i<b.length;++i){var o=b[i];t[o]=e(r,n,o)}return t},A=function(t,e){var r=w(t,e,"hex");return r.create=function(){return new L(t,e,t)},r.update=function(t){return r.create().update(t)},S(r,w,t,e)},x=[{name:"keccak",padding:[1,256,65536,16777216],bits:g,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:g,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:y,createMethod:function(t,e){var r=M(t,e,"hex");return r.create=function(r){return new L(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},S(r,M,t,e)}},{name:"cshake",padding:d,bits:y,createMethod:function(t,e){var r=v[t],n=_(t,0,"hex");return n.create=function(n,i,o){return i||o?new L(t,e,n).bytepad([i,o],r):k["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},S(n,_,t,e)}},{name:"kmac",padding:d,bits:y,createMethod:function(t,e){var r=v[t],n=E(t,0,"hex");return n.create=function(n,i,o){return new C(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},S(n,E,t,e)}}],k={},B=[],P=0;P<x.length;++P)for(var I=x[P],O=I.bits,T=0;T<O.length;++T){var R=I.name+"_"+O[T];if(B.push(R),k[R]=I.createMethod(O[T],I.padding),"sha3"!==I.name){var N=I.name+O[T];B.push(N),k[N]=k[R]}}function L(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 C(t,e,r){L.call(this,t,e,r)}L.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(o);if(null===t)throw new Error(o);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(o);e=!0}for(var n,i,s=this.blocks,a=this.byteCount,u=t.length,f=this.blockCount,h=0,l=this.s;h<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<f+1;++n)s[n]=0;if(e)for(n=this.start;h<u&&n<a;++h)s[n>>2]|=t[h]<<p[3&n++];else for(n=this.start;h<u&&n<a;++h)(i=t.charCodeAt(h))<128?s[n>>2]|=i<<p[3&n++]:i<2048?(s[n>>2]|=(192|i>>6)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]):i<55296||i>=57344?(s[n>>2]|=(224|i>>12)<<p[3&n++],s[n>>2]|=(128|i>>6&63)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++h)),s[n>>2]|=(240|i>>18)<<p[3&n++],s[n>>2]|=(128|i>>12&63)<<p[3&n++],s[n>>2]|=(128|i>>6&63)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[f],n=0;n<f;++n)l[n]^=s[n];j(l),this.reset=!0}else this.start=n}return this},L.prototype.encode=function(t,e){var r=255&t,n=1,i=[r];for(r=255&(t>>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},L.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(o);if(null===t)throw new Error(o);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(o);e=!0}var n=0,i=t.length;if(e)n=i;else for(var s=0;s<t.length;++s){var a=t.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},L.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var i=e-r%e,o=[];return o.length=i,this.update(o),this},L.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];j(n)}},L.prototype.toString=L.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<e&&s<n;++o,++s)t=r[o],a+=l[t>>4&15]+l[15&t]+l[t>>12&15]+l[t>>8&15]+l[t>>20&15]+l[t>>16&15]+l[t>>28&15]+l[t>>24&15];s%e==0&&(j(r),o=0)}return i&&(t=r[o],a+=l[t>>4&15]+l[15&t],i>1&&(a+=l[t>>12&15]+l[t>>8&15]),i>2&&(a+=l[t>>20&15]+l[t>>16&15])),a},L.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&j(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},L.prototype.buffer=L.prototype.arrayBuffer,L.prototype.digest=L.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&j(n)}return o&&(t=a<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},C.prototype=new L,C.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var j=function(t){var e,r,n,i,o,s,a,u,f,h,c,l,d,p,g,y,b,v,w,M,_,E,S,A,x,k,B,P,I,O,T,R,N,L,C,j,D,U,z,F,H,q,K,G,V,Z,W,J,$,X,Y,Q,tt,et,rt,nt,it,ot,st,at,ut,ft,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(u<<1|f>>>31),r=o^(f<<1|u>>>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=s^(h<<1|c>>>31),r=a^(c<<1|h>>>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=u^(l<<1|d>>>31),r=f^(d<<1|l>>>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=h^(i<<1|o>>>31),r=c^(o<<1|i>>>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,p=t[0],g=t[1],Z=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,q=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,L=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,b=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,$=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ft=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,j=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,N=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=p^~y&v,t[1]=g^~b&w,t[10]=A^~k&P,t[11]=x^~B&I,t[20]=L^~j&U,t[21]=C^~D&z,t[30]=G^~Z&J,t[31]=V^~W&$,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~v&M,t[3]=b^~w&_,t[12]=k^~P&O,t[13]=B^~I&T,t[22]=j^~U&F,t[23]=D^~z&H,t[32]=Z^~J&X,t[33]=W^~$&Y,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=v^~M&E,t[5]=w^~_&S,t[14]=P^~O&R,t[15]=I^~T&N,t[24]=U^~F&q,t[25]=z^~H&K,t[34]=J^~X&Q,t[35]=$^~Y&tt,t[44]=ot^~at&ft,t[45]=st^~ut&ht,t[6]=M^~E&p,t[7]=_^~S&g,t[16]=O^~R&A,t[17]=T^~N&x,t[26]=F^~q&L,t[27]=H^~K&C,t[36]=X^~Q&G,t[37]=Y^~tt&V,t[46]=at^~ft&et,t[47]=ut^~ht&rt,t[8]=E^~p&y,t[9]=S^~g&b,t[18]=R^~A&k,t[19]=N^~x&B,t[28]=q^~L&j,t[29]=K^~C&D,t[38]=Q^~G&Z,t[39]=tt^~V&W,t[48]=ft^~et&nt,t[49]=ht^~rt&it,t[0]^=m[n],t[1]^=m[n+1]};if(f)t.exports=k;else{for(P=0;P<B.length;++P)a[B[P]]=k[B[P]];h&&(void 0===(n=function(){return k}.call(e,r,e,t))||(t.exports=n))}}()},5811:(t,e,r)=>{t.exports=r(6066)(r(9653))},6066:(t,e,r)=>{const n=r(7016),i=r(5675);t.exports=function(t){const e=n(t),r=i(t);return function(t,n){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}},7016:(t,e,r)=>{var n=r(8764).Buffer;const{Transform:i}=r(2830);t.exports=t=>class e extends i{constructor(e,r,n,i,o){super(o),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let n=null;try{this.update(t,e)}catch(t){n=t}r(n)}_flush(t){let e=null;try{this.push(this.digest())}catch(t){e=t}t(e)}update(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(t)||(t=n.from(t,e)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}},5675:(t,e,r)=>{var n=r(8764).Buffer;const{Transform:i}=r(2830);t.exports=t=>class e extends i{constructor(e,r,n,i){super(i),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let n=null;try{this.update(t,e)}catch(t){n=t}r(n)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return n.isBuffer(t)||(t=n.from(t,e)),this._state.absorb(t),this}squeeze(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}},4040:(t,e)=>{const r=[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];e.p1600=function(t){for(let e=0;e<24;++e){const n=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],a=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],h=t[7]^t[17]^t[27]^t[37]^t[47],c=t[8]^t[18]^t[28]^t[38]^t[48],l=t[9]^t[19]^t[29]^t[39]^t[49];let d=c^(o<<1|s>>>31),p=l^(s<<1|o>>>31);const m=t[0]^d,g=t[1]^p,y=t[10]^d,b=t[11]^p,v=t[20]^d,w=t[21]^p,M=t[30]^d,_=t[31]^p,E=t[40]^d,S=t[41]^p;d=n^(a<<1|u>>>31),p=i^(u<<1|a>>>31);const A=t[2]^d,x=t[3]^p,k=t[12]^d,B=t[13]^p,P=t[22]^d,I=t[23]^p,O=t[32]^d,T=t[33]^p,R=t[42]^d,N=t[43]^p;d=o^(f<<1|h>>>31),p=s^(h<<1|f>>>31);const L=t[4]^d,C=t[5]^p,j=t[14]^d,D=t[15]^p,U=t[24]^d,z=t[25]^p,F=t[34]^d,H=t[35]^p,q=t[44]^d,K=t[45]^p;d=a^(c<<1|l>>>31),p=u^(l<<1|c>>>31);const G=t[6]^d,V=t[7]^p,Z=t[16]^d,W=t[17]^p,J=t[26]^d,$=t[27]^p,X=t[36]^d,Y=t[37]^p,Q=t[46]^d,tt=t[47]^p;d=f^(n<<1|i>>>31),p=h^(i<<1|n>>>31);const et=t[8]^d,rt=t[9]^p,nt=t[18]^d,it=t[19]^p,ot=t[28]^d,st=t[29]^p,at=t[38]^d,ut=t[39]^p,ft=t[48]^d,ht=t[49]^p,ct=m,lt=g,dt=b<<4|y>>>28,pt=y<<4|b>>>28,mt=v<<3|w>>>29,gt=w<<3|v>>>29,yt=_<<9|M>>>23,bt=M<<9|_>>>23,vt=E<<18|S>>>14,wt=S<<18|E>>>14,Mt=A<<1|x>>>31,_t=x<<1|A>>>31,Et=B<<12|k>>>20,St=k<<12|B>>>20,At=P<<10|I>>>22,xt=I<<10|P>>>22,kt=T<<13|O>>>19,Bt=O<<13|T>>>19,Pt=R<<2|N>>>30,It=N<<2|R>>>30,Ot=C<<30|L>>>2,Tt=L<<30|C>>>2,Rt=j<<6|D>>>26,Nt=D<<6|j>>>26,Lt=z<<11|U>>>21,Ct=U<<11|z>>>21,jt=F<<15|H>>>17,Dt=H<<15|F>>>17,Ut=K<<29|q>>>3,zt=q<<29|K>>>3,Ft=G<<28|V>>>4,Ht=V<<28|G>>>4,qt=W<<23|Z>>>9,Kt=Z<<23|W>>>9,Gt=J<<25|$>>>7,Vt=$<<25|J>>>7,Zt=X<<21|Y>>>11,Wt=Y<<21|X>>>11,Jt=tt<<24|Q>>>8,$t=Q<<24|tt>>>8,Xt=et<<27|rt>>>5,Yt=rt<<27|et>>>5,Qt=nt<<20|it>>>12,te=it<<20|nt>>>12,ee=st<<7|ot>>>25,re=ot<<7|st>>>25,ne=at<<8|ut>>>24,ie=ut<<8|at>>>24,oe=ft<<14|ht>>>18,se=ht<<14|ft>>>18;t[0]=ct^~Et&Lt,t[1]=lt^~St&Ct,t[10]=Ft^~Qt&mt,t[11]=Ht^~te&gt,t[20]=Mt^~Rt&Gt,t[21]=_t^~Nt&Vt,t[30]=Xt^~dt&At,t[31]=Yt^~pt&xt,t[40]=Ot^~qt&ee,t[41]=Tt^~Kt&re,t[2]=Et^~Lt&Zt,t[3]=St^~Ct&Wt,t[12]=Qt^~mt&kt,t[13]=te^~gt&Bt,t[22]=Rt^~Gt&ne,t[23]=Nt^~Vt&ie,t[32]=dt^~At&jt,t[33]=pt^~xt&Dt,t[42]=qt^~ee&yt,t[43]=Kt^~re&bt,t[4]=Lt^~Zt&oe,t[5]=Ct^~Wt&se,t[14]=mt^~kt&Ut,t[15]=gt^~Bt&zt,t[24]=Gt^~ne&vt,t[25]=Vt^~ie&wt,t[34]=At^~jt&Jt,t[35]=xt^~Dt&$t,t[44]=ee^~yt&Pt,t[45]=re^~bt&It,t[6]=Zt^~oe&ct,t[7]=Wt^~se&lt,t[16]=kt^~Ut&Ft,t[17]=Bt^~zt&Ht,t[26]=ne^~vt&Mt,t[27]=ie^~wt&_t,t[36]=jt^~Jt&Xt,t[37]=Dt^~$t&Yt,t[46]=yt^~Pt&Ot,t[47]=bt^~It&Tt,t[8]=oe^~ct&Et,t[9]=se^~lt&St,t[18]=Ut^~Ft&Qt,t[19]=zt^~Ht&te,t[28]=vt^~Mt&Rt,t[29]=wt^~_t&Nt,t[38]=Jt^~Xt&dt,t[39]=$t^~Yt&pt,t[48]=Pt^~Ot&qt,t[49]=It^~Tt&Kt,t[0]^=r[2*e],t[1]^=r[2*e+1]}}},9653:(t,e,r)=>{var n=r(8764).Buffer;const i=r(4040);function o(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}o.prototype.initialize=function(t,e){for(let t=0;t<50;++t)this.state[t]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},o.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0)},o.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<this.count%4*8,0!=(128&t)&&this.count===this.blockSize-1&&i.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,i.p1600(this.state),this.count=0,this.squeezing=!0},o.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=n.alloc(t);for(let r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return e},o.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing},t.exports=o},2318:(t,e,r)=>{"use strict";var n=r(5717),i=r(3349),o=r(9509).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(t,e){return t<<e|t>>>32-e}function f(t,e,r,n,i,o,s){return u(t+(e&r|~e&n)+i+o|0,s)+e|0}function h(t,e,r,n,i,o,s){return u(t+(e&n|r&~n)+i+o|0,s)+e|0}function c(t,e,r,n,i,o,s){return u(t+(e^r^n)+i+o|0,s)+e|0}function l(t,e,r,n,i,o,s){return u(t+(r^(e|~n))+i+o|0,s)+e|0}n(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=f(r,n,i,o,t[0],3614090360,7),o=f(o,r,n,i,t[1],3905402710,12),i=f(i,o,r,n,t[2],606105819,17),n=f(n,i,o,r,t[3],3250441966,22),r=f(r,n,i,o,t[4],4118548399,7),o=f(o,r,n,i,t[5],1200080426,12),i=f(i,o,r,n,t[6],2821735955,17),n=f(n,i,o,r,t[7],4249261313,22),r=f(r,n,i,o,t[8],1770035416,7),o=f(o,r,n,i,t[9],2336552879,12),i=f(i,o,r,n,t[10],4294925233,17),n=f(n,i,o,r,t[11],2304563134,22),r=f(r,n,i,o,t[12],1804603682,7),o=f(o,r,n,i,t[13],4254626195,12),i=f(i,o,r,n,t[14],2792965006,17),r=h(r,n=f(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=h(o,r,n,i,t[6],3225465664,9),i=h(i,o,r,n,t[11],643717713,14),n=h(n,i,o,r,t[0],3921069994,20),r=h(r,n,i,o,t[5],3593408605,5),o=h(o,r,n,i,t[10],38016083,9),i=h(i,o,r,n,t[15],3634488961,14),n=h(n,i,o,r,t[4],3889429448,20),r=h(r,n,i,o,t[9],568446438,5),o=h(o,r,n,i,t[14],3275163606,9),i=h(i,o,r,n,t[3],4107603335,14),n=h(n,i,o,r,t[8],1163531501,20),r=h(r,n,i,o,t[13],2850285829,5),o=h(o,r,n,i,t[2],4243563512,9),i=h(i,o,r,n,t[7],1735328473,14),r=c(r,n=h(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=c(o,r,n,i,t[8],2272392833,11),i=c(i,o,r,n,t[11],1839030562,16),n=c(n,i,o,r,t[14],4259657740,23),r=c(r,n,i,o,t[1],2763975236,4),o=c(o,r,n,i,t[4],1272893353,11),i=c(i,o,r,n,t[7],4139469664,16),n=c(n,i,o,r,t[10],3200236656,23),r=c(r,n,i,o,t[13],681279174,4),o=c(o,r,n,i,t[0],3936430074,11),i=c(i,o,r,n,t[3],3572445317,16),n=c(n,i,o,r,t[6],76029189,23),r=c(r,n,i,o,t[9],3654602809,4),o=c(o,r,n,i,t[12],3873151461,11),i=c(i,o,r,n,t[15],530742520,16),r=l(r,n=c(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=l(o,r,n,i,t[7],1126891415,10),i=l(i,o,r,n,t[14],2878612391,15),n=l(n,i,o,r,t[5],4237533241,21),r=l(r,n,i,o,t[12],1700485571,6),o=l(o,r,n,i,t[3],2399980690,10),i=l(i,o,r,n,t[10],4293915773,15),n=l(n,i,o,r,t[1],2240044497,21),r=l(r,n,i,o,t[8],1873313359,6),o=l(o,r,n,i,t[15],4264355552,10),i=l(i,o,r,n,t[6],2734768916,15),n=l(n,i,o,r,t[13],1309151649,21),r=l(r,n,i,o,t[4],4149444226,6),o=l(o,r,n,i,t[11],3174756917,10),i=l(i,o,r,n,t[2],718787259,15),n=l(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},3047:(t,e,r)=>{var n=r(3550),i=r(9931);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),s=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var a=t.subn(1),u=0;!a.testn(u);u++);for(var f=t.shrn(u),h=a.toRed(o);e>0;e--){var c=this._randrange(new n(2),a);r&&r(c);var l=c.toRed(o).redPow(f);if(0!==l.cmp(s)&&0!==l.cmp(h)){for(var d=1;d<u;d++){if(0===(l=l.redSqr()).cmp(s))return!1;if(0===l.cmp(h))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(t,e){var r=t.bitLength(),i=n.mont(t),o=new n(1).toRed(i);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var u=t.shrn(a),f=s.toRed(i);e>0;e--){var h=this._randrange(new n(2),s),c=t.gcd(h);if(0!==c.cmpn(1))return c;var l=h.toRed(i).redPow(u);if(0!==l.cmp(o)&&0!==l.cmp(f)){for(var d=1;d<a;d++){if(0===(l=l.redSqr()).cmp(o))return l.fromRed().subn(1).gcd(t);if(0===l.cmp(f))break}if(d===a)return(l=l.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},9746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},4504:(t,e)=>{"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(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)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),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 i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},4244:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},609:(t,e,r)=>{"use strict";var n=r(4289),i=r(5559),o=r(4244),s=r(5624),a=r(2281),u=i(s(),Object);n(u,{getPolyfill:s,implementation:o,shim:a}),t.exports=u},5624:(t,e,r)=>{"use strict";var n=r(4244);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:(t,e,r)=>{"use strict";var n=r(5624),i=r(4289);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8987:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(1414),a=Object.prototype.propertyIsEnumerable,u=!a.call({toString:null},"toString"),f=a.call((function(){}),"prototype"),h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var e=t.constructor;return e&&e.prototype===t},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!l["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{c(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),l=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=f&&r;if(a&&t.length>0&&!i.call(t,0))for(var m=0;m<t.length;++m)l.push(String(m));if(n&&t.length>0)for(var g=0;g<t.length;++g)l.push(String(g));else for(var y in t)p&&"prototype"===y||!i.call(t,y)||l.push(String(y));if(u)for(var b=function(t){if("undefined"==typeof window||!d)return c(t);try{return c(t)}catch(t){return!1}}(t),v=0;v<h.length;++v)b&&"constructor"===h[v]||!i.call(t,h[v])||l.push(h[v]);return l}}t.exports=n},2215:(t,e,r)=>{"use strict";var n=Array.prototype.slice,i=r(1414),o=Object.keys,s=o?function(t){return o(t)}:r(8987),a=Object.keys;s.shim=function(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)}):Object.keys=s,Object.keys||s},t.exports=s},1414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},2818:(t,e,r)=>{"use strict";var n=r(9809);e.certificate=r(1934);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));e.PublicKey=s;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=u;var f=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=f;var h=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=h,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var c=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(l),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=c;var l=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},1934:(t,e,r)=>{"use strict";var n=r(9809),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),f=n.define("RDNSequence",(function(){this.seqof(u)})),h=n.define("Name",(function(){this.choice({rdnSequence:this.use(f)})})),c=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),l=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(h),this.key("validity").use(c),this.key("subject").use(h),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));t.exports=p},7631:(t,e,r)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r(3048),a=r(4696),u=r(9509).Buffer;t.exports=function(t,e){var r,f=t.toString(),h=f.match(n);if(h){var c="aes"+h[1],l=u.from(h[2],"hex"),d=u.from(h[3].replace(/[\r\n]/g,""),"base64"),p=s(e,l.slice(0,8),parseInt(h[1],10)).key,m=[],g=a.createDecipheriv(c,p,l);m.push(g.update(d)),m.push(g.final()),r=u.concat(m)}else{var y=f.match(o);r=u.from(y[2].replace(/[\r\n]/g,""),"base64")}return{tag:f.match(i)[1],data:r}}},980:(t,e,r)=>{var n=r(2818),i=r(2562),o=r(7631),s=r(4696),a=r(5632),u=r(9509).Buffer;function f(t){var e;"object"!=typeof t||u.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=u.from(t));var r,f,h=o(t,e),c=h.tag,l=h.data;switch(c){case"CERTIFICATE":f=n.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=n.PublicKey.decode(l,"der")),r=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=n.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":l=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[t.algorithm.decrypt.cipher.algo.join(".")],f=t.algorithm.decrypt.cipher.iv,h=t.subjectPrivateKey,c=parseInt(o.split("-")[1],10)/8,l=a.pbkdf2Sync(e,r,n,c,"sha1"),d=s.createDecipheriv(o,l,f),p=[];return p.push(d.update(h)),p.push(d.final()),u.concat(p)}(l=n.EncryptedPrivateKey.decode(l,"der"),e);case"PRIVATE KEY":switch(r=(f=n.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:n.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=n.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=n.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+c)}}t.exports=f,f.signature=n.signature},5632:(t,e,r)=>{e.pbkdf2=r(8638),e.pbkdf2Sync=r(1257)},8638:(t,e,r)=>{var n,i,o=r(9509).Buffer,s=r(7357),a=r(2368),u=r(1257),f=r(7777),h=r.g.crypto&&r.g.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function d(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(t,e,r,n,i){return h.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return h.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,e,i,m,g,y){"function"==typeof g&&(y=g,g=void 0);var b=c[(g=g||"sha1").toLowerCase()];if(b&&"function"==typeof r.g.Promise){if(s(i,m),t=f(t,a,"Password"),e=f(e,a,"Salt"),"function"!=typeof y)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){d()((function(){e(null,t)}))}),(function(t){d()((function(){e(t)}))}))}(function(t){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!h||!h.importKey||!h.deriveBits)return Promise.resolve(!1);if(void 0!==l[t])return l[t];var e=p(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return l[t]=e,e}(b).then((function(r){return r?p(t,e,i,m,b):u(t,e,i,m,g)})),y)}else d()((function(){var r;try{r=u(t,e,i,m,g)}catch(t){return y(t)}y(null,r)}))}},2368:(t,e,r)=>{var n,i=r(4155);n=r.g.process&&r.g.process.browser?"utf-8":r.g.process&&r.g.process.version?parseInt(i.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",t.exports=n},7357:t=>{var e=Math.pow(2,30)-1;t.exports=function(t,r){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!=r)throw new TypeError("Bad key length")}},1257:(t,e,r)=>{var n=r(8028),i=r(9785),o=r(9072),s=r(9509).Buffer,a=r(7357),u=r(2368),f=r(7777),h=s.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(t,e,r){var a=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new i).update(t).digest()}:"md5"===t?n:function(e){return o(t).update(e).digest()}}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=a(e):e.length<u&&(e=s.concat([e,h],u));for(var f=s.allocUnsafe(u+c[t]),l=s.allocUnsafe(u+c[t]),d=0;d<u;d++)f[d]=54^e[d],l[d]=92^e[d];var p=s.allocUnsafe(u+r+4);f.copy(p,0,0,u),this.ipad1=p,this.ipad2=f,this.opad=l,this.alg=t,this.blocksize=u,this.hash=a,this.size=c[t]}l.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(t,e,r,n,i){a(r,n);var o=new l(i=i||"sha1",t=f(t,u,"Password"),(e=f(e,u,"Salt")).length),h=s.allocUnsafe(n),d=s.allocUnsafe(e.length+4);e.copy(d,0,0,e.length);for(var p=0,m=c[i],g=Math.ceil(n/m),y=1;y<=g;y++){d.writeUInt32BE(y,e.length);for(var b=o.run(d,o.ipad1),v=b,w=1;w<r;w++){v=o.run(v,o.ipad2);for(var M=0;M<m;M++)b[M]^=v[M]}b.copy(h,p),p+=m}return h}},7777:(t,e,r)=>{var n=r(9509).Buffer;t.exports=function(t,e,r){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,e);if(ArrayBuffer.isView(t))return n.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},4155:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,u=[],f=!1,h=-1;function c(){f&&a&&(f=!1,a.length?u=a.concat(u):h=-1,u.length&&l())}function l(){if(!f){var t=s(c);f=!0;for(var e=u.length;e;){for(a=u,u=[];++h<e;)a&&a[h].run();h=-1,e=u.length}a=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}n.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];u.push(new d(t,e)),1!==u.length||f||s(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},7900:(t,e,r)=>{e.publicEncrypt=r(6559),e.privateDecrypt=r(6138),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},9199:(t,e,r)=>{var n=r(3482),i=r(9509).Buffer;function o(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var r,s=i.alloc(0),a=0;s.length<e;)r=o(a++),s=i.concat([s,n("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},6138:(t,e,r)=>{var n=r(980),i=r(9199),o=r(7859),s=r(3550),a=r(3663),u=r(3482),f=r(4818),h=r(9509).Buffer;t.exports=function(t,e,r){var c;c=t.padding?t.padding:r?1:4;var l,d=n(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");l=r?f(new s(e),d):a(e,d);var m=h.alloc(p-l.length);if(l=h.concat([m,l],p),4===c)return function(t,e){var r=t.modulus.byteLength(),n=u("sha1").update(h.alloc(0)).digest(),s=n.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),f=e.slice(s+1),c=o(a,i(f,s)),l=o(f,i(c,r-s-1));if(function(t,e){t=h.from(t),e=h.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));for(var i=-1;++i<n;)r+=t[i]^e[i];return r}(n,l.slice(0,s)))throw new Error("decryption error");for(var d=s;0===l[d];)d++;if(1!==l[d++])throw new Error("decryption error");return l.slice(d)}(d,l);if(1===c)return function(t,e,r){for(var n=e.slice(0,2),i=2,o=0;0!==e[i++];)if(i>=e.length){o++;break}var s=e.slice(2,i-1);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++,s.length<8&&o++,o)throw new Error("decryption error");return e.slice(i)}(0,l,r);if(3===c)return l;throw new Error("unknown padding")}},6559:(t,e,r)=>{var n=r(980),i=r(1798),o=r(3482),s=r(9199),a=r(7859),u=r(3550),f=r(4818),h=r(3663),c=r(9509).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var d,p=n(t);if(4===l)d=function(t,e){var r=t.modulus.byteLength(),n=e.length,f=o("sha1").update(c.alloc(0)).digest(),h=f.length,l=2*h;if(n>r-l-2)throw new Error("message too long");var d=c.alloc(r-n-l-2),p=r-h-1,m=i(h),g=a(c.concat([f,d,c.alloc(1,1),e],p),s(m,p)),y=a(m,s(g,h));return new u(c.concat([c.alloc(1),y,g],r))}(p,e);else if(1===l)d=function(t,e,r){var n,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");return n=r?c.alloc(s-o-3,255):function(t){for(var e,r=c.allocUnsafe(t),n=0,o=i(2*t),s=0;n<t;)s===o.length&&(o=i(2*t),s=0),(e=o[s++])&&(r[n++]=e);return r}(s-o-3),new u(c.concat([c.from([0,r?1:2]),n,c.alloc(1),e],s))}(p,e,r);else{if(3!==l)throw new Error("unknown padding");if((d=new u(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?h(d,p):f(d,p)}},4818:(t,e,r)=>{var n=r(3550),i=r(9509).Buffer;t.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},7859:t=>{t.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},1798:(t,e,r)=>{"use strict";var n=r(4155),i=65536,o=r(9509).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(t);if(t>0)if(t>i)for(var a=0;a<t;a+=i)s.getRandomValues(r.slice(a,a+i));else s.getRandomValues(r);return"function"==typeof e?n.nextTick((function(){e(null,r)})):r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},7963:(t,e,r)=>{"use strict";var n=r(4155);function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(9509),s=r(1798),a=o.Buffer,u=o.kMaxLength,f=r.g.crypto||r.g.msCrypto,h=Math.pow(2,32)-1;function c(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>h||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function l(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>h||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function d(t,e,r,i){if(n.browser){var o=t.buffer,a=new Uint8Array(o,e,r);return f.getRandomValues(a),i?void n.nextTick((function(){i(null,t)})):t}if(!i)return s(r).copy(t,e),t;s(r,(function(r,n){if(r)return i(r);n.copy(t,e),i(null,t)}))}f&&f.getRandomValues||!n.browser?(e.randomFill=function(t,e,n,i){if(!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return c(e,t.length),l(n,e,t.length),d(t,e,n,i)},e.randomFillSync=function(t,e,n){if(void 0===e&&(e=0),!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return c(e,t.length),void 0===n&&(n=t.length-e),l(n,e,t.length),d(t,e,n)}):(e.randomFill=i,e.randomFillSync=i)},4281:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var f=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(f," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{"use strict";var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var o=r(9481),s=r(4229);r(5717)(h,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var f=a[u];h.prototype[f]||(h.prototype[f]=s.prototype[f])}function h(t){if(!(this instanceof h))return new h(t);o.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||n.nextTick(l,this)}function l(t){t.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},2725:(t,e,r)=>{"use strict";t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{"use strict";var n,i=r(4155);t.exports=A,A.ReadableState=S,r(7187).EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,f=r.g.Uint8Array||function(){},h=r(4616);o=h&&h.debuglog?h.debuglog("stream"):function(){};var c,l,d,p=r(7327),m=r(1195),g=r(2457).getHighWaterMark,y=r(4281).q,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,M=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(2553).s),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function x(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?I(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,O(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new M):k(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?k(t,a,e,!1):T(t,a)):k(t,a,e,!1)}else n||(a.reading=!1,T(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function k(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&I(t)),T(t,e)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=m.destroy,A.prototype._undestroy=m.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=u.from(t,e),e=""),r=!0),x(this,t,e,!1,r)},A.prototype.unshift=function(t){return x(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){c||(c=r(2553).s);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var B=1073741824;function P(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=B?t=B:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function I(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(O,t))}function O(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,j(t)}function T(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(R,t,e))}function R(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(o("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function N(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){o("readable nexttick read 0"),t.read(0)}function C(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(z,e,t))}function z(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function F(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}A.prototype.read=function(t){o("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):I(this),null;if(0===(t=P(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&o("length less than watermark",i=!0),e.ended||e.reading?o("reading or ended",i=!1):i&&(o("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=P(r,e))),null===(n=t>0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?m:u;function u(){o("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",(function e(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",f),t.removeListener("error",l),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",c),h=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,j(t))}}(r);t.on("drain",f);var h=!1;function c(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==F(n.pipes,t))&&!h&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function l(e){o("onerror",e),m(),t.removeListener("error",l),0===s(t,"error")&&_(t,e)}function d(){t.removeListener("finish",p),m()}function p(){o("onfinish"),t.removeListener("close",d),m()}function m(){o("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",l),t.once("close",d),t.once("finish",p),t.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},A.prototype.on=function(t,e){var r=a.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?I(this):n.reading||i.nextTick(L,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(N,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(N,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(C,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s<E.length;s++)t.on(E[s],this.emit.bind(this,E[s]));return this._read=function(e){o("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=r(5850)),l(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=D,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,e){return void 0===d&&(d=r(5167)),d(A,t,e)})},4605:(t,e,r)=>{"use strict";t.exports=h;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function f(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function h(t){if(!(this instanceof h))return new h(t);u.call(this,t),this._transformState={afterTransform:f.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(5717)(h,u),h.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},h.prototype._transform=function(t,e,r){r(new i("_transform()"))},h.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},h.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},h.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},4229:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=S;var s,a={deprecate:r(4927)},u=r(2503),f=r(8764).Buffer,h=r.g.Uint8Array||function(){},c=r(1195),l=r(2457).getHighWaterMark,d=r(4281).q,p=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,M=d.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;function E(){}function S(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(O,t,e),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),O(t,e))}(t,r,n,e,o);else{var s=P(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||B(t,r),n?i.nextTick(k,t,r,s,o):k(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function x(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function k(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),O(t,e)}function B(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,x(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,h=r.encoding,c=r.callback;if(x(t,e,!1,e.objectMode?1:f.length,f,h,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function P(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function I(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),O(t,e)}))}function O(t,e){var r=P(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(I,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof S}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new y)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,f.isBuffer(n)||n instanceof h);return a&&!f.isBuffer(t)&&(t=function(t){return f.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(t,e){var r=new w;_(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(_(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=f.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else x(t,e,!1,a,n,i,o);return u}(this,o,a,t,e,r)),s},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||B(this,t))},A.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new M(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new m("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,O(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),f=Symbol("error"),h=Symbol("ended"),c=Symbol("lastPromise"),l=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function m(t){var e=t[a];if(null!==e){var r=t[d].read();null!==r&&(t[c]=null,t[a]=null,t[u]=null,e(p(r,!1)))}}function g(t){i.nextTick(m,t)}var y=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var t=this,e=this[f];if(null!==e)return Promise.reject(e);if(this[h])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[f]?r(t[f]):e(p(void 0,!0))}))}));var r,n=this[c];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[h]?r(p(void 0,!0)):e[l](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[l])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[d].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),y);t.exports=function(t){var e,r=Object.create(b,(o(e={},d,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,f,{value:null,writable:!0}),o(e,h,{value:t._readableState.endEmitted,writable:!0}),o(e,l,{value:function(t,e){var n=r[d].read();n?(r[c]=null,r[a]=null,r[u]=null,t(p(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[c]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[c]=null,r[a]=null,r[u]=null,e(t)),void(r[f]=t)}var n=r[a];null!==n&&(r[c]=null,r[a]=null,r[u]=null,n(p(void 0,!0))),r[h]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{"use strict";function n(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 i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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,n.key,n)}}var s=r(8764).Buffer,a=r(2361).inspect,u=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),t}()},1195:(t,e,r)=>{"use strict";var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||h()},f=e._writableState&&e._writableState.finished,h=function(){a=!1,f=!0,s||o.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){s=!1,c=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!c?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!f?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},m=function(){e.req.on("finish",h)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",h),e.on("abort",p),e.req?m():e.on("request",m)):a&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",l),e.on("finish",h),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",h),e.removeListener("abort",p),e.removeListener("request",m),e.req&&e.req.removeListener("finish",h),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",h),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},5167:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function f(t){t()}function h(t,e){return t.pipe(e)}function c(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=c(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return u(t,o,r>0,(function(t){n||(n=t),t&&s.forEach(f),o||(s.forEach(f),i(n))}))}));return e.reduce(h)}},2457:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9785:(t,e,r)=>{"use strict";var n=r(8764).Buffer,i=r(5717),o=r(3349),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[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],f=[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],h=[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],c=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function m(t,e,r,n,i,o,s,a){return p(t+(e^r^n)+o+s|0,a)+i|0}function g(t,e,r,n,i,o,s,a){return p(t+(e&r|~e&n)+o+s|0,a)+i|0}function y(t,e,r,n,i,o,s,a){return p(t+((e|~r)^n)+o+s|0,a)+i|0}function b(t,e,r,n,i,o,s,a){return p(t+(e&n|r&~n)+o+s|0,a)+i|0}function v(t,e,r,n,i,o,s,a){return p(t+(e^(r|~n))+o+s|0,a)+i|0}i(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,M=0|this._b,_=0|this._c,E=0|this._d,S=0|this._e,A=0;A<80;A+=1){var x,k;A<16?(x=m(r,n,i,o,d,t[a[A]],c[0],f[A]),k=v(w,M,_,E,S,t[u[A]],l[0],h[A])):A<32?(x=g(r,n,i,o,d,t[a[A]],c[1],f[A]),k=b(w,M,_,E,S,t[u[A]],l[1],h[A])):A<48?(x=y(r,n,i,o,d,t[a[A]],c[2],f[A]),k=y(w,M,_,E,S,t[u[A]],l[2],h[A])):A<64?(x=b(r,n,i,o,d,t[a[A]],c[3],f[A]),k=g(w,M,_,E,S,t[u[A]],l[3],h[A])):(x=v(r,n,i,o,d,t[a[A]],c[4],f[A]),k=m(w,M,_,E,S,t[u[A]],l[4],h[A])),r=d,d=o,o=p(i,10),i=n,n=x,w=S,S=E,E=p(_,10),_=M,M=k}var B=this._b+i+E|0;this._b=this._c+o+S|0,this._c=this._d+d+w|0,this._d=this._e+r+M|0,this._e=this._a+n+_|0,this._a=B},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},6636:(t,e,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.getLength=e.decode=e.encode=void 0;var i=r(3550);function o(t,e){if("00"===t.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(t,e)}function s(t,e){if(t<56)return n.from([t+e]);var r=f(t),i=f(e+55+r.length/2);return n.from(i+r,"hex")}function a(t){var e,r,i,s,u,f=[],h=t[0];if(h<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(h<=183){if(e=h-127,i=128===h?n.from([]):t.slice(1,e),2===e&&i[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:i,remainder:t.slice(e)}}if(h<=191){if(r=h-182,t.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if((e=o(t.slice(1,r).toString("hex"),16))<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if((i=t.slice(r,e+r)).length<e)throw new Error("invalid RLP: not enough bytes for string");return{data:i,remainder:t.slice(e+r)}}if(h<=247){for(e=h-191,s=t.slice(1,e);s.length;)u=a(s),f.push(u.data),s=u.remainder;return{data:f,remainder:t.slice(e)}}var c=(r=h-246)+(e=o(t.slice(1,r).toString("hex"),16));if(c>t.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=t.slice(r,c)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)u=a(s),f.push(u.data),s=u.remainder;return{data:f,remainder:t.slice(c)}}function u(t){return"0x"===t.slice(0,2)}function f(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");var e=t.toString(16);return e.length%2?"0"+e:e}function h(t){if(!n.isBuffer(t)){if("string"==typeof t)return u(t)?n.from((r="string"!=typeof(o=t)?o:u(o)?o.slice(2):o).length%2?"0"+r:r,"hex"):n.from(t);if("number"==typeof t||"bigint"==typeof t)return t?(e=f(t),n.from(e,"hex")):n.from([]);if(null==t)return n.from([]);if(t instanceof Uint8Array)return n.from(t);if(i.isBN(t))return n.from(t.toArray());throw new Error("invalid type")}var e,r,o;return t}e.encode=function t(e){if(Array.isArray(e)){for(var r=[],i=0;i<e.length;i++)r.push(t(e[i]));var o=n.concat(r);return n.concat([s(o.length,192),o])}var a=h(e);return 1===a.length&&a[0]<128?a:n.concat([s(a.length,128),a])},e.decode=function(t,e){if(void 0===e&&(e=!1),!t||0===t.length)return n.from([]);var r=a(h(t));if(e)return r;if(0!==r.remainder.length)throw new Error("invalid remainder");return r.data},e.getLength=function(t){if(!t||0===t.length)return n.from([]);var e=h(t),r=e[0];if(r<=127)return e.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;var i=r-246;return i+o(e.slice(1,i).toString("hex"),16)}},9509:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},2399:(t,e,r)=>{"use strict";var n,i=r(4155),o=r(8764),s=o.Buffer,a={};for(n in o)o.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=o[n]);var u=a.Buffer={};for(n in s)s.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(u[n]=s[n]);if(a.Buffer.prototype=s.prototype,u.from&&u.from!==Uint8Array.from||(u.from=function(t,e,r){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return s(t,e,r)}),u.alloc||(u.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=s(t);return e&&0!==e.length?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=i.binding("buffer").kStringMaxLength}catch(t){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a},7221:(t,e,r)=>{t.exports=r(9119)(r(8573))},8573:(t,e,r)=>{const n=new(0,r(6266).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function s(t){const e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){let r=new o(e);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let s=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){let s=new o(e),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),a=a.toRed(i.red),(6===t||7===t)&&a.isOdd()!==(7===t))return null;const u=s.redSqr().redIMul(s);return a.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function a(t,e){const r=e.encode(null,33===t.length);for(let e=0;e<t.length;++e)t[e]=r[e]}t.exports={contextRandomize:()=>0,privateKeyVerify(t){const e=new o(t);return e.cmp(i.n)<0&&!e.isZero()?0:1},privateKeyNegate(t){const e=new o(t),r=i.n.sub(e).umod(i.n).toArrayLike(Uint8Array,"be",32);return t.set(r),0},privateKeyTweakAdd(t,e){const r=new o(e);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(t)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(t)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify:t=>null===s(t)?1:0,publicKeyCreate(t,e){const r=new o(e);return r.cmp(i.n)>=0||r.isZero()?1:(a(t,n.keyFromPrivate(e).getPublic()),0)},publicKeyConvert(t,e){const r=s(e);return null===r?1:(a(t,r.getPublic()),0)},publicKeyNegate(t,e){const r=s(e);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),a(t,n),0},publicKeyCombine(t,e){const r=new Array(e.length);for(let t=0;t<e.length;++t)if(r[t]=s(e[t]),null===r[t])return 1;let n=r[0].getPublic();for(let t=1;t<r.length;++t)n=n.add(r[t].pub);return n.isInfinity()?2:(a(t,n),0)},publicKeyTweakAdd(t,e,r){const n=s(e);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(a(t,u),0)},publicKeyTweakMul(t,e,r){const n=s(e);return null===n?1:(r=new o(r)).cmp(i.n)>=0||r.isZero()?2:(a(t,n.getPublic().mul(r)),0)},signatureNormalize(t){const e=new o(t.subarray(0,32)),r=new o(t.subarray(32,64));return e.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&t.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){const r=e.subarray(0,32),n=e.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:s}=t;let a=s.subarray(4,37);a[0]=0,a.set(r,1);let u=33,f=0;for(;u>1&&0===a[f]&&!(128&a[f+1]);--u,++f);if(a=a.subarray(f),128&a[0])return 1;if(u>1&&0===a[0]&&!(128&a[1]))return 1;let h=s.subarray(39,72);h[0]=0,h.set(n,1);let c=33,l=0;for(;c>1&&0===h[l]&&!(128&h[l+1]);--c,++l);return h=h.subarray(l),128&h[0]||c>1&&0===h[0]&&!(128&h[1])?1:(t.outputlen=6+u+c,s[0]=48,s[1]=t.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+u]=2,s[5+u]=h.length,s.set(h,6+u),0)},signatureImport(t,e){if(e.length<8)return 1;if(e.length>72)return 1;if(48!==e[0])return 1;if(e[1]!==e.length-2)return 1;if(2!==e[2])return 1;const r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;const n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;let s=e.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=e.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let u=new o(s);u.cmp(i.n)>=0&&(u=new o(0));let f=new o(e.subarray(6+r));return f.cmp(i.n)>=0&&(f=new o(0)),t.set(u.toArrayLike(Uint8Array,"be",32),0),t.set(f.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,s,a){if(a){const t=a;a=n=>{const i=t(e,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let f;try{f=n.sign(e,r,{canonical:!0,k:a,pers:s})}catch(t){return 1}return t.signature.set(f.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(f.s.toArrayLike(Uint8Array,"be",32),32),t.recid=f.recoveryParam,0},ecdsaVerify(t,e,r){const a={r:t.subarray(0,32),s:t.subarray(32,64)},u=new o(a.r),f=new o(a.s);if(u.cmp(i.n)>=0||f.cmp(i.n)>=0)return 1;if(1===f.cmp(n.nh)||u.isZero()||f.isZero())return 3;const h=s(r);if(null===h)return 2;const c=h.getPublic();return n.verify(e,a,c)?0:3},ecdsaRecover(t,e,r,s){const u={r:e.slice(0,32),s:e.slice(32,64)},f=new o(u.r),h=new o(u.s);if(f.cmp(i.n)>=0||h.cmp(i.n)>=0)return 1;if(f.isZero()||h.isZero())return 2;let c;try{c=n.recoverPubKey(s,u,r)}catch(t){return 2}return a(t,c),0},ecdh(t,e,r,a,u,f,h){const c=s(e);if(null===c)return 1;const l=new o(r);if(l.cmp(i.n)>=0||l.isZero())return 2;const d=c.getPublic().mul(l);if(void 0===u){const e=d.encode(null,!0),r=n.hash().update(e).digest();for(let e=0;e<32;++e)t[e]=r[e]}else{f||(f=new Uint8Array(32));const e=d.getX().toArray("be",32);for(let t=0;t<32;++t)f[t]=e[t];h||(h=new Uint8Array(32));const r=d.getY().toArray("be",32);for(let t=0;t<32;++t)h[t]=r[t];const n=u(f,h,a);if(!(n instanceof Uint8Array&&n.length===t.length))return 2;t.set(n)}return 0}}},9119:t=>{const e="Impossible case. Please create issue.",r="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",i="Public Key could not be parsed",o="Public Key serialization error",s="Signature could not be parsed";function a(t,e){if(!t)throw new Error(e)}function u(t,e,r){if(a(e instanceof Uint8Array,`Expected ${t} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${t} to be an Uint8Array with length [${r.join(", ")}]`;a(r.includes(e.length),n)}else{const n=`Expected ${t} to be an Uint8Array with length ${r}`;a(e.length===r,n)}}function f(t){a("Boolean"===c(t),"Expected compressed to be a Boolean")}function h(t=(t=>new Uint8Array(t)),e){return"function"==typeof t&&(t=t(e)),u("output",t,e),t}function c(t){return Object.prototype.toString.call(t).slice(8,-1)}t.exports=t=>({contextRandomize(e){switch(a(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&u("seed",e,32),t.contextRandomize(e)){case 1:throw new Error("Unknow error on context randomization")}},privateKeyVerify:e=>(u("private key",e,32),0===t.privateKeyVerify(e)),privateKeyNegate(r){switch(u("private key",r,32),t.privateKeyNegate(r)){case 0:return r;case 1:throw new Error(e)}},privateKeyTweakAdd(e,n){switch(u("private key",e,32),u("tweak",n,32),t.privateKeyTweakAdd(e,n)){case 0:return e;case 1:throw new Error(r)}},privateKeyTweakMul(e,r){switch(u("private key",e,32),u("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(n)}},publicKeyVerify:e=>(u("public key",e,[33,65]),0===t.publicKeyVerify(e)),publicKeyCreate(e,r=!0,n){switch(u("private key",e,32),f(r),n=h(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error("Private Key is invalid");case 2:throw new Error(o)}},publicKeyConvert(e,r=!0,n){switch(u("public key",e,[33,65]),f(r),n=h(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(o)}},publicKeyNegate(r,n=!0,s){switch(u("public key",r,[33,65]),f(n),s=h(s,n?33:65),t.publicKeyNegate(s,r)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(e);case 3:throw new Error(o)}},publicKeyCombine(e,r=!0,n){a(Array.isArray(e),"Expected public keys to be an Array"),a(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)u("public key",t,[33,65]);switch(f(r),n=h(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error("The sum of the public keys is not valid");case 3:throw new Error(o)}},publicKeyTweakAdd(e,n,o=!0,s){switch(u("public key",e,[33,65]),u("tweak",n,32),f(o),s=h(s,o?33:65),t.publicKeyTweakAdd(s,e,n)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(r)}},publicKeyTweakMul(e,r,o=!0,s){switch(u("public key",e,[33,65]),u("tweak",r,32),f(o),s=h(s,o?33:65),t.publicKeyTweakMul(s,e,r)){case 0:return s;case 1:throw new Error(i);case 2:throw new Error(n)}},signatureNormalize(e){switch(u("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(s)}},signatureExport(r,n){u("signature",r,64);const i={output:n=h(n,72),outputlen:72};switch(t.signatureExport(i,r)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(s);case 2:throw new Error(e)}},signatureImport(r,n){switch(u("signature",r),n=h(n,64),t.signatureImport(n,r)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(e)}},ecdsaSign(r,n,i={},o){u("message",r,32),u("private key",n,32),a("Object"===c(i),"Expected options to be an Object"),void 0!==i.data&&u("options.data",i.data),void 0!==i.noncefn&&a("Function"===c(i.noncefn),"Expected options.noncefn to be a Function");const s={signature:o=h(o,64),recid:null};switch(t.ecdsaSign(s,r,n,i.data,i.noncefn)){case 0:return s;case 1:throw new Error("The nonce generation function failed, or the private key was invalid");case 2:throw new Error(e)}},ecdsaVerify(e,r,n){switch(u("signature",e,64),u("message",r,32),u("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(s);case 2:throw new Error(i)}},ecdsaRecover(r,n,i,o=!0,l){switch(u("signature",r,64),a("Number"===c(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),u("message",i,32),f(o),l=h(l,o?33:65),t.ecdsaRecover(l,r,n,i)){case 0:return l;case 1:throw new Error(s);case 2:throw new Error("Public key could not be recover");case 3:throw new Error(e)}},ecdh(e,r,n={},o){switch(u("public key",e,[33,65]),u("private key",r,32),a("Object"===c(n),"Expected options to be an Object"),void 0!==n.data&&u("options.data",n.data),void 0!==n.hashfn?(a("Function"===c(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&u("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&u("options.ybuf",n.ybuf,32),u("output",o)):o=h(o,32),t.ecdh(o,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return o;case 1:throw new Error(i);case 2:throw new Error("Scalar was invalid (zero or overflow)")}}})},4189:(t,e,r)=>{var n=r(9509).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,s=this._len,a=0;a<o;){for(var u=s%i,f=Math.min(o-a,i-u),h=0;h<f;h++)r[u+h]=t[a+h];a+=f,(s+=f)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},9072:(t,e,r)=>{var n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=r(4448),n.sha1=r(8336),n.sha224=r(8432),n.sha256=r(7499),n.sha384=r(1686),n.sha512=r(7816)},4448:(t,e,r)=>{var n=r(5717),i=r(4189),o=r(9509).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function f(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=n)<<5|e>>>27)+h(d,i,o,a)+u+r[l]+s[d];u=a,a=o,o=f(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},8336:(t,e,r)=>{var n=r(5717),i=r(4189),o=r(9509).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function f(t){return t<<5|t>>>27}function h(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=f(n)+c(p,i,o,a)+u+r[d]+s[p]|0;u=a,a=o,o=h(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},8432:(t,e,r)=>{var n=r(5717),i=r(7499),o=r(4189),s=r(9509).Buffer,a=new Array(64);function u(){this.init(),this._w=a,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},7499:(t,e,r)=>{var n=r(5717),i=r(4189),o=r(9509).Buffer,s=[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],a=new Array(64);function u(){this.init(),this._w=a,i.call(this,64,56)}function f(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function c(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,y=0;y<16;++y)r[y]=t.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((e=r[y-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[y-7]+d(r[y-15])+r[y-16];for(var b=0;b<64;++b){var v=g+l(u)+f(u,p,m)+s[b]+r[b]|0,w=c(n)+h(n,i,o)|0;g=m,m=p,p=u,u=a+v|0,a=o,o=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},1686:(t,e,r)=>{var n=r(5717),i=r(7816),o=r(4189),s=r(9509).Buffer,a=new Array(160);function u(){this.init(),this._w=a,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},7816:(t,e,r)=>{var n=r(5717),i=r(4189),o=r(9509).Buffer,s=[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],a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}function f(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function c(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function y(t,e){return t>>>0<e>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,b=0|this._gh,v=0|this._hh,w=0|this._al,M=0|this._bl,_=0|this._cl,E=0|this._dl,S=0|this._el,A=0|this._fl,x=0|this._gl,k=0|this._hl,B=0;B<32;B+=2)e[B]=t.readInt32BE(4*B),e[B+1]=t.readInt32BE(4*B+4);for(;B<160;B+=2){var P=e[B-30],I=e[B-30+1],O=d(P,I),T=p(I,P),R=m(P=e[B-4],I=e[B-4+1]),N=g(I,P),L=e[B-14],C=e[B-14+1],j=e[B-32],D=e[B-32+1],U=T+C|0,z=O+L+y(U,T)|0;z=(z=z+R+y(U=U+N|0,N)|0)+j+y(U=U+D|0,D)|0,e[B]=z,e[B+1]=U}for(var F=0;F<160;F+=2){z=e[F],U=e[F+1];var H=h(r,n,i),q=h(w,M,_),K=c(r,w),G=c(w,r),V=l(a,S),Z=l(S,a),W=s[F],J=s[F+1],$=f(a,u,b),X=f(S,A,x),Y=k+Z|0,Q=v+V+y(Y,k)|0;Q=(Q=(Q=Q+$+y(Y=Y+X|0,X)|0)+W+y(Y=Y+J|0,J)|0)+z+y(Y=Y+U|0,U)|0;var tt=G+q|0,et=K+H+y(tt,G)|0;v=b,k=x,b=u,x=A,u=a,A=S,a=o+Q+y(S=E+Y|0,E)|0,o=i,E=_,i=n,_=M,n=r,M=w,r=Q+et+y(w=Y+tt|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+_|0,this._dl=this._dl+E|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+x|0,this._hl=this._hl+k|0,this._ah=this._ah+r+y(this._al,w)|0,this._bh=this._bh+n+y(this._bl,M)|0,this._ch=this._ch+i+y(this._cl,_)|0,this._dh=this._dh+o+y(this._dl,E)|0,this._eh=this._eh+a+y(this._el,S)|0,this._fh=this._fh+u+y(this._fl,A)|0,this._gh=this._gh+b+y(this._gl,x)|0,this._hh=this._hh+v+y(this._hl,k)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},2830:(t,e,r)=>{t.exports=i;var n=r(7187).EventEmitter;function i(){n.call(this)}r(5717)(i,n),i.Readable=r(9481),i.Writable=r(4229),i.Duplex=r(6753),i.Transform=r(4605),i.PassThrough=r(2725),i.finished=r(8610),i.pipeline=r(9946),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(h(),0===n.listenerCount(this,"error"))throw t}function h(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("error",f),t.on("error",f),r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t}},2553:(t,e,r)=>{"use strict";var n=r(9509).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=h,this.end=c,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},9604:(t,e,r)=>{var n=r(3944);t.exports=function(t){return"string"!=typeof t?t:n(t)?t.slice(2):t}},4927:(t,e,r)=>{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,f="undefined"!=typeof Symbol,h=a(Object.prototype.toString),c=a(Number.prototype.valueOf),l=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(u)var p=a(BigInt.prototype.valueOf);if(f)var m=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function y(t){return"[object Map]"===h(t)}function b(t){return"[object Set]"===h(t)}function v(t){return"[object WeakMap]"===h(t)}function w(t){return"[object WeakSet]"===h(t)}function M(t){return"[object ArrayBuffer]"===h(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(M.working?M(t):t instanceof ArrayBuffer)}function E(t){return"[object DataView]"===h(t)}function S(t){return"undefined"!=typeof DataView&&(E.working?E(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||S(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},y.working="undefined"!=typeof Map&&y(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(y.working?y(t):t instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(b.working?b(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},M.working="undefined"!=typeof ArrayBuffer&&M(new ArrayBuffer),e.isArrayBuffer=_,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=S;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(t){return"[object SharedArrayBuffer]"===h(t)}function k(t){return void 0!==A&&(void 0===x.working&&(x.working=x(new A)),x.working?x(t):t instanceof A)}function B(t){return g(t,c)}function P(t){return g(t,l)}function I(t){return g(t,d)}function O(t){return u&&g(t,p)}function T(t){return f&&g(t,m)}e.isSharedArrayBuffer=k,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===h(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===h(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===h(t)},e.isGeneratorObject=function(t){return"[object Generator]"===h(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===h(t)},e.isNumberObject=B,e.isStringObject=P,e.isBooleanObject=I,e.isBigIntObject=O,e.isSymbolObject=T,e.isBoxedPrimitive=function(t){return B(t)||P(t)||I(t)||O(t)||T(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||k(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(f(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r<i;a=n[++r])y(a)||!_(a)?s+=" "+a:s+=" "+f(a);return s},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var s={},a=/^$/;if(n.env.NODE_DEBUG){var u=n.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+u+"$","i")}function f(t,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),l(n,t,n.depth)}function h(t,e){var r=f.styles[e];return r?"["+f.colors[r][0]+"m"+t+"["+f.colors[r][1]+"m":t}function c(t,e){return t}function l(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=l(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),S(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return d(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(M(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return d(r)}var f,h="",c=!1,_=["{","}"];return m(r)&&(c=!0,_=["[","]"]),A(r)&&(h=" [Function"+(r.name?": "+r.name:"")+"]"),M(r)&&(h=" "+RegExp.prototype.toString.call(r)),E(r)&&(h=" "+Date.prototype.toUTCString.call(r)),S(r)&&(h=" "+d(r)),0!==s.length||c&&0!=r.length?n<0?M(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),f=c?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)I(e,String(s))?o.push(p(t,e,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(t,e,r,n,i,!0))})),o}(t,r,n,a,s):s.map((function(e){return p(t,r,n,a,e,c)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(f,h,_)):_[0]+h+_[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),I(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=y(r)?l(t,u.value,null):l(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function m(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function y(t){return null===t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function M(t){return _(t)&&"[object RegExp]"===x(t)}function _(t){return"object"==typeof t&&null!==t}function E(t){return _(t)&&"[object Date]"===x(t)}function S(t){return _(t)&&("[object Error]"===x(t)||t instanceof Error)}function A(t){return"function"==typeof t}function x(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=m,e.isBoolean=g,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=M,e.types.isRegExp=M,e.isObject=_,e.isDate=E,e.types.isDate=E,e.isError=S,e.types.isNativeError=S,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),B[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(O&&t[O]){var e;if("function"!=typeof(e=t[O]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),O&&Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=O,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};t.apply(this,e).then((function(t){n.nextTick(s.bind(null,null,t))}),(function(t){n.nextTick(T.bind(null,t,s))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,i(t)),e}},6430:(t,e,r)=>{"use strict";var n=r(9804),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u=i(),f=o("String.prototype.slice"),h={},c=r(882),l=Object.getPrototypeOf;a&&c&&l&&n(u,(function(t){if("function"==typeof r.g[t]){var e=new r.g[t];if(Symbol.toStringTag in e){var n=l(e),i=c(n,Symbol.toStringTag);if(!i){var o=l(n);i=c(o,Symbol.toStringTag)}h[t]=i.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(h,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):f(s(t),8,-1))}},2859:()=>{},5304:()=>{},6601:()=>{},9214:()=>{},1922:()=>{},2363:()=>{},8955:()=>{},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof r.g[n[e]]&&(t[t.length]=n[e]);return t}},882:(t,e,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%");if(n)try{n([],"length")}catch(t){n=null}t.exports=n},8531:t=>{"use strict";t.exports=JSON.parse('{"name":"calaveras","chainId":123,"networkId":123,"defaultHardfork":"berlin","consensus":{"type":"poa","algorithm":"clique","clique":{"period":30,"epoch":30000}},"comment":"The Calaveras testnet chain","url":"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/client-integration-testnets/calaveras.md","genesis":{"hash":"0xeb9233d066c275efcdfed8037f4fc082770176aefdbcb7691c71da412a5670f2","gasLimit":"0x47b760","difficulty":"0x1","nonce":"0x0000000000000000","extraData":"0x00000000000000000000000000000000000000000000000000000000000000005211cea3870c7ba7c6c44b185e62eecdb864cd8c560228ce57d31efbf64c200b2c200aacec78cf17a7148e784fe95a7a750335f8b9572ee28d72e7650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x664c93de37eb4a72953ea42b8c046cdb64c9f0b0bca5505ade8d970d49ebdb8c","timestamp":"0x60b3877f"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xe34c4aff"},{"name":"homestead","block":0,"forkHash":"0xe34c4aff"},{"name":"dao","block":null,"forkHash":"0xe34c4aff"},{"name":"tangerineWhistle","block":0,"forkHash":"0xe34c4aff"},{"name":"spuriousDragon","block":0,"forkHash":"0xe34c4aff"},{"name":"byzantium","block":0,"forkHash":"0xe34c4aff"},{"name":"constantinople","block":0,"forkHash":"0xe34c4aff"},{"name":"petersburg","block":0,"forkHash":"0xe34c4aff"},{"name":"istanbul","block":0,"forkHash":"0xe34c4aff"},{"name":"berlin","block":0,"forkHash":"0xe34c4aff"},{"name":"london","block":500,"forkHash":"0x173783e4"}],"bootstrapNodes":[{"ip":"3.21.156.138","port":30303,"id":"39eb08bbfad87481553c471a63ff2a4b4885fffa4ff50f1cf46744d9ad6e2f764ede146fe4df563fa9ccda1a46b9b1a88fb08135e1bf1d71b320912499da773d","location":"","comment":"Calaveras bootnode 1"},{"ip":"3.9.20.133","port":30303,"id":"9e1096aa59862a6f164994cb5cb16f5124d6c992cdbf4535ff7dea43ea1512afe5448dca9df1b7ab0726129603f1a3336b631e4d7a1a44c94daddd03241587f9","location":"","comment":"Calaveras bootnode 2"}]}')},7687:t=>{"use strict";t.exports=JSON.parse('{"name":"goerli","chainId":5,"networkId":5,"defaultHardfork":"istanbul","consensus":{"type":"poa","algorithm":"clique","clique":{"period":15,"epoch":30000}},"comment":"Cross-client PoA test network","url":"https://github.com/goerli/testnet","genesis":{"hash":"0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a","timestamp":"0x5c51a607","gasLimit":10485760,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x5d6cded585e73c4e322c30c2f782a336316f17dd85a4863b9d838d2d4b8b3008"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xa3f5ab08"},{"name":"homestead","block":0,"forkHash":"0xa3f5ab08"},{"name":"dao","block":null,"forkHash":"0xa3f5ab08"},{"name":"tangerineWhistle","block":0,"forkHash":"0xa3f5ab08"},{"name":"spuriousDragon","block":0,"forkHash":"0xa3f5ab08"},{"name":"byzantium","block":0,"forkHash":"0xa3f5ab08"},{"name":"constantinople","block":0,"forkHash":"0xa3f5ab08"},{"name":"petersburg","block":0,"forkHash":"0xa3f5ab08"},{"name":"istanbul","block":1561651,"forkHash":"0xc25efa5c"},{"name":"berlin","block":4460644,"forkHash":"0x757a1c47"},{"name":"london","block":5062605,"forkHash":"0xb8c6299d"}],"bootstrapNodes":[{"ip":"51.141.78.53","port":30303,"id":"011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a","location":"","comment":"Upstream bootnode 1"},{"ip":"13.93.54.137","port":30303,"id":"176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b","location":"","comment":"Upstream bootnode 2"},{"ip":"94.237.54.114","port":30313,"id":"46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291","location":"","comment":"Upstream bootnode 3"},{"ip":"18.218.250.66","port":30313,"id":"b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949","location":"","comment":"Upstream bootnode 4"},{"ip":"3.11.147.67","port":30303,"id":"a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91","location":"","comment":"Ethereum Foundation bootnode"},{"ip":"51.15.116.226","port":30303,"id":"a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd","location":"","comment":"Goerli Initiative bootnode"},{"ip":"51.15.119.157","port":30303,"id":"807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33","location":"","comment":"Goerli Initiative bootnode"},{"ip":"51.15.119.157","port":40303,"id":"a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd","location":"","comment":"Goerli Initiative bootnode"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]}')},7098:t=>{"use strict";t.exports=JSON.parse('{"name":"kovan","chainId":42,"networkId":42,"defaultHardfork":"istanbul","consensus":{"type":"poa","algorithm":"aura","aura":{}},"comment":"Parity PoA test network","url":"https://kovan-testnet.github.io/website/","genesis":{"hash":"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9","timestamp":null,"gasLimit":6000000,"difficulty":131072,"nonce":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","extraData":"0x","stateRoot":"0x2480155b48a1cea17d67dbfdfaafe821c1d19cdd478c5358e8ec56dec24502b2"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x010ffe56"},{"name":"homestead","block":0,"forkHash":"0x010ffe56"},{"name":"dao","block":null,"forkHash":"0x010ffe56"},{"name":"tangerineWhistle","block":0,"forkHash":"0x010ffe56"},{"name":"spuriousDragon","block":0,"forkHash":"0x010ffe56"},{"name":"byzantium","block":5067000,"forkHash":"0x7f83c620"},{"name":"constantinople","block":9200000,"forkHash":"0xa94e3dc4"},{"name":"petersburg","block":10255201,"forkHash":"0x186874aa"},{"name":"istanbul","block":14111141,"forkHash":"0x7f6599a6"},{"name":"berlin","block":null,"forkHash":null},{"name":"london","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"116.203.116.241","port":30303,"id":"16898006ba2cd4fa8bf9a3dfe32684c178fa861df144bfc21fe800dc4838a03e342056951fa9fd533dcb0be1219e306106442ff2cf1f7e9f8faa5f2fc1a3aa45","location":"","comment":"1"},{"ip":"3.217.96.11","port":30303,"id":"2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0","location":"","comment":"2"},{"ip":"108.61.170.124","port":30303,"id":"740e1c8ea64e71762c71a463a04e2046070a0c9394fcab5891d41301dc473c0cff00ebab5a9bc87fbcb610ab98ac18225ff897bc8b7b38def5975d5ceb0a7d7c","location":"","comment":"3"},{"ip":"157.230.31.163","port":30303,"id":"2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0","location":"","comment":"4"}]}')},7180:t=>{"use strict";t.exports=JSON.parse('{"name":"mainnet","chainId":1,"networkId":1,"defaultHardfork":"istanbul","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"The Ethereum main chain","url":"https://ethstats.net/","genesis":{"hash":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","timestamp":null,"gasLimit":5000,"difficulty":17179869184,"nonce":"0x0000000000000042","extraData":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","stateRoot":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xfc64ec04"},{"name":"homestead","block":1150000,"forkHash":"0x97c2c34c"},{"name":"dao","block":1920000,"forkHash":"0x91d1f948"},{"name":"tangerineWhistle","block":2463000,"forkHash":"0x7a64da13"},{"name":"spuriousDragon","block":2675000,"forkHash":"0x3edd5b10"},{"name":"byzantium","block":4370000,"forkHash":"0xa00bc324"},{"name":"constantinople","block":7280000,"forkHash":"0x668db0af"},{"name":"petersburg","block":7280000,"forkHash":"0x668db0af"},{"name":"istanbul","block":9069000,"forkHash":"0x879d6e30"},{"name":"muirGlacier","block":9200000,"forkHash":"0xe029e991"},{"name":"berlin","block":12244000,"forkHash":"0x0eb440f6"},{"name":"london","block":12965000,"forkHash":"0xb715077d"}],"bootstrapNodes":[{"ip":"18.138.108.67","port":30303,"id":"d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666","location":"ap-southeast-1-001","comment":"bootnode-aws-ap-southeast-1-001"},{"ip":"3.209.45.79","port":30303,"id":"22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de","location":"us-east-1-001","comment":"bootnode-aws-us-east-1-001"},{"ip":"34.255.23.113","port":30303,"id":"ca6de62fce278f96aea6ec5a2daadb877e51651247cb96ee310a318def462913b653963c155a0ef6c7d50048bba6e6cea881130857413d9f50a621546b590758","location":"eu-west-1-001","comment":"bootnode-aws-eu-west-1-001"},{"ip":"35.158.244.151","port":30303,"id":"279944d8dcd428dffaa7436f25ca0ca43ae19e7bcf94a8fb7d1641651f92d121e972ac2e8f381414b80cc8e5555811c2ec6e1a99bb009b3f53c4c69923e11bd8","location":"eu-central-1-001","comment":"bootnode-aws-eu-central-1-001"},{"ip":"52.187.207.27","port":30303,"id":"8499da03c47d637b20eee24eec3c356c9a2e6148d6fe25ca195c7949ab8ec2c03e3556126b0d7ed644675e78c4318b08691b7b57de10e5f0d40d05b09238fa0a","location":"australiaeast-001","comment":"bootnode-azure-australiaeast-001"},{"ip":"191.234.162.198","port":30303,"id":"103858bdb88756c71f15e9b5e09b56dc1be52f0a5021d46301dbbfb7e130029cc9d0d6f73f693bc29b665770fff7da4d34f3c6379fe12721b5d7a0bcb5ca1fc1","location":"brazilsouth-001","comment":"bootnode-azure-brazilsouth-001"},{"ip":"52.231.165.108","port":30303,"id":"715171f50508aba88aecd1250af392a45a330af91d7b90701c436b618c86aaa1589c9184561907bebbb56439b8f8787bc01f49a7c77276c58c1b09822d75e8e8","location":"koreasouth-001","comment":"bootnode-azure-koreasouth-001"},{"ip":"104.42.217.25","port":30303,"id":"5d6d7cd20d6da4bb83a1d28cadb5d409b64edf314c0335df658c1a54e32c7c4a7ab7823d57c39b6a757556e68ff1df17c748b698544a55cb488b52479a92b60f","location":"westus-001","comment":"bootnode-azure-westus-001"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]}')},439:t=>{"use strict";t.exports=JSON.parse('{"name":"rinkeby","chainId":4,"networkId":4,"defaultHardfork":"istanbul","consensus":{"type":"poa","algorithm":"clique","clique":{"period":15,"epoch":30000}},"comment":"PoA test network","url":"https://www.rinkeby.io","genesis":{"hash":"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177","timestamp":"0x58ee40ba","gasLimit":4700000,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x53580584816f617295ea26c0e17641e0120cab2f0a8ffb53a866fd53aa8e8c2d"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x3b8e0691"},{"name":"homestead","block":1,"forkHash":"0x60949295"},{"name":"dao","block":null,"forkHash":null},{"name":"tangerineWhistle","block":2,"forkHash":"0x8bde40dd"},{"name":"spuriousDragon","block":3,"forkHash":"0xcb3a64bb"},{"name":"byzantium","block":1035301,"forkHash":"0x8d748b57"},{"name":"constantinople","block":3660663,"forkHash":"0xe49cab14"},{"name":"petersburg","block":4321234,"forkHash":"0xafec6b27"},{"name":"istanbul","block":5435345,"forkHash":"0xcbdb8838"},{"name":"berlin","block":8290928,"forkHash":"0x6910c8bd"},{"name":"london","block":8897988,"forkHash":"0x8e29f2f3"}],"bootstrapNodes":[{"ip":"52.169.42.101","port":30303,"id":"a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf","location":"","comment":"IE"},{"ip":"52.3.158.184","port":30303,"id":"343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8","location":"","comment":"INFURA"},{"ip":"159.89.28.211","port":30303,"id":"b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6","location":"","comment":"AKASHA"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.rinkeby.ethdisco.net"]}')},1227:t=>{"use strict";t.exports=JSON.parse('{"name":"ropsten","chainId":3,"networkId":3,"defaultHardfork":"istanbul","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"PoW test network","url":"https://github.com/ethereum/ropsten","genesis":{"hash":"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d","timestamp":null,"gasLimit":16777216,"difficulty":1048576,"nonce":"0x0000000000000042","extraData":"0x3535353535353535353535353535353535353535353535353535353535353535","stateRoot":"0x217b0bbcfb72e2d57e28f33cb361b9983513177755dc3f33ce3e7022ed62b77b"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x30c7ddbc"},{"name":"homestead","block":0,"forkHash":"0x30c7ddbc"},{"name":"dao","block":null,"forkHash":null},{"name":"tangerineWhistle","block":0,"forkHash":"0x30c7ddbc"},{"name":"spuriousDragon","block":10,"forkHash":"0x63760190"},{"name":"byzantium","block":1700000,"forkHash":"0x3ea159c7"},{"name":"constantinople","block":4230000,"forkHash":"0x97b544f3"},{"name":"petersburg","block":4939394,"forkHash":"0xd6e2149b"},{"name":"istanbul","block":6485846,"forkHash":"0x4bc66396"},{"name":"muirGlacier","block":7117117,"forkHash":"0x6727ef90"},{"name":"berlin","block":9812189,"forkHash":"0xa157d377"},{"name":"london","block":10499401,"forkHash":"0x7119b6b3"}],"bootstrapNodes":[{"ip":"52.176.7.10","port":30303,"id":"30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606","location":"","comment":"US-Azure geth"},{"ip":"52.176.100.77","port":30303,"id":"865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c","location":"","comment":"US-Azure parity"},{"ip":"52.232.243.152","port":30303,"id":"6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f","location":"","comment":"Parity"},{"ip":"192.81.208.223","port":30303,"id":"94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09","location":"","comment":"@gpip"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.ropsten.ethdisco.net"]}')},7523:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-1559","number":1559,"comment":"Fee market change for ETH 1.0 chain","url":"https://eips.ethereum.org/EIPS/eip-1559","status":"Review","minimumHardfork":"berlin","requiredEIPs":[2930],"gasConfig":{"baseFeeMaxChangeDenominator":{"v":8,"d":"Maximum base fee change denominator"},"elasticityMultiplier":{"v":2,"d":"Maximum block gas target elasticity"},"initialBaseFee":{"v":1000000000,"d":"Initial base fee on first EIP1559 block"}},"gasPrices":{},"vm":{},"pow":{}}')},3339:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2315","number":2315,"comment":"Simple subroutines for the EVM","url":"https://eips.ethereum.org/EIPS/eip-2315","status":"Draft","minimumHardfork":"istanbul","gasConfig":{},"gasPrices":{"beginsub":{"v":2,"d":"Base fee of the BEGINSUB opcode"},"returnsub":{"v":5,"d":"Base fee of the RETURNSUB opcode"},"jumpsub":{"v":10,"d":"Base fee of the JUMPSUB opcode"}},"vm":{},"pow":{}}')},6769:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2537","number":2537,"comment":"BLS12-381 precompiles","url":"https://eips.ethereum.org/EIPS/eip-2537","status":"Draft","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{"Bls12381G1AddGas":{"v":600,"d":"Gas cost of a single BLS12-381 G1 addition precompile-call"},"Bls12381G1MulGas":{"v":12000,"d":"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},"Bls12381G2AddGas":{"v":4500,"d":"Gas cost of a single BLS12-381 G2 addition precompile-call"},"Bls12381G2MulGas":{"v":55000,"d":"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},"Bls12381PairingBaseGas":{"v":115000,"d":"Base gas cost of BLS12-381 pairing check"},"Bls12381PairingPerPairGas":{"v":23000,"d":"Per-pair gas cost of BLS12-381 pairing check"},"Bls12381MapG1Gas":{"v":5500,"d":"Gas cost of BLS12-381 map field element to G1"},"Bls12381MapG2Gas":{"v":110000,"d":"Gas cost of BLS12-381 map field element to G2"},"Bls12381MultiExpGasDiscount":{"v":[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],"d":"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},"vm":{},"pow":{}}')},7897:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2565","number":2565,"comment":"ModExp gas cost","url":"https://eips.ethereum.org/EIPS/eip-2565","status":"Last call","minimumHardfork":"byzantium","gasConfig":{},"gasPrices":{"modexpGquaddivisor":{"v":3,"d":"Gquaddivisor from modexp precompile for gas calculation"}},"vm":{},"pow":{}}')},2170:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2718","comment":"Typed Transaction Envelope","url":"https://eips.ethereum.org/EIPS/eip-2718","status":"Draft","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},8436:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2929","comment":"Gas cost increases for state access opcodes","url":"https://eips.ethereum.org/EIPS/eip-2929","status":"Draft","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{"coldsload":{"v":2100,"d":"Gas cost of the first read of storage from a given location (per transaction)"},"coldaccountaccess":{"v":2600,"d":"Gas cost of the first read of a given address (per transaction)"},"warmstorageread":{"v":100,"d":"Gas cost of reading storage locations which have already loaded \'cold\'"},"sstoreCleanGasEIP2200":{"v":2900,"d":"Once per SSTORE operation from clean non-zero to something else"},"sstoreNoopGasEIP2200":{"v":100,"d":"Once per SSTORE operation if the value doesn\'t change"},"sstoreDirtyGasEIP2200":{"v":100,"d":"Once per SSTORE operation if a dirty value is changed"},"sstoreInitRefundEIP2200":{"v":19900,"d":"Once per SSTORE operation for resetting to the original zero value"},"sstoreCleanRefundEIP2200":{"v":4900,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"call":{"v":0,"d":"Base fee of the CALL opcode"},"callcode":{"v":0,"d":"Base fee of the CALLCODE opcode"},"delegatecall":{"v":0,"d":"Base fee of the DELEGATECALL opcode"},"staticcall":{"v":0,"d":"Base fee of the STATICCALL opcode"},"balance":{"v":0,"d":"Base fee of the BALANCE opcode"},"extcodesize":{"v":0,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":0,"d":"Base fee of the EXTCODECOPY opcode"},"extcodehash":{"v":0,"d":"Base fee of the EXTCODEHASH opcode"},"sload":{"v":0,"d":"Base fee of the SLOAD opcode"},"sstore":{"v":0,"d":"Base fee of the SSTORE opcode"}},"vm":{},"pow":{}}')},6213:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2930","comment":"Optional access lists","url":"https://eips.ethereum.org/EIPS/eip-2930","status":"Draft","minimumHardfork":"istanbul","requiredEIPs":[2718,2929],"gasConfig":{},"gasPrices":{"accessListStorageKeyCost":{"v":1900,"d":"Gas cost per storage key in an Access List transaction"},"accessListAddressCost":{"v":2400,"d":"Gas cost per storage key in an Access List transaction"}},"vm":{},"pow":{}}')},5491:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3198","number":3198,"comment":"BASEFEE opcode","url":"https://eips.ethereum.org/EIPS/eip-3198","status":"Review","minimumHardfork":"london","gasConfig":{},"gasPrices":{"basefee":{"v":2,"d":"Gas cost of the BASEFEE opcode"}},"vm":{},"pow":{}}')},70:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3529","comment":"Reduction in refunds","url":"https://eips.ethereum.org/EIPS/eip-3529","status":"Draft","minimumHardfork":"berlin","requiredEIPs":[2929],"gasConfig":{"maxRefundQuotient":{"v":5,"d":"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},"gasPrices":{"selfdestructRefund":{"v":0,"d":"Refunded following a selfdestruct operation"},"sstoreClearRefundEIP2200":{"v":4800,"d":"Once per SSTORE operation for clearing an originally existing storage slot"}},"vm":{},"pow":{}}')},1871:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3541","comment":"Reject new contracts starting with the 0xEF byte","url":"https://eips.ethereum.org/EIPS/eip-3541","status":"Draft","minimumHardfork":"berlin","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},7225:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3554","comment":"Reduction in refunds","url":"Difficulty Bomb Delay to December 1st 2021","status":"Draft","minimumHardfork":"muirGlacier","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":9500000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},15:t=>{"use strict";t.exports=JSON.parse('{"name":"berlin","comment":"HF targeted for July 2020 following the Muir Glacier HF","url":"https://eips.ethereum.org/EIPS/eip-2070","status":"Draft","eips":[2565,2929,2718,2930]}')},6985:t=>{"use strict";t.exports=JSON.parse('{"name":"byzantium","comment":"Hardfork with new precompiles, instructions and other protocol changes","url":"https://eips.ethereum.org/EIPS/eip-609","status":"Final","gasConfig":{},"gasPrices":{"modexpGquaddivisor":{"v":20,"d":"Gquaddivisor from modexp precompile for gas calculation"},"ecAdd":{"v":500,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":40000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":100000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":80000,"d":"Gas costs regarding curve pairing precompile input length"},"revert":{"v":0,"d":"Base fee of the REVERT opcode"},"staticcall":{"v":700,"d":"Base fee of the STATICCALL opcode"},"returndatasize":{"v":2,"d":"Base fee of the RETURNDATASIZE opcode"},"returndatacopy":{"v":3,"d":"Base fee of the RETURNDATACOPY opcode"}},"vm":{},"pow":{"minerReward":{"v":"3000000000000000000","d":"the amount a miner get rewarded for mining a block"},"difficultyBombDelay":{"v":3000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},114:t=>{"use strict";t.exports=JSON.parse('{"name":"chainstart","comment":"Start of the Ethereum main chain","url":"","status":"","gasConfig":{"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be"},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations"},"maxRefundQuotient":{"v":2,"d":"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},"gasPrices":{"base":{"v":2,"d":"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},"tierStep":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them"},"exp":{"v":10,"d":"Base fee of the EXP opcode"},"expByte":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction"},"sha3":{"v":30,"d":"Base fee of the SHA3 opcode"},"sha3Word":{"v":6,"d":"Once per word of the SHA3 operation\'s data"},"sload":{"v":50,"d":"Base fee of the SLOAD opcode"},"sstoreSet":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero"},"sstoreReset":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero"},"sstoreRefund":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero"},"jumpdest":{"v":1,"d":"Base fee of the JUMPDEST opcode"},"log":{"v":375,"d":"Base fee of the LOG opcode"},"logData":{"v":8,"d":"Per byte in a LOG* operation\'s data"},"logTopic":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},"create":{"v":32000,"d":"Base fee of the CREATE opcode"},"call":{"v":40,"d":"Base fee of the CALL opcode"},"callStipend":{"v":2300,"d":"Free gas given at beginning of call"},"callValueTransfer":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero"},"callNewAccount":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior"},"selfdestructRefund":{"v":24000,"d":"Refunded following a selfdestruct operation"},"memory":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation"},"createData":{"v":200,"d":""},"tx":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions"},"txCreation":{"v":32000,"d":"The cost of creating a contract via tx"},"txDataZero":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},"txDataNonZero":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"copy":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},"ecRecover":{"v":3000,"d":""},"sha256":{"v":60,"d":""},"sha256Word":{"v":12,"d":""},"ripemd160":{"v":600,"d":""},"ripemd160Word":{"v":120,"d":""},"identity":{"v":15,"d":""},"identityWord":{"v":3,"d":""},"stop":{"v":0,"d":"Base fee of the STOP opcode"},"add":{"v":3,"d":"Base fee of the ADD opcode"},"mul":{"v":5,"d":"Base fee of the MUL opcode"},"sub":{"v":3,"d":"Base fee of the SUB opcode"},"div":{"v":5,"d":"Base fee of the DIV opcode"},"sdiv":{"v":5,"d":"Base fee of the SDIV opcode"},"mod":{"v":5,"d":"Base fee of the MOD opcode"},"smod":{"v":5,"d":"Base fee of the SMOD opcode"},"addmod":{"v":8,"d":"Base fee of the ADDMOD opcode"},"mulmod":{"v":8,"d":"Base fee of the MULMOD opcode"},"signextend":{"v":5,"d":"Base fee of the SIGNEXTEND opcode"},"lt":{"v":3,"d":"Base fee of the LT opcode"},"gt":{"v":3,"d":"Base fee of the GT opcode"},"slt":{"v":3,"d":"Base fee of the SLT opcode"},"sgt":{"v":3,"d":"Base fee of the SGT opcode"},"eq":{"v":3,"d":"Base fee of the EQ opcode"},"iszero":{"v":3,"d":"Base fee of the ISZERO opcode"},"and":{"v":3,"d":"Base fee of the AND opcode"},"or":{"v":3,"d":"Base fee of the OR opcode"},"xor":{"v":3,"d":"Base fee of the XOR opcode"},"not":{"v":3,"d":"Base fee of the NOT opcode"},"byte":{"v":3,"d":"Base fee of the BYTE opcode"},"address":{"v":2,"d":"Base fee of the ADDRESS opcode"},"balance":{"v":20,"d":"Base fee of the BALANCE opcode"},"origin":{"v":2,"d":"Base fee of the ORIGIN opcode"},"caller":{"v":2,"d":"Base fee of the CALLER opcode"},"callvalue":{"v":2,"d":"Base fee of the CALLVALUE opcode"},"calldataload":{"v":3,"d":"Base fee of the CALLDATALOAD opcode"},"calldatasize":{"v":2,"d":"Base fee of the CALLDATASIZE opcode"},"calldatacopy":{"v":3,"d":"Base fee of the CALLDATACOPY opcode"},"codesize":{"v":2,"d":"Base fee of the CODESIZE opcode"},"codecopy":{"v":3,"d":"Base fee of the CODECOPY opcode"},"gasprice":{"v":2,"d":"Base fee of the GASPRICE opcode"},"extcodesize":{"v":20,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":20,"d":"Base fee of the EXTCODECOPY opcode"},"blockhash":{"v":20,"d":"Base fee of the BLOCKHASH opcode"},"coinbase":{"v":2,"d":"Base fee of the COINBASE opcode"},"timestamp":{"v":2,"d":"Base fee of the TIMESTAMP opcode"},"number":{"v":2,"d":"Base fee of the NUMBER opcode"},"difficulty":{"v":2,"d":"Base fee of the DIFFICULTY opcode"},"gaslimit":{"v":2,"d":"Base fee of the GASLIMIT opcode"},"pop":{"v":2,"d":"Base fee of the POP opcode"},"mload":{"v":3,"d":"Base fee of the MLOAD opcode"},"mstore":{"v":3,"d":"Base fee of the MSTORE opcode"},"mstore8":{"v":3,"d":"Base fee of the MSTORE8 opcode"},"sstore":{"v":0,"d":"Base fee of the SSTORE opcode"},"jump":{"v":8,"d":"Base fee of the JUMP opcode"},"jumpi":{"v":10,"d":"Base fee of the JUMPI opcode"},"pc":{"v":2,"d":"Base fee of the PC opcode"},"msize":{"v":2,"d":"Base fee of the MSIZE opcode"},"gas":{"v":2,"d":"Base fee of the GAS opcode"},"push":{"v":3,"d":"Base fee of the PUSH opcode"},"dup":{"v":3,"d":"Base fee of the DUP opcode"},"swap":{"v":3,"d":"Base fee of the SWAP opcode"},"callcode":{"v":40,"d":"Base fee of the CALLCODE opcode"},"return":{"v":0,"d":"Base fee of the RETURN opcode"},"invalid":{"v":0,"d":"Base fee of the INVALID opcode"},"selfdestruct":{"v":0,"d":"Base fee of the SELFDESTRUCT opcode"}},"vm":{"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed"},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack"},"maxExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis"}},"pow":{"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be"},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations"},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"difficultyBombDelay":{"v":0,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},5993:t=>{"use strict";t.exports=JSON.parse('{"name":"constantinople","comment":"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)","url":"https://eips.ethereum.org/EIPS/eip-1013","status":"Final","gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":200,"d":"Once per SSTORE operation if the value doesn\'t change"},"netSstoreInitGas":{"v":20000,"d":"Once per SSTORE operation from clean zero"},"netSstoreCleanGas":{"v":5000,"d":"Once per SSTORE operation from clean non-zero"},"netSstoreDirtyGas":{"v":200,"d":"Once per SSTORE operation from dirty"},"netSstoreClearRefund":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"},"netSstoreResetRefund":{"v":4800,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"netSstoreResetClearRefund":{"v":19800,"d":"Once per SSTORE operation for resetting to the original zero value"},"shl":{"v":3,"d":"Base fee of the SHL opcode"},"shr":{"v":3,"d":"Base fee of the SHR opcode"},"sar":{"v":3,"d":"Base fee of the SAR opcode"},"extcodehash":{"v":400,"d":"Base fee of the EXTCODEHASH opcode"},"create2":{"v":32000,"d":"Base fee of the CREATE2 opcode"}},"vm":{},"pow":{"minerReward":{"v":"2000000000000000000","d":"The amount a miner gets rewarded for mining a block"},"difficultyBombDelay":{"v":5000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},7197:t=>{"use strict";t.exports=JSON.parse('{"name":"dao","comment":"DAO rescue hardfork","url":"https://eips.ethereum.org/EIPS/eip-779","status":"Final","gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},2800:t=>{"use strict";t.exports=JSON.parse('{"name":"homestead","comment":"Homestead hardfork with protocol and network changes","url":"https://eips.ethereum.org/EIPS/eip-606","status":"Final","gasConfig":{},"gasPrices":{"delegatecall":{"v":40,"d":"Base fee of the DELEGATECALL opcode"}},"vm":{},"pow":{}}')},3166:t=>{"use strict";t.exports=JSON.parse('{"name":"istanbul","comment":"HF targeted for December 2019 following the Constantinople/Petersburg HF","url":"https://eips.ethereum.org/EIPS/eip-1679","status":"Draft","gasConfig":{},"gasPrices":{"blake2Round":{"v":1,"d":"Gas cost per round for the Blake2 F precompile"},"ecAdd":{"v":150,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":6000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":45000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":34000,"d":"Gas costs regarding curve pairing precompile input length"},"txDataNonZero":{"v":16,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"sstoreSentryGasEIP2200":{"v":2300,"d":"Minimum gas required to be present for an SSTORE call, not consumed"},"sstoreNoopGasEIP2200":{"v":800,"d":"Once per SSTORE operation if the value doesn\'t change"},"sstoreDirtyGasEIP2200":{"v":800,"d":"Once per SSTORE operation if a dirty value is changed"},"sstoreInitGasEIP2200":{"v":20000,"d":"Once per SSTORE operation from clean zero to non-zero"},"sstoreInitRefundEIP2200":{"v":19200,"d":"Once per SSTORE operation for resetting to the original zero value"},"sstoreCleanGasEIP2200":{"v":5000,"d":"Once per SSTORE operation from clean non-zero to something else"},"sstoreCleanRefundEIP2200":{"v":4200,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"sstoreClearRefundEIP2200":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"},"balance":{"v":700,"d":"Base fee of the BALANCE opcode"},"extcodehash":{"v":700,"d":"Base fee of the EXTCODEHASH opcode"},"chainid":{"v":2,"d":"Base fee of the CHAINID opcode"},"selfbalance":{"v":5,"d":"Base fee of the SELFBALANCE opcode"},"sload":{"v":800,"d":"Base fee of the SLOAD opcode"}},"vm":{},"pow":{}}')},1250:t=>{"use strict";t.exports=JSON.parse('{"name":"london","comment":"HF targeted for July 2021 following the Berlin fork","url":"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md","status":"Draft","eips":[1559,3198,3529,3541]}')},2946:t=>{"use strict";t.exports=JSON.parse('{"name":"muirGlacier","comment":"HF to delay the difficulty bomb","url":"https://eips.ethereum.org/EIPS/eip-2384","status":"Final","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":9000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},4064:t=>{"use strict";t.exports=JSON.parse('{"name":"petersburg","comment":"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople","url":"https://eips.ethereum.org/EIPS/eip-1716","status":"Draft","gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreInitGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreCleanGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreDirtyGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreClearRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetClearRefund":{"v":null,"d":"Removed along EIP-1283"}},"vm":{},"pow":{}}')},716:t=>{"use strict";t.exports=JSON.parse('{"name":"spuriousDragon","comment":"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit","url":"https://eips.ethereum.org/EIPS/eip-607","status":"Final","gasConfig":{},"gasPrices":{"expByte":{"v":50,"d":"Times ceil(log256(exponent)) for the EXP instruction"}},"vm":{"maxCodeSize":{"v":24576,"d":"Maximum length of contract code"}},"pow":{}}')},2302:t=>{"use strict";t.exports=JSON.parse('{"name":"tangerineWhistle","comment":"Hardfork with gas cost changes for IO-heavy operations","url":"https://eips.ethereum.org/EIPS/eip-608","status":"Final","gasConfig":{},"gasPrices":{"sload":{"v":200,"d":"Once per SLOAD operation"},"call":{"v":700,"d":"Once per CALL operation & message call transaction"},"extcodesize":{"v":700,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":700,"d":"Base fee of the EXTCODECOPY opcode"},"balance":{"v":400,"d":"Base fee of the BALANCE opcode"},"delegatecall":{"v":700,"d":"Base fee of the DELEGATECALL opcode"},"callcode":{"v":700,"d":"Base fee of the CALLCODE opcode"},"selfdestruct":{"v":5000,"d":"Base fee of the SELFDESTRUCT opcode"}},"vm":{},"pow":{}}')},4946:t=>{"use strict";t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},5207:t=>{"use strict";t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},1308:t=>{"use strict";t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},9799:t=>{"use strict";t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},8597:t=>{"use strict";t.exports={i8:"6.5.4"}},2562:t=>{"use strict";t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdO={},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};return(()=>{"use strict";r.r(n),r.d(n,{createChallenge:()=>f,createSignature:()=>h,createSignaturePayloadB64:()=>l,createSignaturePayloadB64_:()=>c,utf8_to_b64:()=>u});var t=r(7728);const e=()=>"0x"+[...Array(32)].map((()=>Math.floor(16*Math.random()).toString(16))).join(""),i=()=>Math.floor(Date.now()/1e3);function o(t){return function(t,e,r){const n=e();return{types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"salt",type:"bytes32"}]},Challenge:[{name:"address",type:"address"},{name:"timestamp",type:"uint64"}],primaryType:"Challenge",domain:{name:"ETHChallenger",version:"1",chainId:""+t.chainId,salt:n},message:{address:t.address,timestamp:r()}}}(t,e,i)}var s=r(8764).Buffer;const a=r(6818);function u(t){return btoa(unescape(encodeURIComponent(t)))}function f(e,r=o){const n=r(e);return new(new t.ZP(n.domain).createType("Challenge",n.Challenge))(n.message)}function h(t,e){const r=e.signHash(),n=a.util.uint8ArrayToHex(r);return a.sign(t,n)}function c(t,e,r,n){const i=r(e),o={signature:n(t,i),challenge:i.toSignatureRequest()};return u(JSON.stringify(o))}function l(t,e){return c(t,e,f,h)}"undefined"==typeof btoa&&(r.g.btoa=function(t){return new s(t,"binary").toString("base64")})})(),n})()}));
// Node.JS
import { createSignaturePayloadB64 } from 'covalent-js-sign';
// To create the payload to that include the challenge data and the signature in base64,
const privateKey = "59e96b740f0af54f2d4335ddd033816fa24348b4097d3fddad4f6edc939f52e9";
const walletAddress = "0x71d094E5382CA33B25B92d3A75d5C6f269A78fAe";
const chainId = "1"; // default is "1"
// Node.JS
const payload = createSignaturePayloadB64(privateKey, walletAddress, chainId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment