diff --git a/src/register_app/asset-manifest.json b/src/register_app/asset-manifest.json index 461e655c..ced09ec3 100644 --- a/src/register_app/asset-manifest.json +++ b/src/register_app/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { "main.css": "/static/css/main.9b4dbe66.css", - "main.js": "/static/js/main.f54b619d.js", + "main.js": "/static/js/main.321651c6.js", "index.html": "/index.html", "main.9b4dbe66.css.map": "/static/css/main.9b4dbe66.css.map", - "main.f54b619d.js.map": "/static/js/main.f54b619d.js.map" + "main.321651c6.js.map": "/static/js/main.321651c6.js.map" }, "entrypoints": [ "static/css/main.9b4dbe66.css", - "static/js/main.f54b619d.js" + "static/js/main.321651c6.js" ] } \ No newline at end of file diff --git a/src/register_app/index.html b/src/register_app/index.html index a66e3ac1..c200e488 100644 --- a/src/register_app/index.html +++ b/src/register_app/index.html @@ -1 +1 @@ -Register - Uqbar
\ No newline at end of file +Register - Uqbar
\ No newline at end of file diff --git a/src/register_app/static/js/main.f54b619d.js b/src/register_app/static/js/main.321651c6.js similarity index 96% rename from src/register_app/static/js/main.f54b619d.js rename to src/register_app/static/js/main.321651c6.js index ee48aee0..09ce4f8c 100644 --- a/src/register_app/static/js/main.f54b619d.js +++ b/src/register_app/static/js/main.321651c6.js @@ -1,3 +1,3 @@ -/*! For license information please see main.f54b619d.js.LICENSE.txt */ -!function(){var e={2056:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="abi/5.7.0"},5054:function(e,t,r){"use strict";r.d(t,{R:function(){return D},$:function(){return B}});var n=r(5671),i=r(3144),o=r(9716),a=r(520),u=r(9502),s=r(2056),l=r(3198),c=r(136),f=r(9388),h=r(7419),d=function(e){(0,c.Z)(r,e);var t=(0,f.Z)(r);function r(e){return(0,n.Z)(this,r),t.call(this,"address","address",e,!1)}return(0,i.Z)(r,[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=(0,h.getAddress)(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return(0,h.getAddress)((0,o.hexZeroPad)(e.readValue().toHexString(),20))}}]),r}(l.XI),p=function(e){(0,c.Z)(r,e);var t=(0,f.Z)(r);function r(e){var i;return(0,n.Z)(this,r),(i=t.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,i}return(0,i.Z)(r,[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}]),r}(l.XI),v=new u.Logger(s.i);function m(e,t,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===typeof r){var i={};n=t.map((function(e){var t=e.localName;return t||v.throwError("cannot encode object for signature with missing names",u.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]&&v.throwError("cannot encode object for signature with duplicate names",u.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]=!0,r[t]}))}else v.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&v.throwArgumentError("types/value length mismatch","tuple",r);var o=new l.QV(e.wordSize),a=new l.QV(e.wordSize),s=[];t.forEach((function(e,t){var r=n[t];if(e.dynamic){var i=a.length;e.encode(a,r);var u=o.writeUpdatableValue();s.push((function(e){u(e+i)}))}else e.encode(o,r)})),s.forEach((function(e){e(o.length)}));var c=e.appendWriter(o);return c+=e.appendWriter(a)}function g(e,t){var r=[],n=e.subReader(0);t.forEach((function(t){var i=null;if(t.dynamic){var o=e.readValue(),a=n.subReader(o.toNumber());try{i=t.decode(a)}catch(s){if(s.code===u.Logger.errors.BUFFER_OVERRUN)throw s;(i=s).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(s){if(s.code===u.Logger.errors.BUFFER_OVERRUN)throw s;(i=s).baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&r.push(i)}));var i=t.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach((function(e,t){var n=e.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw o}}):r[n]=o}}));for(var o=function(){var e=r[a];e instanceof Error&&Object.defineProperty(r,a,{enumerable:!0,get:function(){throw e}})},a=0;a=0?i:"")+"]",s=-1===i||e.dynamic;return(a=t.call(this,"array",u,o,s)).coder=e,a.length=i,a}return(0,i.Z)(r,[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;re._data.length&&v.throwError("insufficient data length",u.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n256||n%8!==0)&&R.throwArgumentError("invalid "+r[1]+" bit length","param",e),new C(n/8,"int"===r[1],e.name)}if(r=e.type.match(I)){var i=parseInt(r[1]);return(0===i||i>32)&&R.throwArgumentError("invalid bytes length","param",e),new E(i,e.name)}return R.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new l.Ej(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new l.QV(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(M._R.from(e))}));return new T(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&R.throwError("types/values length mismatch",u.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(M._R.from(e))})),i=new T(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,i=e.map((function(e){return n._getCoder(M._R.from(e))}));return new T(i,"_").decode(this._getReader((0,o.arrayify)(t),r))}}]),e}(),B=new D},3198:function(e,t,r){"use strict";r.d(t,{BR:function(){return f},Ej:function(){return p},QV:function(){return d},XI:function(){return h}});var n=r(5671),i=r(3144),o=r(9716),a=r(2257),u=r(520),s=r(9502),l=r(2056),c=new s.Logger(l.i);function f(e){var t=[];return function e(r,n){if(Array.isArray(n))for(var i in n){var o=r.slice();o.push(i);try{e(o,n[i])}catch(a){t.push({path:o,error:a})}}}([],e),t}var h=function(){function e(t,r,i,o){(0,n.Z)(this,e),this.name=t,this.type=r,this.localName=i,this.dynamic=o}return(0,i.Z)(e,[{key:"_throwError",value:function(e,t){c.throwArgumentError(e,this.localName,t)}}]),e}(),d=function(){function e(t){(0,n.Z)(this,e),(0,u.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return(0,i.Z)(e,[{key:"data",get:function(){return(0,o.hexConcat)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData((0,o.concat)(e._data))}},{key:"writeBytes",value:function(e){var t=(0,o.arrayify)(e),r=t.length%this.wordSize;return r&&(t=(0,o.concat)([t,this._padding.slice(r)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=(0,o.arrayify)(a.O$.from(e));return t.length>this.wordSize&&c.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,o.concat)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),p=function(){function e(t,r,i,a){(0,n.Z)(this,e),(0,u.defineReadOnly)(this,"_data",(0,o.arrayify)(t)),(0,u.defineReadOnly)(this,"wordSize",r||32),(0,u.defineReadOnly)(this,"_coerceFunc",i),(0,u.defineReadOnly)(this,"allowLoose",a),this._offset=0}return(0,i.Z)(e,[{key:"data",get:function(){return(0,o.hexlify)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:c.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return a.O$.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}()},3165:function(e,t,r){"use strict";r.d(t,{HY:function(){return k},IC:function(){return N},QV:function(){return A},Xg:function(){return P},YW:function(){return _},_R:function(){return b},pc:function(){return g}});var n=r(136),i=r(9388),o=r(5671),a=r(3144),u=r(2257),s=r(520),l=r(9502),c=r(2056),f=new l.Logger(c.i),h={},d={calldata:!0,memory:!0,storage:!0},p={calldata:!0,memory:!0};function v(e,t){if("bytes"===e||"string"===e){if(d[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&p[t])return!0;return(d[t]||"payable"===t)&&f.throwArgumentError("invalid modifier","name",t),!1}function m(e,t){for(var r in t)(0,s.defineReadOnly)(e,r,t[r])}var g=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),y=new RegExp(/^(.*)\[([0-9]*)\]$/),b=function(){function e(t,r){(0,o.Z)(this,e),t!==h&&f.throwError("use fromString",l.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),m(this,r);var n=this.type.match(y);m(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return(0,a.Z)(e,[{key:"format",value:function(e){if(e||(e=g.sighash),g[e]||f.throwArgumentError("invalid format type","format",e),e===g.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==g.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===g.full?", ":",")+")"):r+=this.type,e!==g.sighash&&(!0===this.indexed&&(r+=" indexed"),e===g.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"===typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(h,{name:t.name||null,type:O(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return n=function(e,t){var r=e;function n(t){f.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,u=0;u2&&f.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||f.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=u.O$.from(r[1]),r[0]):e}function E(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function S(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&f.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&f.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||f.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&f.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&f.throwArgumentError("unable to determine stateMutability","value",e),t}var P=function(e){(0,n.Z)(r,e);var t=(0,i.Z)(r);function r(){return(0,o.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"format",value:function(e){if(e||(e=g.sighash),g[e]||f.throwArgumentError("invalid format type","format",e),e===g.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===g.sighash&&f.throwError("cannot format a constructor for sighash",l.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===g.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&f.throwArgumentError("invalid constructor object","value",e);var t=S(e);t.constant&&f.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(b.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?u.O$.from(e.gas):null};return new r(h,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=x(e,t)).match(R);return n&&"constructor"===n[1].trim()||f.throwArgumentError("invalid constructor string","value",e),t.inputs=w(n[2].trim(),!1),E(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(k),_=function(e){(0,n.Z)(r,e);var t=(0,i.Z)(r);function r(){return(0,o.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"format",value:function(e){if(e||(e=g.sighash),g[e]||f.throwArgumentError("invalid format type","format",e),e===g.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==g.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===g.full?", ":",")+") ",e!==g.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&f.throwArgumentError("invalid function object","value",e);var t=S(e),n={type:e.type,name:M(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(b.fromObject):[],outputs:e.outputs?e.outputs.map(b.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?u.O$.from(e.gas):null};return new r(h,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=x(e,t)).split(" returns ");n.length>2&&f.throwArgumentError("invalid function string","value",e);var i=n[0].match(R);if(i||f.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&M(t.name),t.inputs=w(i[2],!1),E(i[3].trim(),t),n.length>1){var o=n[1].match(R);""==o[1].trim()&&""==o[3].trim()||f.throwArgumentError("unexpected tokens","value",e),t.outputs=w(o[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(P);function C(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||f.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var N=function(e){(0,n.Z)(r,e);var t=(0,i.Z)(r);function r(){return(0,o.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"format",value:function(e){if(e||(e=g.sighash),g[e]||f.throwArgumentError("invalid format type","format",e),e===g.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==g.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===g.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&f.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:M(e.name),inputs:e.inputs?e.inputs.map(b.fromObject):[]};return C(new r(h,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(R);return n||f.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&M(t.name),t.inputs=w(n[2],!1),C(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(k);function O(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var T=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function M(e){return e&&e.match(T)||f.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var R=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},8334:function(e,t,r){"use strict";r.r(t),r.d(t,{AbiCoder:function(){return i.R},ConstructorFragment:function(){return n.Xg},ErrorFragment:function(){return n.IC},EventFragment:function(){return n.QV},FormatTypes:function(){return n.pc},Fragment:function(){return n.HY},FunctionFragment:function(){return n.YW},Indexed:function(){return o.Hk},Interface:function(){return o.vU},LogDescription:function(){return o.CC},ParamType:function(){return n._R},TransactionDescription:function(){return o.vk},checkResultErrors:function(){return a.BR},defaultAbiCoder:function(){return i.$}});var n=r(3165),i=r(5054),o=r(7303),a=r(3198)},7303:function(e,t,r){"use strict";r.d(t,{CC:function(){return y},Hk:function(){return k},vU:function(){return E},vk:function(){return b}});var n=r(3144),i=r(5671),o=r(136),a=r(9388),u=r(7419),s=r(2257),l=r(9716),c=r(1583),f=r(8062),h=r(520),d=r(5054),p=r(3165),v=r(9502),m=r(2056),g=new v.Logger(m.i),y=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r)}(h.Description),b=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r)}(h.Description),w=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r)}(h.Description),k=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),r}(h.Description),A={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function x(e,t){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}var E=function(){function e(t){var r=this;(0,i.Z)(this,e);var n=[];n="string"===typeof t?JSON.parse(t):t,(0,h.defineReadOnly)(this,"fragments",n.map((function(e){return p.HY.from(e)})).filter((function(e){return null!=e}))),(0,h.defineReadOnly)(this,"_abiCoder",(0,h.getStatic)(this instanceof e?this.constructor:void 0,"getAbiCoder")()),(0,h.defineReadOnly)(this,"functions",{}),(0,h.defineReadOnly)(this,"errors",{}),(0,h.defineReadOnly)(this,"events",{}),(0,h.defineReadOnly)(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return r.deploy?void g.warn("duplicate definition - constructor"):void(0,h.defineReadOnly)(r,"deploy",e);case"function":t=r.functions;break;case"event":t=r.events;break;case"error":t=r.errors;break;default:return}var n=e.format();t[n]?g.warn("duplicate definition - "+n):t[n]=e})),this.deploy||(0,h.defineReadOnly)(this,"deploy",p.Xg.from({payable:!1,type:"constructor"})),(0,h.defineReadOnly)(this,"_isInterface",!0)}return(0,n.Z)(e,[{key:"format",value:function(e){e||(e=p.pc.full),e===p.pc.sighash&&g.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===p.pc.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if((0,l.isHexString)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];g.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?g.throwArgumentError("no matching function","name",r):n.length>1&&g.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[p.YW.fromString(e).format()];return i||g.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if((0,l.isHexString)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];g.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?g.throwArgumentError("no matching event","name",n):i.length>1&&g.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[p.QV.fromString(e).format()];return o||g.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if((0,l.isHexString)(e)){var t=(0,h.getStatic)(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}g.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?g.throwArgumentError("no matching error","name",n):i.length>1&&g.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[p.YW.fromString(e).format()];return o||g.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(r){throw t}}return(0,h.getStatic)(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"===typeof e&&(e=this.getEvent(e)),(0,h.getStatic)(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"===typeof e&&(e=this.getError(e));var r=(0,l.arrayify)(t);return(0,l.hexlify)(r.slice(0,4))!==this.getSighash(e)&&g.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",(0,l.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"===typeof e&&(e=this.getError(e)),(0,l.hexlify)((0,l.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=(0,l.arrayify)(t);return(0,l.hexlify)(r.slice(0,4))!==this.getSighash(e)&&g.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",(0,l.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,l.hexlify)((0,l.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=(0,l.arrayify)(t),n=null,i="",o=null,a=null,u=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(f){}break;case 4:var s=(0,l.hexlify)(r.slice(0,4)),c=A[s];if(c)o=this._abiCoder.decode(c.inputs,r.slice(4)),a=c.name,u=c.signature,c.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var f=this.getError(s);o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,u=f.format()}catch(f){}}return g.throwError("call revert exception"+i,v.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,l.hexlify)(t),errorArgs:o,errorName:a,errorSignature:u,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,l.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&g.throwError("too many arguments for "+e.format(),v.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var n=[];e.anonymous||n.push(this.getEventTopic(e));var i=function(e,t){return"string"===e.type?(0,c.id)(t):"bytes"===e.type?(0,f.keccak256)((0,l.hexlify)(t)):("bool"===e.type&&"boolean"===typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=s.O$.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),(0,l.hexZeroPad)((0,l.hexlify)(t),32))};for(t.forEach((function(t,r){var o=e.inputs[r];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?g.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((function(e){return i(o,e)}))):n.push(i(o,t)):null!=t&&g.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"===typeof e&&(e=this.getEvent(e));var n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&g.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var u=t[a];if(e.indexed)if("string"===e.type)n.push((0,c.id)(u));else if("bytes"===e.type)n.push((0,f.keccak256)(u));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[u]))}else i.push(e),o.push(u)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"===typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);(0,l.isHexString)(r[0],32)&&r[0].toLowerCase()===n||g.throwError("fragment/topic mismatch",v.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(p._R.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(o.push(e),a.push(!1))}));var u=null!=r?this._abiCoder.decode(i,(0,l.concat)(r)):null,s=this._abiCoder.decode(o,t,!0),c=[],f=0,h=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==u)c[t]=new k({_isIndexed:!0,hash:null});else if(a[t])c[t]=new k({_isIndexed:!0,hash:u[h++]});else try{c[t]=u[h++]}catch(n){c[t]=n}else try{c[t]=s[f++]}catch(n){c[t]=n}if(e.name&&null==c[e.name]){var r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:function(){throw x("property ".concat(JSON.stringify(e.name)),r)}}):c[e.name]=r}}));for(var d=function(e){var t=c[e];t instanceof Error&&Object.defineProperty(c,e,{enumerable:!0,get:function(){throw x("index ".concat(e),t)}})},m=0;m=0)throw e;return h.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",c.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&h.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,(0,l.resolveProperties)(r);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||h.throwError("missing provider",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),m=function(e){(0,i.Z)(r,e);var t=(0,o.Z)(r);function r(e,i){var o;return(0,u.Z)(this,r),o=t.call(this),(0,l.defineReadOnly)((0,n.Z)(o),"address",e),(0,l.defineReadOnly)((0,n.Z)(o),"provider",i||null),o}return(0,s.Z)(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){h.throwError(e,c.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new r(this.address,e)}}]),r}(v)},7419:function(e,t,r){"use strict";r.r(t),r.d(t,{getAddress:function(){return v},getContractAddress:function(){return y},getCreate2Address:function(){return b},getIcapAddress:function(){return g},isAddress:function(){return m}});var n=r(9716),i=r(2257),o=r(8062),a=r(7986),u=new(r(9502).Logger)("address/5.7.0");function s(e){(0,n.isHexString)(e,20)||u.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=t[i].charCodeAt(0);for(var a=(0,n.arrayify)((0,o.keccak256)(r)),s=0;s<40;s+=2)a[s>>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(15&a[s>>1])>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(var f=0;f<26;f++)l[String.fromCharCode(65+f)]=String(10+f);var h,d=Math.floor((h=9007199254740991,Math.log10?Math.log10(h):Math.log(h)/Math.LN10));function p(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return l[e]})).join("");t.length>=d;){var r=t.substring(0,d);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!==typeof e&&u.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=s(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=s("0x"+t)}else u.throwArgumentError("invalid address","address",e);return t}function m(e){try{return v(e),!0}catch(t){}return!1}function g(e){for(var t=(0,i.t2)(v(e).substring(2)).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t}function y(e){var t=null;try{t=v(e.from)}catch(s){u.throwArgumentError("missing from address","transaction",e)}var r=(0,n.stripZeros)((0,n.arrayify)(i.O$.from(e.nonce).toHexString()));return v((0,n.hexDataSlice)((0,o.keccak256)((0,a.encode)([t,r])),12))}function b(e,t,r){return 32!==(0,n.hexDataLength)(t)&&u.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,n.hexDataLength)(r)&&u.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),v((0,n.hexDataSlice)((0,o.keccak256)((0,n.concat)(["0xff",v(e),t,r])),12))}},7354:function(e,t,r){"use strict";r.d(t,{J:function(){return i},c:function(){return o}});var n=r(9716);function i(e){e=atob(e);for(var t=[],r=0;r0;)r.push(i%this.base),i=i/this.base|0}for(var u="",s=0;0===t[s]&&s=0;--l)u+=this.alphabet[r[l]];return u}},{key:"decode",value:function(e){if("string"!==typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(var u=0;e[u]===this._leader&&u0&&(10===arguments[0]?v||(v=!0,f.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?f.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):f.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),b(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(t){if(t instanceof e)return t;if("string"===typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(h,g(t)):t.match(/^-?[0-9]+$/)?new e(h,g(new c(t))):f.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&w("underflow","BigNumber.from",t),(t>=d||t<=-d)&&w("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"===typeof r)return e.from(r.toString());if((0,u.isBytes)(r))return e.from((0,u.hexlify)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"===typeof n)return e.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"===typeof i&&((0,u.isHexString)(i)||"-"===i[0]&&(0,u.isHexString)(i.substring(1))))return e.from(i)}return f.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function g(e){if("string"!==typeof e)return g(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&f.throwArgumentError("invalid hex","value",e),"0x00"===(e=g(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function y(e){return m.from(g(e))}function b(e){var t=m.from(e).toHexString();return"-"===t[0]?new c("-"+t.substring(3),16):new c(t.substring(2),16)}function w(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),f.throwError(e,s.Logger.errors.NUMERIC_FAULT,n)}function k(e){return new c(e,36).toString(16)}function A(e){return new c(e,16).toString(36)}},9716:function(e,t,r){"use strict";r.r(t),r.d(t,{arrayify:function(){return l},concat:function(){return c},hexConcat:function(){return y},hexDataLength:function(){return m},hexDataSlice:function(){return g},hexStripZeros:function(){return w},hexValue:function(){return b},hexZeroPad:function(){return k},hexlify:function(){return v},isBytes:function(){return s},isBytesLike:function(){return a},isHexString:function(){return d},joinSignature:function(){return x},splitSignature:function(){return A},stripZeros:function(){return f},zeroPad:function(){return h}});var n=new(r(9502).Logger)("bytes/5.7.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return d(e)&&!(e.length%2)||s(e)}function u(e){return"number"===typeof e&&e==e&&e%1===0}function s(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!u(e.length)||e.length<0)return!1;for(var t=0;t=256)return!1}return!0}function l(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid arrayify value");for(var r=[];e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),o(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),d(e)){var a=e.substring(2);a.length%2&&("left"===t.hexPad?a="0"+a:"right"===t.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",e));for(var u=[],l=0;lt&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(t);return r.set(e,t-e.length),o(r)}function d(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var p="0123456789abcdef";function v(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid hexlify value");for(var r="";e;)r=p[15&e]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(d(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(s(e)){for(var o="0x",a=0;a>4]+p[15&u]}return o}return n.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!==typeof e)e=v(e);else if(!d(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,r){return"string"!==typeof e?e=v(e):(!d(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function y(e){var t="0x";return e.forEach((function(e){t+=v(e).substring(2)})),t}function b(e){var t=w(v(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!==typeof e&&(e=v(e)),d(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);for(var t=0;t2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function A(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){var r=l(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=v(r.slice(0,32)),t.s=v(r.slice(32,64))):65===r.length?(t.r=v(r.slice(0,32)),t.s=v(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=v(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var i=h(l(t._vs),32);t._vs=v(i);var o=i[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127;var u=v(i);null==t.s?t.s=u:t.s!==u&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var s=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==s&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&d(t.r)?t.r=k(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&d(t.s)?t.s=k(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);var c=l(t.s);c[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(c[0]|=128);var f=v(c);t._vs&&(d(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=k(t._vs,32)),null==t._vs?t._vs=f:t._vs!==f&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function x(e){return v(c([(e=A(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},5422:function(e,t,r){"use strict";r.d(t,{Bz:function(){return u},_Y:function(){return o},fh:function(){return a},tL:function(){return i}});var n=r(2257),i=n.O$.from(-1),o=n.O$.from(0),a=n.O$.from(1),u=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},4867:function(e,t,r){"use strict";r.d(t,{R:function(){return n}});var n="0x0000000000000000000000000000000000000000000000000000000000000000"},9366:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="hash/5.7.0"},1583:function(e,t,r){"use strict";r.d(t,{id:function(){return o}});var n=r(8062),i=r(3374);function o(e){return(0,n.keccak256)((0,i.Y0)(e))}},1049:function(e,t,r){"use strict";r.r(t),r.d(t,{_TypedDataEncoder:function(){return a.E},dnsEncode:function(){return i.Kn},ensNormalize:function(){return i.w3},hashMessage:function(){return o.r},id:function(){return n.id},isValidName:function(){return i.r1},messagePrefix:function(){return o.B},namehash:function(){return i.VM}});var n=r(1583),i=r(5235),o=r(2273),a=r(5992)},2273:function(e,t,r){"use strict";r.d(t,{B:function(){return a},r:function(){return u}});var n=r(9716),i=r(8062),o=r(3374),a="\x19Ethereum Signed Message:\n";function u(e){return"string"===typeof e&&(e=(0,o.Y0)(e)),(0,i.keccak256)((0,n.concat)([(0,o.Y0)(a),(0,o.Y0)(String(e.length)),e]))}},5235:function(e,t,r){"use strict";r.d(t,{Kn:function(){return F},w3:function(){return L},r1:function(){return D},VM:function(){return B}});var n=r(9716),i=r(3374),o=r(8062),a=r(9502),u=r(9366),s=r(3433),l=r(7762);function c(e,t){null==t&&(t=1);var r=[],n=r.forEach;return function e(t,i){n.call(t,(function(t){i>0&&Array.isArray(t)?e(t,i-1):r.push(t)}))}(e,t),r}function f(e){return function(e){var t=0;return function(){return e[t++]}}(function(e){var t=0;function r(){return e[t++]<<8|e[t++]}for(var n=r(),i=1,o=[0,1],a=1;a>--l&1}for(var h=Math.pow(2,31),d=h>>>1,p=d>>1,v=h-1,m=0,g=0;g<31;g++)m=m<<1|f();for(var y=[],b=0,w=h;;){for(var k=Math.floor(((m-b+1)*i-1)/w),A=0,x=n;x-A>1;){var E=A+x>>>1;k>>1|f(),S=S<<1^d,P=(P^d)<<1|d|1;b=S,w=1+P-S}var _=n-4;return y.map((function(t){switch(t-_){case 3:return _+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return _+256+(e[s++]<<8|e[s++]);case 1:return _+e[s++];default:return t-1}}))}(e))}function h(e){return 1&e?~e>>1:e>>1}function d(e,t){for(var r=Array(e),n=0,i=-1;n>=1),check:2==o}}()}(b),E=45,S=95;function P(e){return(0,i.XL)(e)}function _(e){return e.filter((function(e){return 65039!=e}))}function C(e){var t,r=(0,l.Z)(e.split("."));try{for(r.s();!(t=r.n()).done;){var n=t.value,i=P(n);try{for(var o=i.lastIndexOf(S)-1;o>=0;o--)if(i[o]!==S)throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(e){return e<128}))&&i[2]===E&&i[3]===E)throw new Error("invalid label extension")}catch(a){throw new Error('Invalid label "'.concat(n,'": ').concat(a.message))}}}catch(a){r.e(a)}finally{r.f()}return e}function N(e){return C(function(e,t){var r=P(e).reverse(),n=[];for(;r.length;){var i=O(r);if(i)n.push.apply(n,(0,s.Z)(t(i)));else{var o=r.pop();if(w.has(o))n.push(o);else if(!k.has(o)){var a=A[o];if(!a)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));n.push.apply(n,(0,s.Z)(a))}}}return C((u=String.fromCodePoint.apply(String,n),u.normalize("NFC")));var u}(e,_))}function O(e,t){var r,n,i,o=x,a=[],u=e.length;t&&(t.length=0);for(var l=function(){var l=e[--u];if(!(o=null===(r=o.branches.find((function(e){return e.set.has(l)})))||void 0===r?void 0:r.node))return 0;if(o.save)i=l;else if(o.check&&l===i)return 0;a.push(l),o.fe0f&&(a.push(65039),u>0&&65039==e[u-1]&&u--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push.apply(t,(0,s.Z)(e.slice(u).reverse())),e.length=u)};u&&0!==l(););return n}var T=new a.Logger(u.i),M=new Uint8Array(32);function R(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function I(e){var t=(0,i.Y0)(N(e)),r=[];if(0===e.length)return r;for(var n=0,o=0;o=t.length)throw new Error("invalid ENS name; empty component");return r.push(R(t.slice(n))),r}function L(e){return I(e).map((function(e){return(0,i.ZN)(e)})).join(".")}function D(e){try{return 0!==I(e).length}catch(t){}return!1}function B(e){"string"!==typeof e&&T.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=M,r=I(e);r.length;)t=(0,o.keccak256)((0,n.concat)([t,(0,o.keccak256)(r.pop())]));return(0,n.hexlify)(t)}function F(e){return(0,n.hexlify)((0,n.concat)(I(e).map((function(e){if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}M.fill(0)},5992:function(e,t,r){"use strict";r.d(t,{E:function(){return N}});var n=r(4165),i=r(5671),o=r(3144),a=r(7419),u=r(2257),s=r(9716),l=r(8062),c=r(520),f=r(9502),h=r(9366),d=r(1583),p=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(t){o(t)}}function u(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))},v=new f.Logger(h.i),m=new Uint8Array(32);m.fill(0);var g=u.O$.from(-1),y=u.O$.from(0),b=u.O$.from(1),w=u.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var k=(0,s.hexZeroPad)(b.toHexString(),32),A=(0,s.hexZeroPad)(y.toHexString(),32),x={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},E=["name","version","chainId","verifyingContract","salt"];function S(e){return function(t){return"string"!==typeof t&&v.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var P={name:S("name"),version:S("version"),chainId:function(e){try{return u.O$.from(e).toString()}catch(t){}return v.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,a.getAddress)(e).toLowerCase()}catch(t){}return v.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=(0,s.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,s.hexlify)(t)}catch(r){}return v.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function _(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var r=""===t[1],n=parseInt(t[2]||"256");(n%8!==0||n>256||t[2]&&t[2]!==String(n))&&v.throwArgumentError("invalid numeric width","type",e);var i=w.mask(r?n-1:n),o=r?i.add(b).mul(g):y;return function(t){var r=u.O$.from(t);return(r.lt(o)||r.gt(i))&&v.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),(0,s.hexZeroPad)(r.toTwos(256).toHexString(),32)}}var c=e.match(/^bytes(\d+)$/);if(c){var f=parseInt(c[1]);return(0===f||f>32||c[1]!==String(f))&&v.throwArgumentError("invalid bytes width","type",e),function(t){return(0,s.arrayify)(t).length!==f&&v.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=(0,s.arrayify)(e),r=t.length%32;return r?(0,s.hexConcat)([t,m.slice(r)]):(0,s.hexlify)(t)}(t)}}switch(e){case"address":return function(e){return(0,s.hexZeroPad)((0,a.getAddress)(e),32)};case"bool":return function(e){return e?k:A};case"bytes":return function(e){return(0,l.keccak256)(e)};case"string":return function(e){return(0,d.id)(e)}}return null}function C(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var N=function(){function e(t){(0,i.Z)(this,e),(0,c.defineReadOnly)(this,"types",Object.freeze((0,c.deepCopy)(t))),(0,c.defineReadOnly)(this,"_encoderCache",{}),(0,c.defineReadOnly)(this,"_types",{});var r={},n={},o={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],o[e]={}}));var a=function(e){var i={};t[e].forEach((function(o){i[o.name]&&v.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&v.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),_(a)||(n[a]||v.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))};for(var u in t)a(u);var s=Object.keys(n).filter((function(e){return 0===n[e].length}));for(var l in 0===s.length?v.throwArgumentError("missing primary type","types",t):s.length>1&&v.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),(0,c.defineReadOnly)(this,"primaryType",s[0]),function e(i,a){a[i]&&v.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",t),a[i]=!0,Object.keys(r[i]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){o[e][t]=!0})))})),delete a[i]}(this.primaryType,{}),o){var f=Object.keys(o[l]);f.sort(),this._types[l]=C(l,t[l])+f.map((function(e){return C(e,t[e])})).join("")}}return(0,o.Z)(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,r=_(e);if(r)return r;var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]);return function(e){a>=0&&e.length!==a&&v.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(o);return t._types[i]&&(r=r.map(l.keccak256)),(0,l.keccak256)((0,s.hexConcat)(r))}}var u=this.types[e];if(u){var c=(0,d.id)(this._types[e]);return function(e){var r=u.map((function(r){var n=r.name,i=r.type,o=t.getEncoder(i)(e[n]);return t._types[i]?(0,l.keccak256)(o):o}));return r.unshift(c),(0,s.hexConcat)(r)}}return v.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||v.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return(0,l.keccak256)(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this;if(_(e))return r(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&t.length!==a&&v.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(o,e,r)}))}var u=this.types[e];return u?u.reduce((function(e,i){var o=i.name,a=i.type;return e[o]=n._visit(a,t[o],r),e}),{}):v.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[];for(var n in t){var i=x[n];i||v.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:i})}return r.sort((function(e,t){return E.indexOf(e.name)-E.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return(0,s.hexConcat)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return(0,l.keccak256)(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,i,o){return p(this,void 0,void 0,(0,n.Z)().mark((function a(){var u,l,f;return(0,n.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:t=(0,c.shallowCopy)(t),u={},t.verifyingContract&&!(0,s.isHexString)(t.verifyingContract,20)&&(u[t.verifyingContract]="0x"),(l=e.from(r)).visit(i,(function(e,t){return"address"!==e||(0,s.isHexString)(t,20)||(u[t]="0x"),t})),a.t0=(0,n.Z)().keys(u);case 6:if((a.t1=a.t0()).done){a.next=13;break}return f=a.t1.value,a.next=10,o(f);case 10:u[f]=a.sent,a.next=6;break;case 13:return t.verifyingContract&&u[t.verifyingContract]&&(t.verifyingContract=u[t.verifyingContract]),i=l.visit(i,(function(e,t){return"address"===e&&u[t]?u[t]:t})),a.abrupt("return",{domain:t,value:i});case 16:case"end":return a.stop()}}),a)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var i={},o=[];E.forEach((function(e){var r=t[e];null!=r&&(i[e]=P[e](r),o.push({name:e,type:x[e]}))}));var a=e.from(r),l=(0,c.shallowCopy)(r);return l.EIP712Domain?v.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):l.EIP712Domain=o,a.encode(n),{types:l,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return(0,s.hexlify)((0,s.arrayify)(t));if(e.match(/^u?int/))return u.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&v.throwArgumentError("invalid string","value",t),t}return v.throwArgumentError("unsupported type","type",e)}))}}}]),e}()},5148:function(e,t,r){"use strict";r.r(t),r.d(t,{HDNode:function(){return L},defaultPath:function(){return I},entropyToMnemonic:function(){return F},getAccountPath:function(){return Z},isValidMnemonic:function(){return j},mnemonicToEntropy:function(){return B},mnemonicToSeed:function(){return D}});var n=r(5671),i=r(3144),o=r(3482),a=r(9716),u=r(2257),s=r(3374),l=r(2522),c=r(520),f=r(8865),h=r(9598),d=r(4667),p=r(5452),v=r(136),m=r(9388),g=r(1583),y=r(9502),b=new y.Logger("wordlists/5.7.0"),w=function(){function e(t){(0,n.Z)(this,e),b.checkAbstract(this instanceof e?this.constructor:void 0,e),(0,c.defineReadOnly)(this,"locale",t)}return(0,i.Z)(e,[{key:"split",value:function(e){return e.toLowerCase().split(/ +/g)}},{key:"join",value:function(e){return e.join(" ")}}],[{key:"check",value:function(e){for(var t=[],r=0;r<2048;r++){var n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return(0,g.id)(t.join("\n")+"\n")}},{key:"register",value:function(e,t){t||(t=e.locale)}}]),e}(),k=null;function A(e){if(null==k&&(k="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==w.check(e)))throw k=null,new Error("BIP39 Wordlist for en (English) FAILED")}var x=new(function(e){(0,v.Z)(r,e);var t=(0,m.Z)(r);function r(){return(0,n.Z)(this,r),t.call(this,"en")}return(0,i.Z)(r,[{key:"getWord",value:function(e){return A(this),k[e]}},{key:"getWordIndex",value:function(e){return A(this),k.indexOf(e)}}]),r}(w));w.register(x);var E={en:x},S=new y.Logger("hdnode/5.7.0"),P=u.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_=(0,s.Y0)("Bitcoin seed"),C=2147483648;function N(e){return(1<=256)throw new Error("Depth too large!");return T((0,a.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,a.hexlify)(this.depth),this.parentFingerprint,(0,a.hexZeroPad)((0,a.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,a.concat)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(R,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t));var r=this.path;r&&(r+="/"+(t&~C));var n=new Uint8Array(37);if(t&C){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set((0,a.arrayify)(this.privateKey),1),r&&(r+="'")}else n.set((0,a.arrayify)(this.publicKey));for(var i=24;i>=0;i-=8)n[33+(i>>3)]=t>>24-i&255;var o=(0,a.arrayify)((0,h.Gy)(d.p.sha512,this.chainCode,n)),s=o.slice(0,32),l=o.slice(32),c=null,p=null;this.privateKey?c=O(u.O$.from(s).add(this.privateKey).mod(P)):p=new f.SigningKey((0,a.hexlify)(s))._addPoint(this.publicKey);var v=r,m=this.mnemonic;return m&&(v=Object.freeze({phrase:m.phrase,path:r,locale:m.locale||"en"})),new e(R,c,p,this.fingerprint,O(l),t,this.depth+1,v)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var r=this,n=0;n=C)throw new Error("invalid path index - "+i);r=r._derive(C+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);var a=parseInt(i);if(a>=C)throw new Error("invalid path index - "+i);r=r._derive(a)}}return r}}],[{key:"_fromSeed",value:function(t,r){var n=(0,a.arrayify)(t);if(n.length<16||n.length>64)throw new Error("invalid seed");var i=(0,a.arrayify)((0,h.Gy)(d.p.sha512,_,n));return new e(R,O(i.slice(0,32)),null,"0x00000000",O(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=F(B(t,n=M(n)),n),e._fromSeed(D(t,r),{phrase:t,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var r=o.Base58.decode(t);82===r.length&&T(r.slice(0,78))===t||S.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],i=(0,a.hexlify)(r.slice(5,9)),u=parseInt((0,a.hexlify)(r.slice(9,13)).substring(2),16),s=(0,a.hexlify)(r.slice(13,45)),l=r.slice(45,78);switch((0,a.hexlify)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(R,null,(0,a.hexlify)(l),i,s,u,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==l[0])break;return new e(R,(0,a.hexlify)(l.slice(1)),null,i,s,u,n,null)}return S.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}]),e}();function D(e,t){t||(t="");var r=(0,s.Y0)("mnemonic"+t,s.Uj.NFKD);return(0,l.n)((0,s.Y0)(e,s.Uj.NFKD),r,2048,64,"sha512")}function B(e,t){t=M(t),S.checkNormalize();var r=t.split(e);if(r.length%3!==0)throw new Error("invalid mnemonic");for(var n=(0,a.arrayify)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o>3]|=1<<7-i%8),i++}var l=32*r.length/3,c=N(r.length/3);if(((0,a.arrayify)((0,h.JQ)(n.slice(0,l/8)))[0]&c)!==(n[n.length-1]&c))throw new Error("invalid checksum");return(0,a.hexlify)(n.slice(0,l/8))}function F(e,t){if(t=M(t),(e=(0,a.arrayify)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i8?(r[r.length-1]<<=8,r[r.length-1]|=e[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[i]>>8-n,r.push(e[i]&(1<<8-n)-1),n+=3);var o=e.length/4,u=(0,a.arrayify)((0,h.JQ)(e))[0]&N(o);return r[r.length-1]<<=o,r[r.length-1]|=u>>8-o,t.join(r.map((function(e){return t.getWord(e)})))}function j(e,t){try{return B(e,t),!0}catch(r){}return!1}function Z(e){return("number"!==typeof e||e<0||e>=C||e%1)&&S.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}},5382:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="json-wallets/5.7.0"},1529:function(e,t,r){"use strict";r.r(t),r.d(t,{decryptCrowdsale:function(){return w},decryptJsonWallet:function(){return S},decryptJsonWalletSync:function(){return P},decryptKeystore:function(){return E.pe},decryptKeystoreSync:function(){return E.hb},encryptKeystore:function(){return E.HI},getJsonWalletAddress:function(){return x},isCrowdsaleWallet:function(){return k},isKeystoreWallet:function(){return A}});var n=r(5671),i=r(3144),o=r(136),a=r(9388),u=r(468),s=r.n(u),l=r(7419),c=r(9716),f=r(8062),h=r(2522),d=r(3374),p=r(520),v=r(9502),m=r(5382),g=r(8661),y=new v.Logger(m.i),b=function(e){(0,o.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,n.Z)(this,r),t.apply(this,arguments)}return(0,i.Z)(r,[{key:"isCrowdsaleAccount",value:function(e){return!(!e||!e._isCrowdsaleAccount)}}]),r}(p.Description);function w(e,t){var r=JSON.parse(e);t=(0,g.Ij)(t);var n=(0,l.getAddress)((0,g.gx)(r,"ethaddr")),i=(0,g.p3)((0,g.gx)(r,"encseed"));i&&i.length%16===0||y.throwArgumentError("invalid encseed","json",e);for(var o=(0,c.arrayify)((0,h.n)(t,t,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),u=i.slice(16),p=new(s().ModeOfOperation.cbc)(o,a),v=s().padding.pkcs7.strip((0,c.arrayify)(p.decrypt(u))),m="",w=0;wu[r]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n>4],r+=d[15&t[o]];i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch(l){i.push(e+"="+JSON.stringify(n[e].toString()))}})),i.push("code=".concat(r)),i.push("version=".concat(this.version));var o=t,u="";switch(r){case f.NUMERIC_FAULT:u="NUMERIC_FAULT";var s=t;switch(s){case"overflow":case"underflow":case"division-by-zero":u+="-"+s;break;case"negative-power":case"negative-width":u+="-unsupported";break;case"unbound-bitwise-result":u+="-unbound-result"}break;case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:u=r}u&&(t+=" [ See: https://links.ethers.org/v5-errors-"+u+" ]"),i.length&&(t+=" ("+i.join(", ")+")");var l=new Error(t);return l.reason=o,l.code=r,Object.keys(n).forEach((function(e){l[e]=n[e]})),l}},{key:"throwError",value:function(e,t,r){throw this.makeError(e,t,r)}},{key:"throwArgumentError",value:function(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(e,t,r,n){e||this.throwError(t,r,n)}},{key:"assertArgument",value:function(e,t,r,n){e||this.throwArgumentError(t,r,n)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),h&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:h})}},{key:"checkSafeUint53",value:function(t,r){"number"===typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,r,n){n=n?": "+n:"",tr&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}},{key:"checkNew",value:function(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}}],[{key:"globalLogger",value:function(){return l||(l=new e("logger/5.7.0")),l}},{key:"setCensorship",value:function(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!t,o=!!r}},{key:"setLogLevel",value:function(t){var r=u[t.toLowerCase()];null!=r?s=r:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();p.errors=f,p.levels=c},2522:function(e,t,r){"use strict";r.d(t,{n:function(){return o}});var n=r(9716),i=r(9598);function o(e,t,r,o,a){var u;e=(0,n.arrayify)(e),t=(0,n.arrayify)(t);var s,l,c=1,f=new Uint8Array(o),h=new Uint8Array(t.length+4);h.set(t);for(var d=1;d<=c;d++){h[t.length]=d>>24&255,h[t.length+1]=d>>16&255,h[t.length+2]=d>>8&255,h[t.length+3]=255&d;var p=(0,n.arrayify)((0,i.Gy)(a,e,h));u||(u=p.length,l=new Uint8Array(u),s=o-((c=Math.ceil(o/u))-1)*u),l.set(p);for(var v=1;v0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[z(e)]=!0}));var r=Object.keys(t);return r.sort(),r.join("|")}return z(e)})).join("&")}function K(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,A.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+q(e);if(n.Sg.isForkEvent(e))throw U.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+q(e.topics||[])}throw new Error("invalid event - "+e)}function H(){return(new Date).getTime()}function G(e){return new Promise((function(t){setTimeout(t,e)}))}var V=["block","network","pending","poll"],W=function(){function e(t,r,n){(0,g.Z)(this,e),(0,S.defineReadOnly)(this,"tag",t),(0,S.defineReadOnly)(this,"listener",r),(0,S.defineReadOnly)(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return(0,y.Z)(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":");if("filter"!==e[0])return null;var t,r=e[1],n=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[];var t=e.split("|").map((function(e){return"null"===e?null:e}));return 1===t.length?t[0]:t})),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||V.indexOf(this.tag)>=0}}]),e}(),J={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Q(e){return(0,A.hexZeroPad)(k.O$.from(e).toHexString(),32)}function Y(e){return w.Base58.encode((0,A.concat)([e,(0,A.hexDataSlice)((0,P.JQ)((0,P.JQ)(e)),0,4)]))}var X=new RegExp("^(ipfs)://(.*)$","i"),$=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),X,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ee(e,t){try{return(0,_.ZN)(te(e,t))}catch(r){}return null}function te(e,t){if("0x"===e)return null;var r=k.O$.from((0,A.hexDataSlice)(e,t,t+32)).toNumber(),n=k.O$.from((0,A.hexDataSlice)(e,r,r+32)).toNumber();return(0,A.hexDataSlice)(e,r+32,r+32+n)}function re(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):U.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function ne(e){var t=(0,A.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");var r=new Uint8Array(32);return r.set(t,32-t.length),r}function ie(e){if(e.length%32===0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function oe(e){for(var t=[],r=0,n=0;n=1&&a<=75)return Y((0,A.concat)([[r.p2pkh],"0x"+o[2]]))}}if(null!=r.p2sh){var u=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(u){var s=parseInt(u[1],16);if(u[2].length===2*s&&s>=1&&s<=75)return Y((0,A.concat)([[r.p2sh],"0x"+u[2]]))}}if(null!=r.prefix){var l=n[1],c=n[0];if(0===c?20!==l&&32!==l&&(c=-1):c=-1,c>=0&&n.length===2+l&&l>=1&&l<=75){var f=O().toWords(n.slice(2));return f.unshift(c),O().encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(e){return Z(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n,o;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16;break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(r=t.sent)&&r!==x.R){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(r));case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==i.Logger.errors.CALL_EXCEPTION){t.next=15;break}return t.abrupt("return",null);case 15:throw t.t0;case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",Q(e));case 18:if(null!=(n=t.sent)&&"0x"!==n){t.next=21;break}return t.abrupt("return",null);case 21:return null==(o=this._getAddress(e,n))&&U.throwError("invalid or unsupported coin data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:n}),t.abrupt("return",o);case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return Z(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,r,n,i,o,a,u,s,l,c,f,h,d,p,v,g;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar");case 4:if(null!=(r=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:n=0;case 8:if(!(n<$.length)){e.next=91;break}if(null!=(i=r.match($[n]))){e.next=12;break}return e.abrupt("continue",88);case 12:o=i[1].toLowerCase(),e.t0=o,e.next="https"===e.t0?16:"data"===e.t0?18:"ipfs"===e.t0?20:"erc721"===e.t0||"erc1155"===e.t0?22:88;break;case 16:return t.push({type:"url",content:r}),e.abrupt("return",{linkage:t,url:r});case 18:return t.push({type:"data",content:r}),e.abrupt("return",{linkage:t,url:r});case 20:return t.push({type:"ipfs",content:r}),e.abrupt("return",{linkage:t,url:re(r)});case 22:if(a="erc721"===o?"0xc87b56dd":"0x0e89341c",t.push({type:o,content:r}),e.t1=this._resolvedAddress,e.t1){e.next=29;break}return e.next=28,this.getAddress();case 28:e.t1=e.sent;case 29:if(u=e.t1,2===(s=(i[2]||"").split("/")).length){e.next=33;break}return e.abrupt("return",null);case 33:return e.next=35,this.provider.formatter.address(s[0]);case 35:if(l=e.sent,c=(0,A.hexZeroPad)(k.O$.from(s[1]).toHexString(),32),"erc721"!==o){e.next=48;break}return e.t2=this.provider.formatter,e.next=41,this.provider.call({to:l,data:(0,A.hexConcat)(["0x6352211e",c])});case 41:if(e.t3=e.sent,f=e.t2.callAddress.call(e.t2,e.t3),u===f){e.next=45;break}return e.abrupt("return",null);case 45:t.push({type:"owner",content:f}),e.next=57;break;case 48:if("erc1155"!==o){e.next=57;break}return e.t4=k.O$,e.next=52,this.provider.call({to:l,data:(0,A.hexConcat)(["0x00fdd58e",(0,A.hexZeroPad)(u,32),c])});case 52:if(e.t5=e.sent,!(h=e.t4.from.call(e.t4,e.t5)).isZero()){e.next=56;break}return e.abrupt("return",null);case 56:t.push({type:"balance",content:h.toString()});case 57:return d={to:this.provider.formatter.address(s[0]),data:(0,A.hexConcat)([a,c])},e.t6=ee,e.next=61,this.provider.call(d);case 61:if(e.t7=e.sent,null!=(p=(0,e.t6)(e.t7,0))){e.next=65;break}return e.abrupt("return",null);case 65:return t.push({type:"metadata-url-base",content:p}),"erc1155"===o&&(p=p.replace("{id}",c.substring(2)),t.push({type:"metadata-url-expanded",content:p})),p.match(/^ipfs:/i)&&(p=re(p)),t.push({type:"metadata-url",content:p}),e.next=71,(0,C.fetchJson)(p);case 71:if(v=e.sent){e.next=74;break}return e.abrupt("return",null);case 74:if(t.push({type:"metadata",content:JSON.stringify(v)}),"string"===typeof(g=v.image)){e.next=78;break}return e.abrupt("return",null);case 78:if(!g.match(/^(https:\/\/|data:)/i)){e.next=81;break}e.next=86;break;case 81:if(null!=g.match(X)){e.next=84;break}return e.abrupt("return",null);case 84:t.push({type:"url-ipfs",content:g}),g=re(g);case 86:return t.push({type:"url",content:g}),e.abrupt("return",{linkage:t,url:g});case 88:n++,e.next=8;break;case 91:e.next=95;break;case 93:e.prev=93,e.t8=e.catch(1);case 95:return e.abrupt("return",null);case 96:case"end":return e.stop()}}),e,this,[[1,93]])})))}},{key:"getContentHash",value:function(){return Z(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,r,n,o,a,u,s,l,c;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(t=e.sent)&&"0x"!==t){e.next=5;break}return e.abrupt("return",null);case 5:if(!(r=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){e.next=10;break}return e.abrupt("return","ipfs://"+w.Base58.encode("0x"+r[1]));case 10:if(!(o=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=15;break}if(a=parseInt(o[3],16),o[4].length!==2*a){e.next=15;break}return e.abrupt("return","ipns://"+w.Base58.encode("0x"+o[1]));case 15:if(!(u=t.match(/^0xe40101fa011b20([0-9a-f]*)$/))){e.next=19;break}if(64!==u[1].length){e.next=19;break}return e.abrupt("return","bzz://"+u[1]);case 19:if(!(s=t.match(/^0x90b2c605([0-9a-f]*)$/))){e.next=25;break}if(68!==s[1].length){e.next=25;break}return l={"=":"","+":"-","/":"_"},c=(0,b.c)("0x"+s[1]).replace(/[=+\/]/g,(function(e){return l[e]})),e.abrupt("return","sia://"+c);case 25:return e.abrupt("return",U.throwError("invalid or unsupported content hash data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t}));case 26:case"end":return e.stop()}}),e,this)})))}},{key:"getText",value:function(e){return Z(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(0,_.Y0)(e),(r=(0,A.concat)([Q(64),Q(r.length),r])).length%32!==0&&(r=(0,A.concat)([r,(0,A.hexZeroPad)("0x",32-e.length%32)])),t.next=5,this._fetchBytes("0x59d1d43c",(0,A.hexlify)(r));case 5:if(null!=(n=t.sent)&&"0x"!==n){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",(0,_.ZN)(n));case 9:case"end":return t.stop()}}),t,this)})))}}]),e}(),ue=null,se=1,le=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(e){var n;if((0,g.Z)(this,r),(n=t.call(this))._events=[],n._emitted={block:-2},n.disableCcipRead=!1,n.formatter=(this instanceof r?this.constructor:void 0).getFormatter(),(0,S.defineReadOnly)((0,d.Z)(n),"anyNetwork","any"===e),n.anyNetwork&&(e=n.detectNetwork()),e instanceof Promise)n._networkPromise=e,e.catch((function(e){})),n._ready().catch((function(e){}));else{var i=(0,S.getStatic)(this instanceof r?this.constructor:void 0,"getNetwork")(e);i?((0,S.defineReadOnly)((0,d.Z)(n),"_network",i),n.emit("network",i,null)):U.throwArgumentError("invalid network","network",e)}return n._maxInternalBlockNumber=-1024,n._lastBlockNumber=-2,n._maxFilterBlockRange=10,n._pollingInterval=4e3,n._fastQueryDate=0,n}return(0,y.Z)(r,[{key:"_ready",value:function(){return Z(this,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this._network){e.next=17;break}if(t=null,!this._networkPromise){e.next=11;break}return e.prev=3,e.next=6,this._networkPromise;case 6:t=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(null!=t){e.next=15;break}return e.next=14,this.detectNetwork();case 14:t=e.sent;case 15:t||U.throwError("no network detected",i.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,S.defineReadOnly)(this,"_network",t),this.emit("network",t,null));case 17:return e.abrupt("return",this._network);case 18:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"ready",get:function(){var e=this;return(0,C.poll)((function(){return e._ready().then((function(e){return e}),(function(e){if(e.code!==i.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}))}},{key:"ccipReadFetch",value:function(e,t,r){return Z(this,void 0,void 0,(0,m.Z)().mark((function n(){var o,a,u,s,l,c,f,h,d;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.disableCcipRead&&0!==r.length){n.next=2;break}return n.abrupt("return",null);case 2:o=e.to.toLowerCase(),a=t.toLowerCase(),u=[],s=0;case 6:if(!(s=0?null:JSON.stringify({data:a,sender:o}),n.next=12,(0,C.fetchJson)({url:c,errorPassThrough:!0},f,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(h=n.sent).data){n.next=15;break}return n.abrupt("return",h.data);case 15:if(d=h.message||"unknown error",!(h.status>=400&&h.status<500)){n.next=18;break}return n.abrupt("return",U.throwError("response not found during CCIP fetch: ".concat(d),i.Logger.errors.SERVER_ERROR,{url:l,errorMessage:d}));case 18:u.push(d);case 19:s++,n.next=6;break;case 22:return n.abrupt("return",U.throwError("error encountered during CCIP fetch: ".concat(u.map((function(e){return JSON.stringify(e)})).join(", ")),i.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:u}));case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return Z(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n,i,o,a=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:if(!(e>0)){t.next=20;break}case 3:if(!this._internalBlockNumber){t.next=20;break}return r=this._internalBlockNumber,t.prev=5,t.next=8,r;case 8:if(n=t.sent,!(H()-n.respTime<=e)){t.next=11;break}return t.abrupt("return",n.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==r){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return i=H(),o=(0,S.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,r=e.networkError;if(r)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),r;var n=H();return(t=k.O$.from(t).toNumber())1e3)U.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",U.makeError("network block skew detected",i.Logger.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(o=this._emitted.block+1;o<=n;o++)this.emit("block",o);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=a._emitted[e];"pending"!==t&&n-t>12&&delete a._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=a.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(a._emitted["t:"+t]=e.blockNumber,a.emit(t,e),null):null})).catch((function(e){a.emit("error",e)}));r.push(i);break;case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);var o=e.filter;o.fromBlock=e._lastBlockNumber+1,o.toBlock=n;var u=o.toBlock-a._maxFilterBlockRange;u>o.fromBlock&&(o.fromBlock=u),o.fromBlock<0&&(o.fromBlock=0);var s=a.getLogs(o).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),a._emitted["b:"+t.blockHash]=t.blockNumber,a._emitted["t:"+t.transactionHash]=t.blockNumber,a.emit(o,t)}))})).catch((function(t){a.emit("error",t),e._inflight=!1}));r.push(s)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){a.emit("didPoll",t)})).catch((function(e){a.emit("error",e)})),e.abrupt("return");case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return Z(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",U.throwError("provider does not support network detection",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return Z(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,r,n;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:return t=e.sent,e.next=5,this.detectNetwork();case 5:if(r=e.sent,t.chainId===r.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,t),e.next=19,G(0);case 19:return e.abrupt("return",this._network);case 20:throw n=U.makeError("underlying network changed",i.Logger.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:r}),this.emit("error",n),n;case 23:return e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this;if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=H();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,r){return Z(this,void 0,void 0,(0,m.Z)().mark((function n(){return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(e,null==t?1:t,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(e,t,r,n){return Z(this,void 0,void 0,(0,m.Z)().mark((function o(){var a,u=this;return(0,m.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getTransactionReceipt(e);case 2:if(!(((a=o.sent)?a.confirmations:0)>=t)){o.next=5;break}return o.abrupt("return",a);case 5:return o.abrupt("return",new Promise((function(o,a){var s=[],l=!1,c=function(){return!!l||(l=!0,s.forEach((function(e){e()})),!1)},f=function(e){e.confirmations0){var v=setTimeout((function(){c()||a(U.makeError("timeout exceeded",i.Logger.errors.TIMEOUT,{timeout:r}))}),r);v.unref&&v.unref(),s.push((function(){clearTimeout(v)}))}})));case 6:case"end":return o.stop()}}),o,this)})))}},{key:"getBlockNumber",value:function(){return Z(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return Z(this,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,this.perform("getGasPrice",{});case 4:return t=e.sent,e.prev=5,e.abrupt("return",k.O$.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",U.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0}));case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return Z(this,void 0,void 0,(0,m.Z)().mark((function r(){var n,o;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,(0,S.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return o=r.sent,r.prev=8,r.abrupt("return",k.O$.from(o));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",U.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getBalance",params:n,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return Z(this,void 0,void 0,(0,m.Z)().mark((function r(){var n,o;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,(0,S.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return o=r.sent,r.prev=8,r.abrupt("return",k.O$.from(o).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",U.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return Z(this,void 0,void 0,(0,m.Z)().mark((function r(){var n,o;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,(0,S.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return o=r.sent,r.prev=8,r.abrupt("return",(0,A.hexlify)(o));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",U.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getCode",params:n,result:o,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,r){return Z(this,void 0,void 0,(0,m.Z)().mark((function n(){var o,a;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,S.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((function(e){return(0,A.hexValue)(e)}))});case 4:return o=n.sent,n.next=7,this.perform("getStorageAt",o);case 7:return a=n.sent,n.prev=8,n.abrupt("return",(0,A.hexlify)(a));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",U.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:o,result:a,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,r){var n=this;if(null!=t&&32!==(0,A.hexDataLength)(t))throw new Error("invalid response - sendTransaction");var o=e;return null!=t&&e.hash!==t&&U.throwError("Transaction hash mismatch from Provider.sendTransaction.",i.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),o.wait=function(t,o){return Z(n,void 0,void 0,(0,m.Z)().mark((function n(){var a,u;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t=1),null==o&&(o=0),a=void 0,0!==t&&null!=r&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r}),n.next=6,this._waitForTransaction(e.hash,t,o,a);case 6:if(null!=(u=n.sent)||0!==t){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=u.blockNumber,0===u.status&&U.throwError("transaction failed",i.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:u}),n.abrupt("return",u);case 12:case"end":return n.stop()}}),n,this)})))},o}},{key:"sendTransaction",value:function(e){return Z(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n,i,o;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Promise.resolve(e).then((function(e){return(0,A.hexlify)(e)}));case 4:return r=t.sent,null==(n=this.formatter.transaction(e)).confirmations&&(n.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return i=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:r});case 13:return o=t.sent,t.abrupt("return",this._wrapTransaction(n,o,i));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=n,t.t0.transactionHash=n.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return Z(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n,i=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return r=t.sent,n={},["from","to"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?k.O$.from(e):null})))})),["type"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return null!=e?e:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?(0,A.hexlify)(e):null})))})),t.t0=this.formatter,t.next=12,(0,S.resolveProperties)(n);case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return Z(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,r={},null!=e.address&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(r[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(r[t]=n._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,(0,S.resolveProperties)(r);case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,r){return Z(this,void 0,void 0,(0,m.Z)().mark((function n(){var o,a,u,s,l,c,f,h,d,p,v,g,y,b,w;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&U.throwError("CCIP read exceeded maximum redirections",i.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e}),o=e.to,n.next=4,this.perform("call",{transaction:e,blockTag:t});case 4:if(a=n.sent,!(r>=0&&"latest"===t&&null!=o&&"0x556f1830"===a.substring(0,10)&&(0,A.hexDataLength)(a)%32===4)){n.next=31;break}for(n.prev=6,u=(0,A.hexDataSlice)(a,4),s=(0,A.hexDataSlice)(u,0,32),k.O$.from(s).eq(o)||U.throwError("CCIP Read sender did not match",i.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:a}),l=[],c=k.O$.from((0,A.hexDataSlice)(u,32,64)).toNumber(),f=k.O$.from((0,A.hexDataSlice)(u,c,c+32)).toNumber(),h=(0,A.hexDataSlice)(u,c+32),d=0;dthis._emitted.block)){e.next=10;break}return e.abrupt("return",null);case 10:return e.abrupt("return",void 0);case 11:if(!t){e.next=34;break}o=null,a=0;case 14:if(!(a0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,r){var n=new W(K(e),t,r);return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i=0&&u.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&me.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function we(e){return new Promise((function(t){setTimeout(t,e)}))}function ke(e){if(e.error){var t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Ae(e){return e?e.toLowerCase():e}var xe={},Ee=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(e,n,i){var o;if((0,g.Z)(this,r),o=t.call(this),e!==xe)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return(0,S.defineReadOnly)((0,d.Z)(o),"provider",n),null==i&&(i=0),"string"===typeof i?((0,S.defineReadOnly)((0,d.Z)(o),"_address",o.provider.formatter.address(i)),(0,S.defineReadOnly)((0,d.Z)(o),"_index",null)):"number"===typeof i?((0,S.defineReadOnly)((0,d.Z)(o),"_index",i),(0,S.defineReadOnly)((0,d.Z)(o),"_address",null)):me.throwArgumentError("invalid address or index","addressOrIndex",i),o}return(0,y.Z)(r,[{key:"connect",value:function(e){return me.throwError("cannot alter JSON-RPC Signer connection",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new Se(xe,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&me.throwError("unknown account #"+e._index,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=(0,S.shallowCopy)(e);var r=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var n=(0,S.shallowCopy)(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return ve(t,void 0,void 0,(0,m.Z)().mark((function t(){var r;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.provider.resolveName(e);case 4:return null==(r=t.sent)&&me.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))}))),(0,S.resolveProperties)({tx:(0,S.resolveProperties)(e),sender:r}).then((function(r){var n=r.tx,o=r.sender;null!=n.from?n.from.toLowerCase()!==o&&me.throwArgumentError("from address mismatch","transaction",e):n.from=o;var a=t.provider.constructor.hexlifyTransaction(n,{from:!0});return t.provider.send("eth_sendTransaction",[a]).then((function(e){return e}),(function(e){return"string"===typeof e.message&&e.message.match(/user denied/i)&&me.throwError("user rejected transaction",i.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),be("sendTransaction",e,a)}))}))}},{key:"signTransaction",value:function(e){return me.throwError("signing transactions is unsupported",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return ve(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n,i=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return r=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return n=t.sent,t.prev=6,t.next=9,(0,C.poll)((function(){return ve(i,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(n);case 2:if(null!==(t=e.sent)){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.abrupt("return",this.provider._wrapTransaction(t,n,r));case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider});case 9:return t.abrupt("return",t.sent);case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=n,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return ve(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"===typeof e?(0,_.Y0)(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[(0,A.hexlify)(r),n.toLowerCase()]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&me.throwError("user rejected signing",i.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(e){return ve(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"===typeof e?(0,_.Y0)(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("eth_sign",[n.toLowerCase(),(0,A.hexlify)(r)]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&me.throwError("user rejected signing",i.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_signTypedData",value:function(e,t,r){return ve(this,void 0,void 0,(0,m.Z)().mark((function n(){var o,a,u=this;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,pe.E.resolveNames(e,t,r,(function(e){return u.provider.resolveName(e)}));case 2:return o=n.sent,n.next=5,this.getAddress();case 5:return a=n.sent,n.prev=6,n.next=9,this.provider.send("eth_signTypedData_v4",[a.toLowerCase(),JSON.stringify(pe.E.getPayload(o.domain,t,o.value))]);case 9:return n.abrupt("return",n.sent);case 12:throw n.prev=12,n.t0=n.catch(6),"string"===typeof n.t0.message&&n.t0.message.match(/user denied/i)&&me.throwError("user rejected signing",i.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:a,messageData:{domain:o.domain,types:t,value:o.value}}),n.t0;case 16:case"end":return n.stop()}}),n,this,[[6,12]])})))}},{key:"unlock",value:function(e){return ve(this,void 0,void 0,(0,m.Z)().mark((function t(){var r,n;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.provider,t.next=3,this.getAddress();case 3:return n=t.sent,t.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),r}(de.E),Se=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(){return(0,g.Z)(this,r),t.apply(this,arguments)}return(0,y.Z)(r,[{key:"sendTransaction",value:function(e){var t=this;return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return t.provider.waitForTransaction(e,r)}}}))}}]),r}(Ee),Pe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},_e=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(e,n){var i;(0,g.Z)(this,r);var o=n;return null==o&&(o=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,o),e||(e=(0,S.getStatic)(i.constructor,"defaultUrl")()),"string"===typeof e?(0,S.defineReadOnly)((0,d.Z)(i),"connection",Object.freeze({url:e})):(0,S.defineReadOnly)((0,d.Z)(i),"connection",Object.freeze((0,S.shallowCopy)(e))),i._nextId=42,i}return(0,y.Z)(r,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return ve(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,r;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,we(0);case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]);case 6:t=e.sent,e.next=19;break;case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]);case 14:t=e.sent,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(11);case 19:if(null==t){e.next=28;break}return r=(0,S.getStatic)(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",r(k.O$.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",me.throwError("could not detect network",i.Logger.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",me.throwError("could not detect network",i.Logger.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new Ee(xe,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this;return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,S.deepCopy)(n),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];var o=(0,C.fetchJson)(this.connection,JSON.stringify(n),ke).then((function(e){return r.emit("debug",{action:"response",request:n,response:e,provider:r}),e}),(function(e){throw r.emit("debug",{action:"response",error:e,request:n,provider:r}),e}));return i&&(this._cache[e]=o,setTimeout((function(){r._cache[e]=null}),0)),o}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Ae(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Ae(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Ae(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Ae(t.address),(0,A.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,S.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,S.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Ae(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return ve(this,void 0,void 0,(0,m.Z)().mark((function r(){var n,o,a;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==e&&"estimateGas"!==e){r.next=8;break}if(!(n=t.transaction)||null==n.type||!k.O$.from(n.type).isZero()){r.next=8;break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8;break}return r.next=6,this.getFeeData();case 6:null==(o=r.sent).maxFeePerGas&&null==o.maxPriorityFeePerGas&&((t=(0,S.shallowCopy)(t)).transaction=(0,S.shallowCopy)(n),delete t.transaction.type);case 8:return null==(a=this.prepareRequest(e,t))&&me.throwError(e+" not implemented",i.Logger.errors.NOT_IMPLEMENTED,{operation:e}),r.prev=10,r.next=13,this.send(a[0],a[1]);case 13:return r.abrupt("return",r.sent);case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",be(e,r.t0,t));case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),(0,fe.Z)((0,he.Z)(r.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;var n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return we(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((function(e){}))}(),r})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),(0,fe.Z)((0,he.Z)(r.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var r=(0,S.shallowCopy)(Pe);if(t)for(var n in t)t[n]&&(r[n]=!0);(0,S.checkProperties)(e,r);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var r=(0,A.hexValue)(k.O$.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=(0,A.hexlify)(e[t]))})),e.accessList&&(i.accessList=(0,R.accessListify)(e.accessList)),i}}]),r}(le),Ce=null;try{if(null==(Ce=WebSocket))throw new Error("inject please")}catch(Dt){var Ne=new i.Logger(T);Ce=function(){Ne.throwError("WebSockets not supported in this environment",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Oe=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(t){o(t)}}function u(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))},Te=new i.Logger(T),Me=1,Re=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(e,n){var o,a;(0,g.Z)(this,r),"any"===n&&Te.throwError("WebSocketProvider does not support 'any' network yet",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(a="string"===typeof e?t.call(this,e,n):t.call(this,"_websocket",n))._pollingInterval=-1,a._wsReady=!1,"string"===typeof e?(0,S.defineReadOnly)((0,d.Z)(a),"_websocket",new Ce(a.connection.url)):(0,S.defineReadOnly)((0,d.Z)(a),"_websocket",e),(0,S.defineReadOnly)((0,d.Z)(a),"_requests",{}),(0,S.defineReadOnly)((0,d.Z)(a),"_subs",{}),(0,S.defineReadOnly)((0,d.Z)(a),"_subIds",{}),(0,S.defineReadOnly)((0,d.Z)(a),"_detectNetwork",(0,fe.Z)((o=(0,d.Z)(a),(0,he.Z)(r.prototype)),"detectNetwork",o).call(o)),a.websocket.onopen=function(){a._wsReady=!0,Object.keys(a._requests).forEach((function(e){a.websocket.send(a._requests[e].payload)}))},a.websocket.onmessage=function(e){var t=e.data,r=JSON.parse(t);if(null!=r.id){var n=String(r.id),i=a._requests[n];if(delete a._requests[n],void 0!==r.result)i.callback(null,r.result),a.emit("debug",{action:"response",request:JSON.parse(i.payload),response:r.result,provider:(0,d.Z)(a)});else{var o=null;r.error?(o=new Error(r.error.message||"unknown error"),(0,S.defineReadOnly)(o,"code",r.error.code||null),(0,S.defineReadOnly)(o,"response",t)):o=new Error("unknown error"),i.callback(o,void 0),a.emit("debug",{action:"response",error:o,request:JSON.parse(i.payload),provider:(0,d.Z)(a)})}}else if("eth_subscription"===r.method){var u=a._subs[r.params.subscription];u&&u.processFunc(r.params.result)}else console.warn("this should not happen")};var u=setInterval((function(){a.emit("poll")}),1e3);return u.unref&&u.unref(),(0,ce.Z)(a)}return(0,y.Z)(r,[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){Te.throwError("cannot set polling interval on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){Te.throwError("cannot reset events block on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return Oe(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})))}},{key:"polling",set:function(e){e&&Te.throwError("cannot set polling on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var r=this,n=Me++;return new Promise((function(i,o){var a=JSON.stringify({method:e,params:t,id:n,jsonrpc:"2.0"});r.emit("debug",{action:"request",request:JSON.parse(a),provider:r}),r._requests[String(n)]={callback:function(e,t){return e?o(e):i(t)},payload:a},r._wsReady&&r.websocket.send(a)}))}},{key:"_subscribe",value:function(e,t,r){return Oe(this,void 0,void 0,(0,m.Z)().mark((function n(){var i,o,a=this;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==(i=this._subIds[e])&&(i=Promise.all(t).then((function(e){return a.send("eth_subscribe",e)})),this._subIds[e]=i),n.next=4,i;case 4:o=n.sent,this._subs[o]={tag:e,processFunc:r};case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_startEvent",value:function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],(function(e){var r=k.O$.from(e.number).toNumber();t._emitted.block=r,t.emit("block",r)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(e){t.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(function(r){null==r.removed&&(r.removed=!1),t.emit(e.filter,t.formatter.filterLog(r))}));break;case"tx":var r=function(e){var r=e.hash;t.getTransactionReceipt(r).then((function(e){e&&t.emit(r,e)}))};r(e),this._subscribe("tx",["newHeads"],(function(e){t._events.filter((function(e){return"tx"===e.type})).forEach(r)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}},{key:"_stopEvent",value:function(e){var t=this,r=e.tag;if("tx"===e.type){if(this._events.filter((function(e){return"tx"===e.type})).length)return;r="tx"}else if(this.listenerCount(e.event))return;var n=this._subIds[r];n&&(delete this._subIds[r],n.then((function(e){t._subs[e]&&(delete t._subs[e],t.send("eth_unsubscribe",[e]))})))}},{key:"destroy",value:function(){return Oe(this,void 0,void 0,(0,m.Z)().mark((function e(){var t=this;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.websocket.readyState!==Ce.CONNECTING){e.next=3;break}return e.next=3,new Promise((function(e){t.websocket.onopen=function(){e(!0)},t.websocket.onerror=function(){e(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return e.stop()}}),e,this)})))}}],[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}]),r}(_e),Ie=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(t){o(t)}}function u(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))},Le=new i.Logger(T),De=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(){return(0,g.Z)(this,r),t.apply(this,arguments)}return(0,y.Z)(r,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return(0,fe.Z)((0,he.Z)(r.prototype),"detectNetwork",e)}}});return Ie(this,void 0,void 0,(0,m.Z)().mark((function e(){var r;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=this.network)){e.next=7;break}return e.next=4,t.detectNetwork.call(this);case 4:(r=e.sent)||Le.throwError("no network detected",i.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,S.defineReadOnly)(this,"_network",r),this.emit("network",r,null));case 7:return e.abrupt("return",r);case 8:case"end":return e.stop()}}),e,this)})))}}]),r}(_e),Be=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(e,n){var i;(0,g.Z)(this,r),Le.checkAbstract(this instanceof r?this.constructor:void 0,r),e=(0,S.getStatic)(this instanceof r?this.constructor:void 0,"getNetwork")(e),n=(0,S.getStatic)(this instanceof r?this.constructor:void 0,"getApiKey")(n);var o=(0,S.getStatic)(this instanceof r?this.constructor:void 0,"getUrl")(e,n);return i=t.call(this,o,e),"string"===typeof n?(0,S.defineReadOnly)((0,d.Z)(i),"apiKey",n):null!=n&&Object.keys(n).forEach((function(e){(0,S.defineReadOnly)((0,d.Z)(i),e,n[e])})),i}return(0,y.Z)(r,[{key:"_startPending",value:function(){Le.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return Le.throwError("API provider does not support signing",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(e){return e}},{key:"getUrl",value:function(e,t){return Le.throwError("not implemented; sub-classes must override getUrl",i.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),r}(De),Fe=new i.Logger(T),je="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",Ze=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(e,n){var i;(0,g.Z)(this,r);var o=new Ue(e,n),a=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return i=t.call(this,a,o.network),(0,S.defineReadOnly)((0,d.Z)(i),"apiKey",o.apiKey),i}return(0,y.Z)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===je}}]),r}(Re),Ue=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(){return(0,g.Z)(this,r),t.apply(this,arguments)}return(0,y.Z)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===je}}],[{key:"getWebSocketProvider",value:function(e,t){return new Ze(e,t)}},{key:"getApiKey",value:function(e){return null==e?je:(e&&"string"!==typeof e&&Fe.throwArgumentError("invalid apiKey","apiKey",e),e)}},{key:"getUrl",value:function(e,t){var r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:Fe.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:function(e,r){return t===je&&j(),Promise.resolve(!0)}}}}]),r}(Be),ze=new i.Logger(T),qe="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Ke(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return ze.throwArgumentError("unsupported network","name",e)}var He=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(){return(0,g.Z)(this,r),t.apply(this,arguments)}return(0,y.Z)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===qe}}],[{key:"getApiKey",value:function(e){return null==e?qe:e}},{key:"getUrl",value:function(e,t){null==t&&(t=qe);var r={allowGzip:!0,url:"https://"+Ke(e.name)+t,throttleCallback:function(e,r){return t.apiKey===qe&&j(),Promise.resolve(!0)}};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}]),r}(Be),Ge=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(t){o(t)}}function u(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))},Ve=new i.Logger(T),We=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(){return(0,g.Z)(this,r),t.apply(this,arguments)}return(0,y.Z)(r,[{key:"perform",value:function(e,t){var n=this,i=Object.create(null,{perform:{get:function(){return(0,fe.Z)((0,he.Z)(r.prototype),"perform",n)}}});return Ge(this,void 0,void 0,(0,m.Z)().mark((function r(){var n;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("getBlockNumber"!==e){r.next=5;break}return r.next=3,i.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return n=r.sent,r.abrupt("return",n.number);case 5:return r.abrupt("return",i.perform.call(this,e,t));case 6:case"end":return r.stop()}}),r,this)})))}}],[{key:"getApiKey",value:function(e){return null!=e&&Ve.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var r=null;if("homestead"===e.name)r="https://cloudflare-eth.com/";else Ve.throwArgumentError("unsupported network","network",arguments[0]);return r}}]),r}(Be),Je=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(t){o(t)}}function u(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))},Qe=new i.Logger(T);function Ye(e){var t={};for(var r in e)if(null!=e[r]){var n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,A.hexValue)((0,A.hexlify)(n)):"accessList"===r?"["+(0,R.accessListify)(n).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":(0,A.hexlify)(n),t[r]=n)}return t}function Xe(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!==typeof e.message||!e.message.match(/^OK/)){var t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function $e(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var r=new Error("invalid response");throw r.result=JSON.stringify(e),r}if(e.error){var n=new Error(e.error.message||"unknown error");throw e.error.code&&(n.code=e.error.code),e.error.data&&(n.data=e.error.data),n}return e.result}function et(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function tt(e,t,r){if("call"===e&&t.code===i.Logger.errors.SERVER_ERROR){var n=t.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var o=n.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),(0,A.isHexString)(o))return o;Qe.throwError("missing revert data in call exception",i.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var a=t.message;throw t.code===i.Logger.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?a=t.error.message:"string"===typeof t.body?a=t.body:"string"===typeof t.responseText&&(a=t.responseText)),(a=(a||"").toLowerCase()).match(/insufficient funds/)&&Qe.throwError("insufficient funds for intrinsic transaction cost",i.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),a.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Qe.throwError("nonce has already been used",i.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),a.match(/another transaction with same nonce/)&&Qe.throwError("replacement fee too low",i.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),a.match(/execution failed due to an exception|execution reverted/)&&Qe.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}var rt=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(e,n){var i;return(0,g.Z)(this,r),i=t.call(this,e),(0,S.defineReadOnly)((0,d.Z)(i),"baseUrl",i.getBaseUrl()),(0,S.defineReadOnly)((0,d.Z)(i),"apiKey",n||null),i}return(0,y.Z)(r,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return Qe.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(e,t){var r=Object.keys(t).reduce((function(e,r){var n=t[r];return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,r){return Je(this,void 0,void 0,(0,m.Z)().mark((function n(){var i,o,a,u,s,l,c=this;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r?this.getPostUrl():this.getUrl(e,t),o=r?this.getPostData(e,t):null,a="proxy"===e?$e:Xe,this.emit("debug",{action:"request",request:i,provider:this}),u={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return c.isCommunityResource()&&j(),Promise.resolve(!0)}},s=null,o&&(u.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(o).map((function(e){return"".concat(e,"=").concat(o[e])})).join("&")),n.next=9,(0,C.fetchJson)(u,s,a||$e);case 9:return l=n.sent,this.emit("debug",{action:"response",request:i,response:(0,S.deepCopy)(l),provider:this}),n.abrupt("return",l);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return Je(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network);case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var n=this,o=Object.create(null,{perform:{get:function(){return(0,fe.Z)((0,he.Z)(r.prototype),"perform",n)}}});return Je(this,void 0,void 0,(0,m.Z)().mark((function r(){var n,a,u,s,l,c,f,h,d;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=e,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72;break;case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return tt("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){r.next=12;break}return r.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){r.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(n=Ye(t.transaction)).module="proxy",n.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",n,!0);case 23:return r.abrupt("return",r.sent);case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",tt("call",r.t1,t.transaction));case 29:return(a=Ye(t.transaction)).module="proxy",a.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",a,!0);case 35:return r.abrupt("return",r.sent);case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",tt("estimateGas",r.t2,t.transaction));case 41:return u={action:"getLogs"},t.filter.fromBlock&&(u.fromBlock=et(t.filter.fromBlock)),t.filter.toBlock&&(u.toBlock=et(t.filter.toBlock)),t.filter.address&&(u.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Qe.throwError("unsupported topic count",i.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"===typeof(s=t.filter.topics[0])&&66===s.length||Qe.throwError("unsupported topic format",i.Logger.errors.UNSUPPORTED_OPERATION,{topic0:s}),u.topic0=s)),r.next=48,this.fetch("logs",u);case 48:l=r.sent,c={},f=0;case 51:if(!(ft?null:(n+i)/2}function lt(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(k.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return lt(e)})));if("object"===typeof e){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var r=e[t];return r="function"===typeof r?"[function]":lt(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var ct=1;function ft(e){var t=null,r=null,n=new Promise((function(n){t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:function(e){return n=n.then(e)}}}var ht=[i.Logger.errors.CALL_EXCEPTION,i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED,i.Logger.errors.UNPREDICTABLE_GAS_LIMIT],dt=["address","args","errorArgs","errorSignature","method","transaction"];function pt(e,t){var r={weight:e.weight};return Object.defineProperty(r,"provider",{get:function(){return e.provider}}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function vt(e,t,r){var n=lt;switch(t){case"getBlockNumber":return function(t){var r=t.map((function(e){return e.result})),n=st(t.map((function(e){return e.result})),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){var t=e.map((function(e){return e.result}));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return st(e.map((function(e){return e.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=(0,S.shallowCopy)(e)).confirmations=-1,lt(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=(0,S.shallowCopy)(e)).transactions=e.transactions.map((function(e){return(e=(0,S.shallowCopy)(e)).confirmations=-1,e})),lt(e))}:function(e){return null==e?null:lt(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){var n={};r.forEach((function(t){var r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));for(var i=Object.keys(n),o=0;o=t)return a.result}}}(n,e.quorum)}function mt(e,t){return it(this,void 0,void 0,(0,m.Z)().mark((function r(){var n;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=e.provider).blockNumber&&n.blockNumber>=t||-1===t)){r.next=3;break}return r.abrupt("return",n);case 3:return r.abrupt("return",(0,C.poll)((function(){return new Promise((function(r,i){setTimeout((function(){return n.blockNumber>=t?r(n):e.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n}));case 4:case"end":return r.stop()}}),r)})))}function gt(e,t,r,n){return it(this,void 0,void 0,(0,m.Z)().mark((function o(){var a,u;return(0,m.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:a=e.provider,o.t0=r,o.next="getBlockNumber"===o.t0||"getGasPrice"===o.t0?4:"getEtherPrice"===o.t0?5:"getBalance"===o.t0||"getTransactionCount"===o.t0||"getCode"===o.t0?8:"getStorageAt"===o.t0?13:"getBlock"===o.t0?18:"call"===o.t0||"estimateGas"===o.t0?23:"getTransaction"===o.t0||"getTransactionReceipt"===o.t0?30:"getLogs"===o.t0?31:37;break;case 4:return o.abrupt("return",a[r]());case 5:if(!a.getEtherPrice){o.next=7;break}return o.abrupt("return",a.getEtherPrice());case 7:return o.abrupt("break",37);case 8:if(!n.blockTag||!(0,A.isHexString)(n.blockTag)){o.next=12;break}return o.next=11,mt(e,t);case 11:a=o.sent;case 12:return o.abrupt("return",a[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!(0,A.isHexString)(n.blockTag)){o.next=17;break}return o.next=16,mt(e,t);case 16:a=o.sent;case 17:return o.abrupt("return",a.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!(0,A.isHexString)(n.blockTag)){o.next=22;break}return o.next=21,mt(e,t);case 21:a=o.sent;case 22:return o.abrupt("return",a[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!(0,A.isHexString)(n.blockTag)){o.next=27;break}return o.next=26,mt(e,t);case 26:a=o.sent;case 27:if("call"!==r||!n.blockTag){o.next=29;break}return o.abrupt("return",a[r](n.transaction,n.blockTag));case 29:return o.abrupt("return",a[r](n.transaction));case 30:return o.abrupt("return",a[r](n.transactionHash));case 31:if(!((u=n.filter).fromBlock&&(0,A.isHexString)(u.fromBlock)||u.toBlock&&(0,A.isHexString)(u.toBlock))){o.next=36;break}return o.next=35,mt(e,t);case 35:a=o.sent;case 36:return o.abrupt("return",a.getLogs(u));case 37:return o.abrupt("return",ot.throwError("unknown method error",i.Logger.errors.UNKNOWN_ERROR,{method:r,params:n}));case 38:case"end":return o.stop()}}),o)})))}var yt=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(e,i){var o;(0,g.Z)(this,r),0===e.length&&ot.throwArgumentError("missing providers","providers",e);var a=e.map((function(e,t){if(n.zt.isProvider(e)){var r=B(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}var i=(0,S.shallowCopy)(e);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=B(e)?2e3:750),null==i.weight&&(i.weight=1);var o=i.weight;return(o%1||o>512||o<1)&&ot.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),o),Object.freeze(i)})),u=a.reduce((function(e,t){return e+t.weight}),0);null==i?i=u/2:i>u&&ot.throwArgumentError("quorum will always fail; larger than total weight","quorum",i);var s=ut(a.map((function(e){return e.provider.network})));return null==s&&(s=new Promise((function(e,t){setTimeout((function(){o.detectNetwork().then(e,t)}),0)}))),o=t.call(this,s),(0,S.defineReadOnly)((0,d.Z)(o),"providerConfigs",Object.freeze(a)),(0,S.defineReadOnly)((0,d.Z)(o),"quorum",i),o._highestBlockNumber=-1,o}return(0,y.Z)(r,[{key:"detectNetwork",value:function(){return it(this,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",ut(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return it(this,void 0,void 0,(0,m.Z)().mark((function r(){var n,o,a,u,s,l,c,f,h,d,p=this;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==e){r.next=13;break}return r.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))})));case 3:n=r.sent,o=0;case 5:if(!(o=p.quorum)){r.next=22;break}if(void 0===(d=u(h))){r.next=18;break}return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",{v:d});case 18:if(f){r.next=21;break}return r.next=21,ft(100).getPromise();case 21:f=!1;case 22:if(v=s.reduce((function(e,t){if(!t.done||null==t.error)return e;var r=t.error.code;return ht.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{}),Object.keys(v).forEach((function(e){var t=v[e];if(!(t.weight1024||e%1||e!=e)&&o.throwArgumentError("invalid length","length",e);var t=new Uint8Array(e);return u.getRandomValues(t),(0,n.arrayify)(t)}u&&u.getRandomValues||(o.warn("WARNING: Missing strong random number source"),u={getRandomValues:function(e){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},2282:function(e,t,r){"use strict";function n(e){for(var t=(e=e.slice()).length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}r.d(t,{y:function(){return n}})},7986:function(e,t,r){"use strict";r.r(t),r.d(t,{decode:function(){return h},encode:function(){return l}});var n=r(9716),i=r(9502),o=new i.Logger("rlp/5.7.0");function a(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function u(e,t,r){for(var n=0,i=0;it+1+n&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:a}}function f(e,t){if(0===e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});var a=u(e,t+1,r);return t+1+r+a>e.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),c(e,t,t+1+r,r+a)}if(e[t]>=192){var s=e[t]-192;return t+1+s>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),c(e,t,t+1,s)}if(e[t]>=184){var l=e[t]-183;t+1+l>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});var f=u(e,t+1,l);return t+1+l+f>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+l+f,result:(0,n.hexlify)(e.slice(t+1+l,t+1+l+f))}}if(e[t]>=128){var h=e[t]-128;return t+1+h>e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+h,result:(0,n.hexlify)(e.slice(t+1,t+1+h))}}return{consumed:1,result:(0,n.hexlify)(e[t])}}function h(e){var t=(0,n.arrayify)(e),r=f(t,0);return r.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),r.result}},6620:function(e,t,r){"use strict";r.r(t),r.d(t,{SupportedAlgorithm:function(){return i.p},computeHmac:function(){return n.Gy},ripemd160:function(){return n.bP},sha256:function(){return n.JQ},sha512:function(){return n.o}});var n=r(9598),i=r(4667)},9598:function(e,t,r){"use strict";r.d(t,{Gy:function(){return h},bP:function(){return l},JQ:function(){return c},o:function(){return f}});var n=r(3125),i=r.n(n),o=r(9716),a=r(4667),u=r(9502),s=new u.Logger("sha2/5.7.0");function l(e){return"0x"+i().ripemd160().update((0,o.arrayify)(e)).digest("hex")}function c(e){return"0x"+i().sha256().update((0,o.arrayify)(e)).digest("hex")}function f(e){return"0x"+i().sha512().update((0,o.arrayify)(e)).digest("hex")}function h(e,t,r){return a.p[e]||s.throwError("unsupported algorithm "+e,u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+i().hmac(i()[e],(0,o.arrayify)(t)).update((0,o.arrayify)(r)).digest("hex")}},4667:function(e,t,r){"use strict";var n;r.d(t,{p:function(){return n}}),function(e){e.sha256="sha256",e.sha512="sha512"}(n||(n={}))},8865:function(e,t,r){"use strict";r.r(t),r.d(t,{SigningKey:function(){return Q},computePublicKey:function(){return X},recoverPublicKey:function(){return Y}});var n=r(5671),i=r(3144),o=r(518),a=r.n(o),u=r(3125),s=r.n(u);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:"undefined"!==typeof self&&self;function l(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&r.path)}},e(r,r.exports),r.exports}var c=f;function f(e,t){if(!e)throw new Error(t||"Assertion failed")}f.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var h=l((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),d=l((function(e,t){var r=t;r.assert=c,r.toArray=h.toArray,r.zero2=h.zero2,r.toHex=h.toHex,r.encode=h.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-s:s,o.isubn(u)):u=0,n[a]=u,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,u,s=e.andln(3)+i&3,l=t.andln(3)+o&3;3===s&&(s=-1),3===l&&(l=-1),a=0===(1&s)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==l?s:-s,r[0].push(a),u=0===(1&l)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==s?l:-l,r[1].push(u),2*i===a+1&&(i=1-i),2*o===u+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(a())(e,"hex","le")}})),p=d.getNAF,v=d.getJSF,m=d.assert;function g(e,t){this.type=e,this.p=new(a())(t.p,16),this.red=t.prime?a().red(t.prime):a().mont(this.p),this.zero=new(a())(0).toRed(this.red),this.one=new(a())(1).toRed(this.red),this.two=new(a())(2).toRed(this.red),this.n=t.n&&new(a())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var y=g;function b(e,t){this.curve=e,this.type=t,this.precomputed=null}g.prototype.point=function(){throw new Error("Not implemented")},g.prototype.validate=function(){throw new Error("Not implemented")},g.prototype._fixedNafMul=function(e,t){m(e.precomputed);var r=e._getDoubles(),n=p(t,1,this._bitLength),i=(1<=o;s--)a=(a<<1)+n[s];u.push(a)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;u--){for(var s=0;u>=0&&0===o[u];u--)s++;if(u>=0&&s++,a=a.dblp(s),u<0)break;var l=o[u];m(0!==l),a="affine"===e.type?l>0?a.mixedAdd(i[l-1>>1]):a.mixedAdd(i[-l-1>>1].neg()):l>0?a.add(i[l-1>>1]):a.add(i[-l-1>>1].neg())}return"affine"===e.type?a.toP():a},g.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,u,s=this._wnafT1,l=this._wnafT2,c=this._wnafT3,f=0;for(o=0;o=1;o-=2){var d=o-1,m=o;if(1===s[d]&&1===s[m]){var g=[t[d],null,null,t[m]];0===t[d].y.cmp(t[m].y)?(g[1]=t[d].add(t[m]),g[2]=t[d].toJ().mixedAdd(t[m].neg())):0===t[d].y.cmp(t[m].y.redNeg())?(g[1]=t[d].toJ().mixedAdd(t[m]),g[2]=t[d].add(t[m].neg())):(g[1]=t[d].toJ().mixedAdd(t[m]),g[2]=t[d].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],b=v(r[d],r[m]);for(f=Math.max(b[0].length,f),c[d]=new Array(f),c[m]=new Array(f),a=0;a=0;o--){for(var E=0;o>=0;){var S=!0;for(a=0;a=0&&E++,A=A.dblp(E),o<0)break;for(a=0;a0?u=l[a][P-1>>1]:P<0&&(u=l[a][-P-1>>1].neg()),A="affine"===u.type?A.mixedAdd(u):A.add(u))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},b.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,u=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),u=u.neg()),[{a:n,b:i},{a:o,b:u}]},A.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),u=o.mul(n.a),s=i.mul(r.b),l=o.mul(n.b);return{k1:e.sub(a).sub(u),k2:s.add(l).neg()}},A.prototype.pointFromX=function(e,t){(e=new(a())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},A.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},A.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},E.prototype.isInfinity=function(){return this.inf},E.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},E.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},E.prototype.getX=function(){return this.x.fromRed()},E.prototype.getY=function(){return this.y.fromRed()},E.prototype.mul=function(e){return e=new(a())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},E.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},E.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},E.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},E.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.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 t},E.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},w(S,y.BasePoint),A.prototype.jpoint=function(e,t,r){return new S(this,e,t,r)},S.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},S.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},S.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),u=n.redSub(i),s=o.redSub(a);if(0===u.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=u.redSqr(),c=l.redMul(u),f=n.redMul(l),h=s.redSqr().redIAdd(c).redISub(f).redISub(f),d=s.redMul(f.redISub(h)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(h,d,p)},S.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),u=i.redSub(o);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),l=s.redMul(a),c=r.redMul(s),f=u.redSqr().redIAdd(l).redISub(c).redISub(c),h=u.redMul(c.redISub(f)).redISub(i.redMul(l)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},S.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},S.prototype.inspect=function(){return this.isInfinity()?"":""},S.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var P=l((function(e,t){var r=t;r.base=y,r.short=x,r.mont=null,r.edwards=null})),_=l((function(e,t){var r,n=t,i=d.assert;function o(e){"short"===e.type?this.curve=new P.short(e):"edwards"===e.type?this.curve=new P.edwards(e):this.curve=new P.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:s().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"]}),a("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:s().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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),a("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:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(u){r=void 0}a("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:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function C(e){if(!(this instanceof C))return new C(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=h.toArray(e.entropy,e.entropyEnc||"hex"),r=h.toArray(e.nonce,e.nonceEnc||"hex"),n=h.toArray(e.pers,e.persEnc||"hex");c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var N=C;C.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},C.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(n=r,r=t,t=null),r&&(r=h.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var R=d.assert;function I(e,t){if(e instanceof I)return e;this._importDER(e,t)||(R(e.r&&e.s,"Signature without r or s"),this.r=new(a())(e.r,16),this.s=new(a())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var L=I;function D(){this.place=0}function B(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function F(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}I.prototype._importDER=function(e,t){e=d.toArray(e,t);var r=new D;if(48!==e[r.place++])return!1;var n=B(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=B(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var u=B(e,r);if(!1===u)return!1;if(e.length!==u+r.place)return!1;var s=e.slice(r.place,u+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(a())(o),this.s=new(a())(s),this.recoveryParam=null,!0},I.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=F(t),r=F(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];j(n,t.length),(n=n.concat(t)).push(2),j(n,r.length);var i=n.concat(r),o=[48];return j(o,i.length),o=o.concat(i),d.encode(o,e)};var Z=function(){throw new Error("unsupported")},U=d.assert;function z(e){if(!(this instanceof z))return new z(e);"string"===typeof e&&(U(Object.prototype.hasOwnProperty.call(_,e),"Unknown curve "+e),e=_[e]),e instanceof _.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var q=z;z.prototype.keyPair=function(e){return new M(this,e)},z.prototype.keyFromPrivate=function(e,t){return M.fromPrivate(this,e,t)},z.prototype.keyFromPublic=function(e,t){return M.fromPublic(this,e,t)},z.prototype.genKeyPair=function(e){e||(e={});for(var t=new N({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Z(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(a())(2));;){var i=new(a())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},z.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},z.prototype.sign=function(e,t,r,n){"object"===typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(a())(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),u=e.toArray("be",i),s=new N({hash:this.hash,entropy:o,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new(a())(1)),c=0;;c++){var f=n.k?n.k(c):new(a())(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(l)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var d=h.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var v=f.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),m^=1),new L({r:p,s:v,recoveryParam:m})}}}}}},z.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(a())(e,16)),r=this.keyFromPublic(r,n);var i=(t=new L(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var u,s=o.invm(this.n),l=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(l,r.getPublic(),c)).isInfinity()&&u.eqXToP(i):!(u=this.g.mulAdd(l,r.getPublic(),c)).isInfinity()&&0===u.getX().umod(this.n).cmp(i)},z.prototype.recoverPubKey=function(e,t,r,n){U((3&r)===r,"The recovery param is more than two bits"),t=new L(t,n);var i=this.n,o=new(a())(e),u=t.r,s=t.s,l=1&r,c=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");u=c?this.curve.pointFromX(u.add(this.curve.n),l):this.curve.pointFromX(u,l);var f=t.r.invm(i),h=i.sub(o).mul(f).umod(i),d=s.mul(f).umod(i);return this.g.mulAdd(h,u,d)},z.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new L(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var K=l((function(e,t){var r=t;r.version="6.5.4",r.utils=d,r.rand=function(){throw new Error("unsupported")},r.curve=P,r.curves=_,r.ec=q,r.eddsa=null})).ec,H=r(9716),G=r(520),V=new(r(9502).Logger)("signing-key/5.7.0"),W=null;function J(){return W||(W=new K("secp256k1")),W}var Q=function(){function e(t){(0,n.Z)(this,e),(0,G.defineReadOnly)(this,"curve","secp256k1"),(0,G.defineReadOnly)(this,"privateKey",(0,H.hexlify)(t)),32!==(0,H.hexDataLength)(this.privateKey)&&V.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=J().keyFromPrivate((0,H.arrayify)(this.privateKey));(0,G.defineReadOnly)(this,"publicKey","0x"+r.getPublic(!1,"hex")),(0,G.defineReadOnly)(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),(0,G.defineReadOnly)(this,"_isSigningKey",!0)}return(0,i.Z)(e,[{key:"_addPoint",value:function(e){var t=J().keyFromPublic((0,H.arrayify)(this.publicKey)),r=J().keyFromPublic((0,H.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=J().keyFromPrivate((0,H.arrayify)(this.privateKey)),r=(0,H.arrayify)(e);32!==r.length&&V.throwArgumentError("bad digest length","digest",e);var n=t.sign(r,{canonical:!0});return(0,H.splitSignature)({recoveryParam:n.recoveryParam,r:(0,H.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,H.hexZeroPad)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=J().keyFromPrivate((0,H.arrayify)(this.privateKey)),r=J().keyFromPublic((0,H.arrayify)(X(e)));return(0,H.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function Y(e,t){var r=(0,H.splitSignature)(t),n={r:(0,H.arrayify)(r.r),s:(0,H.arrayify)(r.s)};return"0x"+J().recoverPubKey((0,H.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function X(e,t){var r=(0,H.arrayify)(e);if(32===r.length){var n=new Q(r);return t?"0x"+J().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?t?(0,H.hexlify)(r):"0x"+J().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+J().keyFromPublic(r).getPublic(!0,"hex"):(0,H.hexlify)(r):V.throwArgumentError("invalid public or private key","key","[REDACTED]")}},4530:function(e,t,r){"use strict";r.r(t),r.d(t,{keccak256:function(){return m},pack:function(){return v},sha256:function(){return g}});var n=r(2257),i=r(9716),o=r(8062),a=r(9598),u=r(3374),s=r(9502),l=new RegExp("^bytes([0-9]+)$"),c=new RegExp("^(u?int)([0-9]*)$"),f=new RegExp("^(.*)\\[([0-9]*)\\]$"),h="0000000000000000000000000000000000000000000000000000000000000000",d=new s.Logger("solidity/5.7.0");function p(e,t,r){switch(e){case"address":return r?(0,i.zeroPad)(t,32):(0,i.arrayify)(t);case"string":return(0,u.Y0)(t);case"bytes":return(0,i.arrayify)(t);case"bool":return t=t?"0x01":"0x00",r?(0,i.zeroPad)(t,32):(0,i.arrayify)(t)}var o=e.match(c);if(o){var a=parseInt(o[2]||"256");return(o[2]&&String(a)!==o[2]||a%8!==0||0===a||a>256)&&d.throwArgumentError("invalid number type","type",e),r&&(a=256),t=n.O$.from(t).toTwos(a),(0,i.zeroPad)(t,a/8)}if(o=e.match(l)){var s=parseInt(o[1]);return(String(s)!==o[1]||0===s||s>32)&&d.throwArgumentError("invalid bytes type","type",e),(0,i.arrayify)(t).byteLength!==s&&d.throwArgumentError("invalid value for ".concat(e),"value",t),r?(0,i.arrayify)((t+h).substring(0,66)):t}if((o=e.match(f))&&Array.isArray(t)){var v=o[1];parseInt(o[2]||String(t.length))!=t.length&&d.throwArgumentError("invalid array length for ".concat(e),"value",t);var m=[];return t.forEach((function(e){m.push(p(v,e,!0))})),(0,i.concat)(m)}return d.throwArgumentError("invalid type","type",e)}function v(e,t){e.length!=t.length&&d.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);var r=[];return e.forEach((function(e,n){r.push(p(e,t[n]))})),(0,i.hexlify)((0,i.concat)(r))}function m(e,t){return(0,o.keccak256)(v(e,t))}function g(e,t){return(0,a.JQ)(v(e,t))}},3902:function(e,t,r){"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:function(){return o.Uj},Utf8ErrorFuncs:function(){return o.te},Utf8ErrorReason:function(){return o.Uw},_toEscapedUtf8String:function(){return o.U$},formatBytes32String:function(){return a},nameprep:function(){return y},parseBytes32String:function(){return u},toUtf8Bytes:function(){return o.Y0},toUtf8CodePoints:function(){return o.XL},toUtf8String:function(){return o.ZN}});var n=r(4867),i=r(9716),o=r(3374);function a(e){var t=(0,o.Y0)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([t,n.R]).slice(0,32))}function u(e){var t=(0,i.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return(0,o.ZN)(t.slice(0,r))}function s(e,t){t||(t=function(e){return[parseInt(e,16)]});var r=0,n={};return e.split(",").forEach((function(e){var i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function l(e){var t=0;return e.split(",").map((function(e){var r=e.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:t+parseInt(r[0],16),h:t=parseInt(r[1],16)}}))}function c(e,t){for(var r=0,n=0;n=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)===0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}var f=l("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),h="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),d=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],p=s("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),v=s("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),m=s("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");for(var t=[],r=0;r=0)return[];if(e>=65024&&e<=65039)return[];var t=function(e){var t=c(e,d);if(t)return[e+t.s];var r=p[e];if(r)return r;var n=v[e];return n?[e+n[0]]:m[e]||null}(e);return t||[e]})),r=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[]),(r=(0,o.XL)((0,o.uu)(r),o.Uj.NFKC)).forEach((function(e){if(c(e,g))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(e){if(c(e,f))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=(0,o.uu)(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}},3374:function(e,t,r){"use strict";r.d(t,{Uj:function(){return n},te:function(){return s},Uw:function(){return i},U$:function(){return h},uu:function(){return d},Y0:function(){return c},XL:function(){return v},ZN:function(){return p}});var n,i,o=r(9716),a=new(r(9502).Logger)("strings/5.7.0");function u(e,t,r,n,o){if(e===i.BAD_PREFIX||e===i.UNEXPECTED_CONTINUE){for(var a=0,u=t+1;u>6===2;u++)a++;return a}return e===i.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n||(n={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(i||(i={}));var s=Object.freeze({error:function(e,t,r,n,i){return a.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:u,replace:function(e,t,r,n,o){return e===i.OVERLONG?(n.push(o),0):(n.push(65533),u(e,t,r))}});function l(e,t){null==t&&(t=s.error),e=(0,o.arrayify)(e);for(var r=[],n=0;n>7!==0){var u=null,l=null;if(192===(224&a))u=1,l=127;else if(224===(240&a))u=2,l=2047;else{if(240!==(248&a)){n+=t(128===(192&a)?i.UNEXPECTED_CONTINUE:i.BAD_PREFIX,n-1,e,r);continue}u=3,l=65535}if(n-1+u>=e.length)n+=t(i.OVERRUN,n-1,e,r);else{for(var c=a&(1<<8-u-1)-1,f=0;f1114111?n+=t(i.OUT_OF_RANGE,n-1-u,e,r,c):c>=55296&&c<=57343?n+=t(i.UTF16_SURROGATE,n-1-u,e,r,c):c<=l?n+=t(i.OVERLONG,n-1-u,e,r,c):r.push(c))}}else r.push(a)}return r}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.current;t!=n.current&&(a.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&u|128);else if(55296==(64512&u)){i++;var s=e.charCodeAt(i);if(i>=e.length||56320!==(64512&s))throw new Error("invalid utf-8 string");var l=65536+((1023&u)<<10)+(1023&s);r.push(l>>18|240),r.push(l>>12&63|128),r.push(l>>6&63|128),r.push(63&l|128)}else r.push(u>>12|224),r.push(u>>6&63|128),r.push(63&u|128)}return(0,o.arrayify)(r)}function f(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function h(e,t){return'"'+l(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?f(e):f(55296+((e-=65536)>>10&1023))+f(56320+(1023&e))})).join("")+'"'}function d(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function p(e,t){return d(l(e,t))}function v(e){return l(c(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.current))}},5452:function(e,t,r){"use strict";r.r(t),r.d(t,{TransactionTypes:function(){return n},accessListify:function(){return A},computeAddress:function(){return y},parse:function(){return C},recoverAddress:function(){return b},serialize:function(){return P}});var n,i=r(7419),o=r(2257),a=r(9716),u=r(5422),s=r(8062),l=r(520),c=r(7986),f=r(8865),h=r(9502),d=new h.Logger("transactions/5.7.0");function p(e){return"0x"===e?null:(0,i.getAddress)(e)}function v(e){return"0x"===e?u._Y:o.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(n||(n={}));var m=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],g={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function y(e){var t=(0,f.computePublicKey)(e);return(0,i.getAddress)((0,a.hexDataSlice)((0,s.keccak256)((0,a.hexDataSlice)(t,1)),12))}function b(e,t){return y((0,f.recoverPublicKey)((0,a.arrayify)(e),t))}function w(e,t){var r=(0,a.stripZeros)(o.O$.from(e).toHexString());return r.length>32&&d.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function k(e,t){return{address:(0,i.getAddress)(e),storageKeys:(t||[]).map((function(t,r){return 32!==(0,a.hexDataLength)(t)&&d.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function A(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&d.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),k(e[0],e[1])):k(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var r=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return k(t,Object.keys(r).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function x(e){return A(e).map((function(e){return[e.address,e.storageKeys]}))}function E(e,t){if(null!=e.gasPrice){var r=o.O$.from(e.gasPrice),n=o.O$.from(e.maxFeePerGas||0);r.eq(n)||d.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var u=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(e.maxFeePerGas||0,"maxFeePerGas"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,i.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",x(e.accessList||[])];if(t){var s=(0,a.splitSignature)(t);u.push(w(s.recoveryParam,"recoveryParam")),u.push((0,a.stripZeros)(s.r)),u.push((0,a.stripZeros)(s.s))}return(0,a.hexConcat)(["0x02",c.encode(u)])}function S(e,t){var r=[w(e.chainId||0,"chainId"),w(e.nonce||0,"nonce"),w(e.gasPrice||0,"gasPrice"),w(e.gasLimit||0,"gasLimit"),null!=e.to?(0,i.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",x(e.accessList||[])];if(t){var n=(0,a.splitSignature)(t);r.push(w(n.recoveryParam,"recoveryParam")),r.push((0,a.stripZeros)(n.r)),r.push((0,a.stripZeros)(n.s))}return(0,a.hexConcat)(["0x01",c.encode(r)])}function P(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&d.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,l.checkProperties)(e,g);var r=[];m.forEach((function(t){var n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=(0,a.arrayify)((0,a.hexlify)(n,i)),t.length&&n.length!==t.length&&n.length>0&&d.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,a.stripZeros)(n)).length>t.maxLength&&d.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push((0,a.hexlify)(n))}));var n=0;if(null!=e.chainId?"number"!==typeof(n=e.chainId)&&d.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!(0,a.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,a.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return c.encode(r);var i=(0,a.splitSignature)(t),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&d.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&d.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,a.hexlify)(o)),r.push((0,a.stripZeros)((0,a.arrayify)(i.r))),r.push((0,a.stripZeros)((0,a.arrayify)(i.s))),c.encode(r)}(e,t);switch(e.type){case 1:return S(e,t);case 2:return E(e,t)}return d.throwError("unsupported transaction type: ".concat(e.type),h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function _(e,t,r){try{var n=v(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(o){d.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,a.hexZeroPad)(t[1],32),e.s=(0,a.hexZeroPad)(t[2],32);try{var i=(0,s.keccak256)(r(e));e.from=b(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(o){}}function C(e){var t=(0,a.arrayify)(e);if(t[0]>127)return function(e){var t=c.decode(e);9!==t.length&&6!==t.length&&d.throwArgumentError("invalid raw transaction","rawTransaction",e);var r={nonce:v(t[0]).toNumber(),gasPrice:v(t[1]),gasLimit:v(t[2]),to:p(t[3]),value:v(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=o.O$.from(t[6]).toNumber()}catch(l){return r}if(r.r=(0,a.hexZeroPad)(t[7],32),r.s=(0,a.hexZeroPad)(t[8],32),o.O$.from(r.r).isZero()&&o.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=t.slice(0,6);0!==r.chainId&&(i.push((0,a.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var u=(0,s.keccak256)(c.encode(i));try{r.from=b(u,{r:(0,a.hexlify)(r.r),s:(0,a.hexlify)(r.s),recoveryParam:n})}catch(l){}r.hash=(0,s.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){var t=c.decode(e.slice(1));8!==t.length&&11!==t.length&&d.throwArgumentError("invalid component count for transaction type: 1","payload",(0,a.hexlify)(e));var r={type:1,chainId:v(t[0]).toNumber(),nonce:v(t[1]).toNumber(),gasPrice:v(t[2]),gasLimit:v(t[3]),to:p(t[4]),value:v(t[5]),data:t[6],accessList:A(t[7])};return 8===t.length||(r.hash=(0,s.keccak256)(e),_(r,t.slice(8),S)),r}(t);case 2:return function(e){var t=c.decode(e.slice(1));9!==t.length&&12!==t.length&&d.throwArgumentError("invalid component count for transaction type: 2","payload",(0,a.hexlify)(e));var r=v(t[2]),n=v(t[3]),i={type:2,chainId:v(t[0]).toNumber(),nonce:v(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:v(t[4]),to:p(t[5]),value:v(t[6]),data:t[7],accessList:A(t[8])};return 9===t.length||(i.hash=(0,s.keccak256)(e),_(i,t.slice(9),E)),i}(t)}return d.throwError("unsupported transaction type: ".concat(t[0]),h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},9601:function(e,t,r){"use strict";r.r(t),r.d(t,{commify:function(){return E},formatEther:function(){return _},formatUnits:function(){return S},parseEther:function(){return C},parseUnits:function(){return P}});var n=r(5671),i=r(3144),o=r(9716),a=r(9502),u=r(6945),s=r(2257),l=new a.Logger(u.i),c={},f=s.O$.from(0),h=s.O$.from(-1);function d(e,t,r,n){var i={fault:t,operation:r};return void 0!==n&&(i.value=n),l.throwError(e,a.Logger.errors.NUMERIC_FAULT,i)}for(var p="0";p.length<256;)p+=p;function v(e){if("number"!==typeof e)try{e=s.O$.from(e).toNumber()}catch(t){}return"number"===typeof e&&e>=0&&e<=256&&!(e%1)?"1"+p.substring(0,e):l.throwArgumentError("invalid decimal size","decimals",e)}function m(e,t){null==t&&(t=0);var r=v(t),n=(e=s.O$.from(e)).lt(f);n&&(e=e.mul(h));for(var i=e.mod(r).toString();i.length2&&l.throwArgumentError("too many decimal points","value",e);var o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&d("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length80&&l.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(c,r,n,i)}}]),e}(),b=function(){function e(t,r,i,o){(0,n.Z)(this,e),t!==c&&l.throwError("cannot use FixedNumber constructor; use FixedNumber.from",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=o,this._hex=r,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}return(0,i.Z)(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&l.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t);var r=g(this._value,this.format.decimals),n=g(t._value,t.format.decimals);return e.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t);var r=g(this._value,this.format.decimals),n=g(t._value,t.format.decimals);return e.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t);var r=g(this._value,this.format.decimals),n=g(t._value,t.format.decimals);return e.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t);var r=g(this._value,this.format.decimals),n=g(t._value,t.format.decimals);return e.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(w.toFormat(r.format))),r}},{key:"ceiling",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(w.toFormat(r.format))),r}},{key:"round",value:function(t){null==t&&(t=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(t<0||t>80||t%1)&&l.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;var n=e.from("1"+p.substring(0,t),this.format),i=k.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex;e%8&&l.throwArgumentError("invalid byte width","width",e);var t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,o.hexZeroPad)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,r,n){return null!=n||null==r||(0,s.Zm)(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),e.fromString(m(t,r),y.from(n))}},{key:"fromString",value:function(t,r){null==r&&(r="fixed");var n=y.from(r),i=g(t,n.decimals);!n.signed&&i.lt(f)&&d("unsigned value cannot be negative","overflow","value",t);var a=null;n.signed?a=i.toTwos(n.width).toHexString():(a=i.toHexString(),a=(0,o.hexZeroPad)(a,n.width/8));var u=m(i,n.decimals);return new e(c,a,u,n)}},{key:"fromBytes",value:function(t,r){null==r&&(r="fixed");var n=y.from(r);if((0,o.arrayify)(t).length>n.width/8)throw new Error("overflow");var i=s.O$.from(t);n.signed&&(i=i.fromTwos(n.width));var a=i.toTwos((n.signed?0:1)+n.width).toHexString(),u=m(i,n.decimals);return new e(c,a,u,n)}},{key:"from",value:function(t,r){if("string"===typeof t)return e.fromString(t,r);if((0,o.isBytes)(t))return e.fromBytes(t,r);try{return e.fromValue(t,0,r)}catch(n){if(n.code!==a.Logger.errors.INVALID_ARGUMENT)throw n}return l.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),w=b.from(1),k=b.from("0.5"),A=new a.Logger("units/5.7.0"),x=["wei","kwei","mwei","gwei","szabo","finney","ether"];function E(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&A.throwArgumentError("invalid value","value",e);var r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var a=r.length-3;o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i}function S(e,t){if("string"===typeof t){var r=x.indexOf(t);-1!==r&&(t=3*r)}return m(e,null!=t?t:18)}function P(e,t){if("string"!==typeof e&&A.throwArgumentError("value must be a string","value",e),"string"===typeof t){var r=x.indexOf(t);-1!==r&&(t=3*r)}return g(e,null!=t?t:18)}function _(e){return S(e,18)}function C(e){return P(e,18)}},2876:function(e,t,r){"use strict";r.r(t),r.d(t,{Wallet:function(){return P},verifyMessage:function(){return _},verifyTypedData:function(){return C}});var n=r(4165),i=r(5671),o=r(3144),a=r(7326),u=r(136),s=r(9388),l=r(7419),c=r(9745),f=r(8408),h=r(9716),d=r(2273),p=r(5992),v=r(5148),m=r(8062),g=r(520),y=r(5244),b=r(8865),w=r(3463),k=r(1529),A=r(5452),x=r(9502),E=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(t){o(t)}}function u(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))},S=new x.Logger("wallet/5.7.0");var P=function(e){(0,u.Z)(r,e);var t=(0,s.Z)(r);function r(e,n){var o,u;if((0,i.Z)(this,r),o=t.call(this),null!=(u=e)&&(0,h.isHexString)(u.privateKey,32)&&null!=u.address){var s=new b.SigningKey(e.privateKey);if((0,g.defineReadOnly)((0,a.Z)(o),"_signingKey",(function(){return s})),(0,g.defineReadOnly)((0,a.Z)(o),"address",(0,A.computeAddress)(o.publicKey)),o.address!==(0,l.getAddress)(e.address)&&S.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){var t=e.mnemonic;return t&&t.phrase}(e)){var f=e.mnemonic;(0,g.defineReadOnly)((0,a.Z)(o),"_mnemonic",(function(){return{phrase:f.phrase,path:f.path||v.defaultPath,locale:f.locale||"en"}}));var d=o.mnemonic,p=v.HDNode.fromMnemonic(d.phrase,null,d.locale).derivePath(d.path);(0,A.computeAddress)(p.privateKey)!==o.address&&S.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,g.defineReadOnly)((0,a.Z)(o),"_mnemonic",(function(){return null}))}else{if(b.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&S.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,g.defineReadOnly)((0,a.Z)(o),"_signingKey",(function(){return e}));else{"string"===typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);var m=new b.SigningKey(e);(0,g.defineReadOnly)((0,a.Z)(o),"_signingKey",(function(){return m}))}(0,g.defineReadOnly)((0,a.Z)(o),"_mnemonic",(function(){return null})),(0,g.defineReadOnly)((0,a.Z)(o),"address",(0,A.computeAddress)(o.publicKey))}return n&&!c.zt.isProvider(n)&&S.throwArgumentError("invalid provider","provider",n),(0,g.defineReadOnly)((0,a.Z)(o),"provider",n||null),o}return(0,o.Z)(r,[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(e){return new r(this,e)}},{key:"signTransaction",value:function(e){var t=this;return(0,g.resolveProperties)(e).then((function(r){null!=r.from&&((0,l.getAddress)(r.from)!==t.address&&S.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);var n=t._signingKey().signDigest((0,m.keccak256)((0,A.serialize)(r)));return(0,A.serialize)(r,n)}))}},{key:"signMessage",value:function(e){return E(this,void 0,void 0,(0,n.Z)().mark((function t(){return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,h.joinSignature)(this._signingKey().signDigest((0,d.r)(e))));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,r){return E(this,void 0,void 0,(0,n.Z)().mark((function i(){var o,a=this;return(0,n.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,p.E.resolveNames(e,t,r,(function(e){return null==a.provider&&S.throwError("cannot resolve ENS names without a provider",x.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),a.provider.resolveName(e)}));case 2:return o=n.sent,n.abrupt("return",(0,h.joinSignature)(this._signingKey().signDigest(p.E.hash(o.domain,t,o.value))));case 4:case"end":return n.stop()}}),i,this)})))}},{key:"encrypt",value:function(e,t,r){if("function"!==typeof t||r||(r=t,t={}),r&&"function"!==typeof r)throw new Error("invalid callback");return t||(t={}),(0,w.HI)(this,e,t,r)}}],[{key:"createRandom",value:function(e){var t=(0,y.O)(16);e||(e={}),e.extraEntropy&&(t=(0,h.arrayify)((0,h.hexDataSlice)((0,m.keccak256)((0,h.concat)([t,e.extraEntropy])),0,16)));var n=(0,v.entropyToMnemonic)(t,e.locale);return r.fromMnemonic(n,e.path,e.locale)}},{key:"fromEncryptedJson",value:function(e,t,n){return(0,k.decryptJsonWallet)(e,t,n).then((function(e){return new r(e)}))}},{key:"fromEncryptedJsonSync",value:function(e,t){return new r((0,k.decryptJsonWalletSync)(e,t))}},{key:"fromMnemonic",value:function(e,t,n){return t||(t=v.defaultPath),new r(v.HDNode.fromMnemonic(e,null,n).derivePath(t))}}]),r}(f.E);function _(e,t){return(0,A.recoverAddress)((0,d.r)(e),t)}function C(e,t,r,n){return(0,A.recoverAddress)(p.E.hash(e,t,r),n)}},5889:function(e,t,r){"use strict";r.r(t),r.d(t,{_fetchData:function(){return v},fetchJson:function(){return m},poll:function(){return g}});var n=r(4165),i=r(7354),o=r(9716),a=r(520),u=r(3374),s=r(9502),l=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(t){o(t)}}function u(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))};function c(e,t){return l(this,void 0,void 0,(0,n.Z)().mark((function r(){var i,a,u,s,l;return(0,n.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t={}),i={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(i.mode="cors",i.cache="no-cache",i.credentials="same-origin",i.redirect="follow",i.referrer="client"),null!=t.fetchOptions&&((a=t.fetchOptions).mode&&(i.mode=a.mode),a.cache&&(i.cache=a.cache),a.credentials&&(i.credentials=a.credentials),a.redirect&&(i.redirect=a.redirect),a.referrer&&(i.referrer=a.referrer)),r.next=7,fetch(e,i);case 7:return u=r.sent,r.next=10,u.arrayBuffer();case 10:return s=r.sent,l={},u.headers.forEach?u.headers.forEach((function(e,t){l[t.toLowerCase()]=e})):u.headers.keys().forEach((function(e){l[e.toLowerCase()]=u.headers.get(e)})),r.abrupt("return",{headers:l,statusCode:u.status,statusMessage:u.statusText,body:(0,o.arrayify)(new Uint8Array(s))});case 14:case"end":return r.stop()}}),r)})))}var f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(t){o(t)}}function u(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))},h=new s.Logger("web/5.7.1");function d(e){return new Promise((function(t){setTimeout(t,e)}))}function p(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,o.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,u.ZN)(e)}catch(r){}return(0,o.hexlify)(e)}return e}function v(e,t,r){var o="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;h.assertArgument(o>0&&o%1===0,"invalid connection throttle limit","connection.throttleLimit",o);var l="object"===typeof e?e.throttleCallback:null,v="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;h.assertArgument(v>0&&v%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",v);var m="object"===typeof e&&!!e.errorPassThrough,g={},y=null,b={method:"GET"},w=!1,k=12e4;if("string"===typeof e)y=e;else if("object"===typeof e){if(null!=e&&null!=e.url||h.throwArgumentError("missing URL","connection.url",e),y=e.url,"number"===typeof e.timeout&&e.timeout>0&&(k=e.timeout),e.headers)for(var A in e.headers)g[A.toLowerCase()]={key:A,value:String(e.headers[A])},["if-none-match","if-modified-since"].indexOf(A.toLowerCase())>=0&&(w=!0);if(b.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==y.substring(0,6)&&!0!==e.allowInsecureAuthentication&&h.throwError("basic authentication requires a secure https url",s.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:y,user:e.user,password:"[REDACTED]"});var x=e.user+":"+e.password;g.authorization={key:"Authorization",value:"Basic "+(0,i.c)((0,u.Y0)(x))}}null!=e.skipFetchSetup&&(b.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(b.fetchOptions=(0,a.shallowCopy)(e.fetchOptions))}var E,S=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),P=y?y.match(S):null;if(P)try{var _={statusCode:200,statusMessage:"OK",headers:{"content-type":P[1]||"text/plain"},body:P[2]?(0,i.J)(P[3]):(E=P[3],(0,u.Y0)(E.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},C=_.body;return r&&(C=r(_.body,_)),Promise.resolve(C)}catch(M){h.throwError("processing response error",s.Logger.errors.SERVER_ERROR,{body:p(P[1],P[2]),error:M,requestBody:null,requestMethod:"GET",url:y})}t&&(b.method="POST",b.body=t,null==g["content-type"]&&(g["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==g["content-length"]&&(g["content-length"]={key:"Content-Length",value:String(t.length)}));var N={};Object.keys(g).forEach((function(e){var t=g[e];N[t.key]=t.value})),b.headers=N;var O=function(){var e=null;return{promise:new Promise((function(t,r){k&&(e=setTimeout((function(){null!=e&&(e=null,r(h.makeError("timeout",s.Logger.errors.TIMEOUT,{requestBody:p(b.body,N["content-type"]),requestMethod:b.method,timeout:k,url:y})))}),k))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),T=function(){return f(this,void 0,void 0,(0,n.Z)().mark((function e(){var t,i,a,u,f,g,k,A,x,E;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(O.cancel(),h.throwError("bad response",s.Logger.errors.SERVER_ERROR,{status:i.statusCode,headers:i.headers,body:p(k,i.headers?i.headers["content-type"]:null),requestBody:p(b.body,N["content-type"]),requestMethod:b.method,url:y})),!r){e.next=60;break}return e.prev=37,e.next=40,r(k,i);case 40:return A=e.sent,O.cancel(),e.abrupt("return",A);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&tu)return void(a()&&n(new Error("retry limit reached")));var l=t.interval*parseInt(String(Math.random()*Math.pow(2,s)));lt.ceiling&&(l=t.ceiling),setTimeout(i,l)}return null}),(function(e){a()&&n(e)}))}()}))}},226:function(e){"use strict";e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mustBeMetaMask,r=void 0!==t&&t,n=e.silent,i=void 0!==n&&n,o=e.timeout,a=void 0===o?3e3:o;!function(){if("boolean"!==typeof r)throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if("boolean"!==typeof i)throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if("number"!==typeof a)throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}();var u=!1;return new Promise((function(e){function t(){if(!u){u=!0,window.removeEventListener("ethereum#initialized",t);var n=window.ethereum;if(!n||r&&!n.isMetaMask){var o=r&&n?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum.";!i&&console.error("@metamask/detect-provider:",o),e(null)}else e(n)}}window.ethereum?t():(window.addEventListener("ethereum#initialized",t,{once:!0}),setTimeout((function(){t()}),a))}))}},468:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var u={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},s=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],r=0;r>4]+e[15&i])}return r.join("")}}}(),l={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],f=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],m=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],A=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],x=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],E=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function S(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,u=0,s=i;s>16&255]<<24^f[a>>8&255]<<16^f[255&a]<<8^f[a>>24&255]^c[u]<<24,u+=1,8!=i)for(t=1;t>8&255]<<8^f[a>>16&255]<<16^f[a>>24&255]<<24;for(t=i/2+1;t>2,d=s%4,this._Ke[h][d]=o[t],this._Kd[e-h][d]=o[t++],s++}for(var h=1;h>24&255]^A[a>>16&255]^x[a>>8&255]^E[255&a]},P.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=S(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^p[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^m[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var u,s=o(16);for(i=0;i<4;i++)u=this._Ke[t][i],s[4*i]=255&(f[n[i]>>24&255]^u>>24),s[4*i+1]=255&(f[n[(i+1)%4]>>16&255]^u>>16),s[4*i+2]=255&(f[n[(i+2)%4]>>8&255]^u>>8),s[4*i+3]=255&(f[255&n[(i+3)%4]]^u);return s},P.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=S(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^y[n[(i+3)%4]>>16&255]^b[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var u,s=o(16);for(i=0;i<4;i++)u=this._Kd[t][i],s[4*i]=255&(h[n[i]>>24&255]^u>>24),s[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^u>>16),s[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^u>>8),s[4*i+3]=255&(h[255&n[(i+1)%4]]^u);return s};var _=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new P(t)};_.prototype.encrypt=function(e){if((e=i(e)).length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},T.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},T.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var M=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof T||(r=new T(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new P(t)};M.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}for(t=o(t),r=0;rt)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var u=(e=n).lastIndexOf("1");if(-1===u)return"No separator character for "+e;if(0===u)return"Missing prefix for "+e;var s=e.slice(0,u),l=e.slice(u+1);if(l.length<6)return"Data too short";var c=a(s);if("string"===typeof c)return c;for(var f=[],h=0;h=l.length||f.push(p)}return 1!==c?"Invalid checksum for "+e:{prefix:s,words:f}}function s(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,u.push(i>>o&a);if(n)o>0&&u.push(i<=t)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var i=a(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var u=e+"1",s=0;s>5!==0)throw new Error("Non 5-bit word");i=o(i)^l,u+=t.charAt(l)}for(s=0;s<6;++s)i=o(i);for(i^=1,s=0;s<6;++s){u+=t.charAt(i>>5*(5-s)&31)}return u},toWordsUnsafe:function(e){var t=s(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=s(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=s(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=s(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},518:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(6601).Buffer}catch(C){}function u(e,t){var r=e.charCodeAt(t);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 "+e)}function s(e,t,r){var n=u(e,r);return r-1>=t&&(n|=u(e,r-1)<<4),n}function l(e,t,r,i){for(var o=0,a=0,u=Math.min(e.length,r),s=t;s=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,u=Math.min(o,o-a)+r,s=0,c=r;c1&&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")]=f}catch(C){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}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"],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];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-s.length]+s+r:s+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=d[e],c=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(c).toString(e);r=(f=f.idivn(c)).isZero()?v+r:h[l-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!==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 e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,u=67108863&a,s=a/67108864|0;r.words[0]=u;for(var l=1;l>>26,f=67108863&s,h=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=h;d++){var p=l-d|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[l]=0|f,s=0|c}return 0!==s?r.words[l]=0|s:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,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 a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],w=8191&b,k=b>>>13,A=0|a[4],x=8191&A,E=A>>>13,S=0|a[5],P=8191&S,_=S>>>13,C=0|a[6],N=8191&C,O=C>>>13,T=0|a[7],M=8191&T,R=T>>>13,I=0|a[8],L=8191&I,D=I>>>13,B=0|a[9],F=8191&B,j=B>>>13,Z=0|u[0],U=8191&Z,z=Z>>>13,q=0|u[1],K=8191&q,H=q>>>13,G=0|u[2],V=8191&G,W=G>>>13,J=0|u[3],Q=8191&J,Y=J>>>13,X=0|u[4],$=8191&X,ee=X>>>13,te=0|u[5],re=8191&te,ne=te>>>13,ie=0|u[6],oe=8191&ie,ae=ie>>>13,ue=0|u[7],se=8191&ue,le=ue>>>13,ce=0|u[8],fe=8191&ce,he=ce>>>13,de=0|u[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(h,U)|0))<<13)|0;l=((o=Math.imul(h,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(v,U)|0,o=Math.imul(v,z);var ge=(l+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,H)|0)+Math.imul(h,K)|0))<<13)|0;l=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,U),i=(i=Math.imul(g,z))+Math.imul(y,U)|0,o=Math.imul(y,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,H)|0;var ye=(l+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0;l=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,z))+Math.imul(k,U)|0,o=Math.imul(k,z),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,H)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,H)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,W)|0;var be=(l+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(h,Q)|0))<<13)|0;l=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,z))+Math.imul(E,U)|0,o=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,Y)|0;var we=(l+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;l=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,z))+Math.imul(_,U)|0,o=Math.imul(_,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,H)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var ke=(l+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0;l=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,z))+Math.imul(O,U)|0,o=Math.imul(O,z),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Ae=(l+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;l=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,z))+Math.imul(R,U)|0,o=Math.imul(R,z),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var xe=(l+(n=n+Math.imul(f,se)|0)|0)+((8191&(i=(i=i+Math.imul(f,le)|0)+Math.imul(h,se)|0))<<13)|0;l=((o=o+Math.imul(h,le)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,z))+Math.imul(D,U)|0,o=Math.imul(D,z),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,n=n+Math.imul(p,se)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,se)|0,o=o+Math.imul(v,le)|0;var Ee=(l+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;l=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(j,U)|0,o=Math.imul(j,z),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,H)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,H)|0,n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(g,se)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(y,se)|0,o=o+Math.imul(y,le)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,he)|0;var Se=(l+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(h,pe)|0))<<13)|0;l=((o=o+Math.imul(h,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,K),i=(i=Math.imul(F,H))+Math.imul(j,K)|0,o=Math.imul(j,H),n=n+Math.imul(L,V)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,n=n+Math.imul(w,se)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(k,se)|0,o=o+Math.imul(k,le)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var Pe=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;l=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,W))+Math.imul(j,V)|0,o=Math.imul(j,W),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(x,se)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(E,se)|0,o=o+Math.imul(E,le)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,he)|0;var _e=(l+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(y,pe)|0))<<13)|0;l=((o=o+Math.imul(y,ve)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,Y))+Math.imul(j,Q)|0,o=Math.imul(j,Y),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(P,se)|0,i=(i=i+Math.imul(P,le)|0)+Math.imul(_,se)|0,o=o+Math.imul(_,le)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,he)|0;var Ce=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(k,pe)|0))<<13)|0;l=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,ee))+Math.imul(j,$)|0,o=Math.imul(j,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(N,se)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,se)|0,o=o+Math.imul(O,le)|0,n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,he)|0;var Ne=(l+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ve)|0)+Math.imul(E,pe)|0))<<13)|0;l=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(M,se)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(R,se)|0,o=o+Math.imul(R,le)|0,n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0;var Oe=(l+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(_,pe)|0))<<13)|0;l=((o=o+Math.imul(_,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,ae))+Math.imul(j,oe)|0,o=Math.imul(j,ae),n=n+Math.imul(L,se)|0,i=(i=i+Math.imul(L,le)|0)+Math.imul(D,se)|0,o=o+Math.imul(D,le)|0,n=n+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Te=(l+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ve)|0)+Math.imul(O,pe)|0))<<13)|0;l=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,se),i=(i=Math.imul(F,le))+Math.imul(j,se)|0,o=Math.imul(j,le),n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,he)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,he)|0;var Me=(l+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(R,pe)|0))<<13)|0;l=((o=o+Math.imul(R,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(F,fe),i=(i=Math.imul(F,he))+Math.imul(j,fe)|0,o=Math.imul(j,he);var Re=(l+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ve)|0)+Math.imul(D,pe)|0))<<13)|0;l=((o=o+Math.imul(D,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ie=(l+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,ve))+Math.imul(j,pe)|0))<<13)|0;return l=((o=Math.imul(j,ve))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,s[0]=me,s[1]=ge,s[2]=ye,s[3]=be,s[4]=we,s[5]=ke,s[6]=Ae,s[7]=xe,s[8]=Ee,s[9]=Se,s[10]=Pe,s[11]=_e,s[12]=Ce,s[13]=Ne,s[14]=Oe,s[15]=Te,s[16]=Me,s[17]=Re,s[18]=Ie,0!==l&&(s[19]=l,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=u,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=v),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?v(this,e,t):r<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),u=67108863^67108863>>>o<a)for(this.length-=a,l=0;l=0&&(0!==c||l>=i);l--){var f=0|this.words[l];this.words[l]=c<<26-o|f>>>o,c=f&u}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(s/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this._strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var u,s=n.length-i.length;if("mod"!==t){(u=new o(null)).length=s+1,u.words=new Array(u.length);for(var l=0;l=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);u&&(u.words[f]=h)}return u&&u._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(u=this.neg().divmod(e,t),"mod"!==t&&(i=u.div.neg()),"div"!==t&&(a=u.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(u=this.divmod(e.neg(),t),"mod"!==t&&(i=u.div.neg()),{div:i,mod:u.mod}):0!==(this.negative&e.negative)?(u=this.neg().divmod(e.neg(),t),"div"!==t&&(a=u.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:u.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,u},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),u=new o(0),s=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,v=1;0===(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(c),s.isub(f)),u.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(u),a.isub(s)):(r.isub(t),u.isub(i),s.isub(a))}return{a:u,b:s,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),u=new o(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0===(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var f=0,h=1;0===(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(u)):(r.isub(t),u.isub(a))}return(i=0===t.cmpn(1)?a:u).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,u&=67108863,this.words[a]=u}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new P(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},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(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function k(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){P.call(this,e),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)}k.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},k.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},k.prototype.split=function(e,t){e.iushrn(this.n,0,t)},k.prototype.imulK=function(e){return e.imul(this.k)},i(A,k),A.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new x;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return w[e]=t,t},P.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),s=u.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(s);)c.redIAdd(s);for(var f=this.pow(c,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(u);){for(var v=d,m=0;0!==v.cmp(u);m++)v=v.redSqr();n(m=0;n--){for(var l=t.words[n],c=s-1;c>=0;c--){var f=l>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++u||0===n&&0===c)&&(i=this.mul(i,r[a]),u=0,a=0)):u=0}s=26}return i},P.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new _(e)},i(_,P),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),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)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},3580:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var a=r(8334);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return a.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return a.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return a.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return a.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return a.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return a.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return a.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return a.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return a.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return a.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return a.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return a.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return a.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return a.TransactionDescription}});var u=r(7419);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return u.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return u.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return u.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return u.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return u.isAddress}});var s=o(r(1800));t.base64=s;var l=r(3482);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return l.Base58}});var c=r(9716);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return c.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return c.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return c.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return c.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return c.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return c.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return c.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return c.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return c.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return c.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return c.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return c.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return c.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return c.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return c.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return c.stripZeros}});var f=r(1049);Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return f.namehash}});var h=r(5148);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return h.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return h.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return h.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return h.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return h.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return h.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return h.mnemonicToSeed}});var d=r(1529);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return d.getJsonWalletAddress}});var p=r(8062);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return p.keccak256}});var v=r(9502);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return v.Logger}});var m=r(6620);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return m.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return m.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return m.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return m.sha512}});var g=r(4530);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return g.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return g.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return g.sha256}});var y=r(3770);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=r(520);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var w=o(r(7986));t.RLP=w;var k=r(8865);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return k.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return k.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return k.SigningKey}});var A=r(3902);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var x=r(5452);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return x.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return x.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return x.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return x.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return x.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return x.TransactionTypes}});var E=r(9601);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var S=r(2876);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var P=r(5889);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return P._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return P.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return P.poll}});var _=r(6620);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return _.SupportedAlgorithm}});var C=r(3902);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return C.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return C.Utf8ErrorReason}})},7143:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,a){if("function"!==typeof n)throw new TypeError("The listener must be a function");var u=new i(n,o||e,a),s=r?r+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],u]:e._events[s].push(u):(e._events[s]=u,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function u(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),u.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},u.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},9046:function(e,t,r){"use strict";var n=r(2325),i=r(2534);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function u(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>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},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,u){var s=0,l=t;return s+=(l=l+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,u){return t+n+o+u>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,u,s,l){var c=0,f=t;return c+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,u,s,l){return t+n+o+u+l>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},2534:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7898:function(e,t,r){var n;!function(){"use strict";var i="input is invalid type",o="object"===typeof window,a=o?window:{};a.JS_SHA3_NO_WINDOW&&(o=!1);var u=!o&&"object"===typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node?a=r.g:u&&(a=self);var s=!a.JS_SHA3_NO_COMMON_JS&&e.exports,l=r.amdO,c=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),h=[4,1024,262144,67108864],d=[0,8,16,24],p=[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],v=[224,256,384,512],m=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],y={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!c||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var b=function(e,t,r){return function(n){return new I(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new I(e,t,i).update(n)[r]()}},k=function(e,t,r){return function(t,n,i,o){return P["cshake"+e].update(t,n,i,o)[r]()}},A=function(e,t,r){return function(t,n,i,o){return P["kmac"+e].update(t,n,i,o)[r]()}},x=function(e,t,r,n){for(var i=0;i>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 L(e,t,r){I.call(this,e,t,r)}I.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!c||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,a=this.blocks,u=this.byteCount,s=e.length,l=this.blockCount,f=0,h=this.s;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[n>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=u){for(this.start=n-u,this.block=a[l],n=0;n>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},I.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!c||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var a=0;a=57344?n+=3:(u=65536+((1023&u)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},I.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];a%t===0&&(D(r),o=0)}return i&&(e=r[o],u+=f[e>>4&15]+f[15&e],i>1&&(u+=f[e>>12&15]+f[e>>8&15]),i>2&&(u+=f[e>>20&15]+f[e>>16&15])),u},I.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,u=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var s=new Uint32Array(e);a>8&255,s[e+2]=t>>16&255,s[e+3]=t>>24&255;u%r===0&&D(n)}return o&&(e=u<<2,t=n[a],s[e]=255&t,o>1&&(s[e+1]=t>>8&255),o>2&&(s[e+2]=t>>16&255)),s},L.prototype=new I,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var D=function(e){var t,r,n,i,o,a,u,s,l,c,f,h,d,v,m,g,y,b,w,k,A,x,E,S,P,_,C,N,O,T,M,R,I,L,D,B,F,j,Z,U,z,q,K,H,G,V,W,J,Q,Y,X,$,ee,te,re,ne,ie,oe,ae,ue,se,le,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(s<<1|l>>>31),r=o^(l<<1|s>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(c<<1|f>>>31),r=u^(f<<1|c>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=s^(h<<1|d>>>31),r=l^(d<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=c^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],m=e[1],V=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,N=e[20]<<3|e[21]>>>29,O=e[21]<<3|e[20]>>>29,ue=e[31]<<9|e[30]>>>23,se=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,B=e[14]<<6|e[15]>>>26,F=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,I=e[44]<<29|e[45]>>>3,S=e[6]<<28|e[7]>>>4,P=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,Z=e[27]<<25|e[26]>>>7,k=e[36]<<21|e[37]>>>11,A=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,_=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,x=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=v^~g&b,e[1]=m^~y&w,e[10]=S^~_&N,e[11]=P^~C&O,e[20]=L^~B&j,e[21]=D^~F&Z,e[30]=H^~V&J,e[31]=G^~W&Q,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~b&k,e[3]=y^~w&A,e[12]=_^~N&T,e[13]=C^~O&M,e[22]=B^~j&U,e[23]=F^~Z&z,e[32]=V^~J&Y,e[33]=W^~Q&X,e[42]=ne^~oe&ue,e[43]=ie^~ae&se,e[4]=b^~k&x,e[5]=w^~A&E,e[14]=N^~T&R,e[15]=O^~M&I,e[24]=j^~U&q,e[25]=Z^~z&K,e[34]=J^~Y&$,e[35]=Q^~X&ee,e[44]=oe^~ue&le,e[45]=ae^~se&ce,e[6]=k^~x&v,e[7]=A^~E&m,e[16]=T^~R&S,e[17]=M^~I&P,e[26]=U^~q&L,e[27]=z^~K&D,e[36]=Y^~$&H,e[37]=X^~ee&G,e[46]=ue^~le&te,e[47]=se^~ce&re,e[8]=x^~v&g,e[9]=E^~m&y,e[18]=R^~S&_,e[19]=I^~P&C,e[28]=q^~L&B,e[29]=K^~D&F,e[38]=$^~H&V,e[39]=ee^~G&W,e[48]=le^~te&ne,e[49]=ce^~re&ie,e[0]^=p[n],e[1]^=p[n+1]};if(s)e.exports=P;else{for(C=0;C<_.length;++C)a[_[C]]=P[_[C]];l&&(void 0===(n=function(){return P}.call(t,r,t,e))||(e.exports=n))}}()},2325:function(e){function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},4463:function(e,t,r){"use strict";var n=r(2791),i=r(5296);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r