>>=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 k;else if("p224"===e)t=new E;else if("p192"===e)t=new j;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return w[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.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")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.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)},S.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},S.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)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.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(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(s);)l.redIAdd(s);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(u);){for(var v=h,m=0;0!==v.cmp(u);m++)v=v.redSqr();n(m=0;n--){for(var c=t.words[n],l=s-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[a]),u=0,a=0)):u=0}s=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new A(e)},i(A,S),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.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)},A.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)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(119)(e))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(22);function i(e,t,r){return(i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(n.a)(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}},function(e,t,r){"use strict";r.d(t,"e",(function(){return m})),r.d(t,"a",(function(){return g})),r.d(t,"c",(function(){return b})),r.d(t,"d",(function(){return y})),r.d(t,"b",(function(){return w})),r.d(t,"f",(function(){return O}));var n=r(1),i=r(103),o=r(56),a=r(62),u=r(162),s=r(163),c=r(164),l=r(165),f=r(166),d=r(167),h=r(168),p=r(169),v=(Object(n.a)(Object(n.a)(Object(n.a)(Object(n.a)(Object(n.a)(Object(n.a)(Object(n.a)(Object(n.a)(Object(n.a)({background:"$black",foreground:"$white",backgroundContrast:"$accents0"},u.b),s.b),c.b),l.b),f.b),d.b),h.b),p.b),{},{primaryLight:"$blue50",primaryLightHover:"$blue100",primaryLightActive:"$blue200",primaryLightContrast:"$blue600",secondaryLight:"$purple50",secondaryLightHover:"$purple100",secondaryLightActive:"$purple200",secondaryLightContrast:"$purple800",secondary:"$purple700",secondaryBorder:"$purple500",secondaryBorderHover:"$purple600",secondarySolidHover:"$purple700",secondaryShadow:"$purple500",successLight:"$green50",successLightHover:"$green100",successLightActive:"$green200",warningLight:"$yellow50",warningLightHover:"$yellow100",warningLightActive:"$yellow200",errorLight:"$red50",errorLightHover:"$red100",errorLightActive:"$red200",errorLightContrast:"$red700",neutralLight:"$gray200",neutralLightHover:"$gray300",neutralLightActive:"$gray400",neutralSolidContrast:"$white",text:"$gray900",link:"$blue700",codeLight:"$cyan50",code:"$cyan600",selection:"$pink800"}),r(87),Object(i.a)(Object(n.a)(Object(n.a)({},o.a),{},{theme:Object(n.a)(Object(n.a)({},o.a.theme),{},{shadows:Object(n.a)({},a.a.shadows),dropShadows:Object(n.a)({},a.a.dropShadows),colors:Object(n.a)(Object(n.a)({},o.a.theme.colors),a.a.colors)})}))),m=(v.createTheme,v.styled),g=v.css,b=v.globalCss,y=v.keyframes,w=v.getCssText,O=v.theme;v.config},function(e,t,r){"use strict";r.r(t),r.d(t,"keccak256",(function(){return a}));var n=r(131),i=r.n(n),o=r(2);function a(e){return"0x"+i.a.keccak_256(Object(o.arrayify)(e))}},function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"e",(function(){return a})),r.d(t,"a",(function(){return u})),r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return c}));var n=r(2),i=r(34);function o(e){return"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Object(n.arrayify)(e)}function a(e,t){for(e=String(e);e.length0&&(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,{})),y(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(d,g(t)):t.match(/^-?[0-9]+$/)?new e(d,g(new l(t))):f.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&w("underflow","BigNumber.from",t),(t>=h||t<=-h)&&w("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"===typeof r)return e.from(r.toString());if(Object(u.isBytes)(r))return e.from(Object(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&&(Object(u.isHexString)(i)||"-"===i[0]&&Object(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 b(e){return m.from(g(e))}function y(e){var t=m.from(e).toHexString();return"-"===t[0]?new l("-"+t.substring(3),16):new l(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 O(e){return new l(e,36).toString(16)}function k(e){return new l(e,16).toString(36)}},function(e,t,r){"use strict";r.r(t),r.d(t,"getAddress",(function(){return v})),r.d(t,"isAddress",(function(){return m})),r.d(t,"getIcapAddress",(function(){return g})),r.d(t,"getContractAddress",(function(){return b})),r.d(t,"getCreate2Address",(function(){return y}));var n=r(2),i=r(28),o=r(26),a=r(49),u=new(r(5).Logger)("address/5.7.0");function s(e){Object(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=Object(n.arrayify)(Object(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 c={},l=0;l<10;l++)c[String(l)]=String(l);for(var f=0;f<26;f++)c[String.fromCharCode(65+f)]=String(10+f);var d,h=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/Math.LN10));function p(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return c[e]})).join("");t.length>=h;){var r=t.substring(0,h);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=Object(i.c)(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=Object(i.b)(v(e).substring(2)).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t}function b(e){var t=null;try{t=v(e.from)}catch(s){u.throwArgumentError("missing from address","transaction",e)}var r=Object(n.stripZeros)(Object(n.arrayify)(i.a.from(e.nonce).toHexString()));return v(Object(n.hexDataSlice)(Object(o.keccak256)(Object(a.encode)([t,r])),12))}function y(e,t,r){return 32!==Object(n.hexDataLength)(t)&&u.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(n.hexDataLength)(r)&&u.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),v(Object(n.hexDataSlice)(Object(o.keccak256)(Object(n.concat)(["0xff",v(e),t,r])),12))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return E})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return y}));var n=r(18),i={mainnet:{name:"Etherscan",url:"https://etherscan.io"},ropsten:{name:"Etherscan",url:"https://ropsten.etherscan.io"},rinkeby:{name:"Etherscan",url:"https://rinkeby.etherscan.io"},goerli:{name:"Etherscan",url:"https://goerli.etherscan.io"},kovan:{name:"Etherscan",url:"https://kovan.etherscan.io"},sepolia:{name:"Etherscan",url:"https://sepolia.etherscan.io"},optimism:{name:"Etherscan",url:"https://optimistic.etherscan.io"},optimismKovan:{name:"Etherscan",url:"https://kovan-optimistic.etherscan.io"},polygon:{name:"PolygonScan",url:"https://polygonscan.com"},polygonMumbai:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},arbitrum:{name:"Arbiscan",url:"https://arbiscan.io"},arbitrumRinkeby:{name:"Arbiscan",url:"https://testnet.arbiscan.io"}},o=3,a=4,u=5,s=42,c=11155111,l=10,f=69,d=420,h=137,p=80001,v=42161,m=421611,g=421613,b={id:1,name:"Ethereum",network:"homestead",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.a.mainnet,default:n.c.mainnet,infura:n.b.mainnet,public:n.c.mainnet},blockExplorers:{etherscan:i.mainnet,default:i.mainnet},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}},y={id:o,name:"Ropsten",network:"ropsten",nativeCurrency:{name:"Ropsten Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.a.ropsten,default:n.c.ropsten,infura:n.b.ropsten,public:n.c.ropsten},blockExplorers:{etherscan:i.ropsten,default:i.ropsten},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:12063863},testnet:!0},w={id:a,name:"Rinkeby",network:"rinkeby",nativeCurrency:{name:"Rinkeby Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.a.rinkeby,default:n.c.rinkeby,infura:n.b.rinkeby,public:n.c.rinkeby},blockExplorers:{etherscan:i.rinkeby,default:i.rinkeby},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10299530},testnet:!0},O={id:u,name:"Goerli",network:"goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.a.goerli,default:n.c.goerli,infura:n.b.goerli,public:n.c.goerli},blockExplorers:{etherscan:i.goerli,default:i.goerli},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670},testnet:!0},k={id:s,name:"Kovan",network:"kovan",nativeCurrency:{name:"Kovan Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.a.kovan,default:n.c.kovan,infura:n.b.kovan,public:n.c.kovan},blockExplorers:{etherscan:i.kovan,default:i.kovan},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:30285908},testnet:!0},E=(n.c.sepolia,n.b.sepolia,n.c.sepolia,n.a.optimism,n.c.optimism,n.b.optimism,n.c.optimism,n.a.optimismKovan,n.c.optimismKovan,n.b.optimismKovan,n.c.optimismKovan,n.a.optimismGoerli,n.c.optimismGoerli,n.b.optimismGoerli,n.c.optimismGoerli,n.a.polygon,n.c.polygon,n.b.polygon,n.c.polygon,n.a.polygonMumbai,n.c.polygonMumbai,n.b.polygonMumbai,n.c.polygonMumbai,n.a.arbitrum,n.c.arbitrum,n.b.arbitrum,n.c.arbitrum,n.a.arbitrumRinkeby,n.c.arbitrumRinkeby,n.b.arbitrumRinkeby,n.c.arbitrumRinkeby,n.a.arbitrumGoerli,n.c.arbitrumGoerli,n.b.arbitrumGoerli,n.c.arbitrumGoerli,[b,y,w,O,k])},function(e,t,r){"use strict";r.d(t,"d",(function(){return f})),r.d(t,"a",(function(){return d})),r.d(t,"c",(function(){return h})),r.d(t,"b",(function(){return p}));var n=r(6),i=r(7),o=r(2),a=r(28),u=r(4),s=r(5),c=r(55),l=new s.Logger(c.a);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 d=function(){function e(t,r,i,o){Object(n.a)(this,e),this.name=t,this.type=r,this.localName=i,this.dynamic=o}return Object(i.a)(e,[{key:"_throwError",value:function(e,t){l.throwArgumentError(e,this.localName,t)}}]),e}(),h=function(){function e(t){Object(n.a)(this,e),Object(u.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return Object(i.a)(e,[{key:"data",get:function(){return Object(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(Object(o.concat)(e._data))}},{key:"writeBytes",value:function(e){var t=Object(o.arrayify)(e),r=t.length%this.wordSize;return r&&(t=Object(o.concat)([t,this._padding.slice(r)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=Object(o.arrayify)(a.a.from(e));return t.length>this.wordSize&&l.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(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){Object(n.a)(this,e),Object(u.defineReadOnly)(this,"_data",Object(o.arrayify)(t)),Object(u.defineReadOnly)(this,"wordSize",r||32),Object(u.defineReadOnly)(this,"_coerceFunc",i),Object(u.defineReadOnly)(this,"allowLoose",a),this._offset=0}return Object(i.a)(e,[{key:"data",get:function(){return Object(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:l.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.a.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}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return c}));var n=r(8),i=r(0);function o(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function a(e,t,r){var o=Object(i.useState)(e||t),a=Object(n.a)(o,2),u=a[0],s=a[1],c=Object(i.useRef)(void 0!==e),l=c.current,f=void 0!==e,d=Object(i.useRef)(u);l!==f&&console.warn("WARN: A component changed from ".concat(l?"controlled":"uncontrolled"," to ").concat(f?"controlled":"uncontrolled",".")),c.current=f;var h=Object(i.useCallback)((function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i1?r-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:-1/0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Math.min(Math.max(e,t),r);return n}function c(e,t,r,n){var i=(e-(isNaN(t)?0:t))%n,o=2*Math.abs(i)>=n?e+Math.sign(i)*(n-Math.abs(i)):e-i;isNaN(t)?!isNaN(r)&&o>r&&(o=Math.floor(r/n)*n):or&&(o=t+Math.floor((r-t)/n)*n);var a=n.toString(),u=a.indexOf("."),s=u>=0?a.length-u:0;if(s>0){var c=Math.pow(10,s);o=Math.round(o*c)/c}return o}function l(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,n=Math.pow(r,t);return Math.round(e*n)/n}o(u,"clamp",(function(){return s})),o(u,"snapValueToStep",(function(){return c})),o(u,"toFixedNumber",(function(){return l}))},function(e,t,r){"use strict";t.a=function(e,t){return e.defaultProps=t,e}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return s})),r.d(t,"f",(function(){return l})),r.d(t,"d",(function(){return d})),r.d(t,"e",(function(){return h})),r.d(t,"h",(function(){return p})),r.d(t,"g",(function(){return v}));var n,i,o=r(2),a=new(r(5).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 c(e,t){null==t&&(t=s.error),e=Object(o.arrayify)(e);for(var r=[],n=0;n>7!==0){var u=null,c=null;if(192===(224&a))u=1,c=127;else if(224===(240&a))u=2,c=2047;else{if(240!==(248&a)){n+=t(128===(192&a)?i.UNEXPECTED_CONTINUE:i.BAD_PREFIX,n-1,e,r);continue}u=3,c=65535}if(n-1+u>=e.length)n+=t(i.OVERRUN,n-1,e,r);else{for(var l=a&(1<<8-u-1)-1,f=0;f1114111?n+=t(i.OUT_OF_RANGE,n-1-u,e,r,l):l>=55296&&l<=57343?n+=t(i.UTF16_SURROGATE,n-1-u,e,r,l):l<=c?n+=t(i.OVERLONG,n-1-u,e,r,l):r.push(l))}}else r.push(a)}return r}function l(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 c=65536+((1023&u)<<10)+(1023&s);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(63&c|128)}else r.push(u>>12|224),r.push(u>>6&63|128),r.push(63&u|128)}return Object(o.arrayify)(r)}function f(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function d(e,t){return'"'+c(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 h(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 h(c(e,t))}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.current;return c(l(e,t))}},function(e,t,r){"use strict";r.r(t),r.d(t,"TransactionTypes",(function(){return n})),r.d(t,"computeAddress",(function(){return b})),r.d(t,"recoverAddress",(function(){return y})),r.d(t,"accessListify",(function(){return k})),r.d(t,"serialize",(function(){return S})),r.d(t,"parse",(function(){return P}));var n,i=r(29),o=r(28),a=r(2),u=r(57),s=r(26),c=r(4),l=r(49),f=r(52),d=r(5),h=new d.Logger("transactions/5.7.0");function p(e){return"0x"===e?null:Object(i.getAddress)(e)}function v(e){return"0x"===e?u.h:o.a.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 b(e){var t=Object(f.computePublicKey)(e);return Object(i.getAddress)(Object(a.hexDataSlice)(Object(s.keccak256)(Object(a.hexDataSlice)(t,1)),12))}function y(e,t){return b(Object(f.recoverPublicKey)(Object(a.arrayify)(e),t))}function w(e,t){var r=Object(a.stripZeros)(o.a.from(e).toHexString());return r.length>32&&h.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function O(e,t){return{address:Object(i.getAddress)(e),storageKeys:(t||[]).map((function(t,r){return 32!==Object(a.hexDataLength)(t)&&h.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function k(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&h.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),O(e[0],e[1])):O(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 O(t,Object.keys(r).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function E(e){return k(e).map((function(e){return[e.address,e.storageKeys]}))}function j(e,t){if(null!=e.gasPrice){var r=o.a.from(e.gasPrice),n=o.a.from(e.maxFeePerGas||0);r.eq(n)||h.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?Object(i.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",E(e.accessList||[])];if(t){var s=Object(a.splitSignature)(t);u.push(w(s.recoveryParam,"recoveryParam")),u.push(Object(a.stripZeros)(s.r)),u.push(Object(a.stripZeros)(s.s))}return Object(a.hexConcat)(["0x02",l.encode(u)])}function x(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?Object(i.getAddress)(e.to):"0x",w(e.value||0,"value"),e.data||"0x",E(e.accessList||[])];if(t){var n=Object(a.splitSignature)(t);r.push(w(n.recoveryParam,"recoveryParam")),r.push(Object(a.stripZeros)(n.r)),r.push(Object(a.stripZeros)(n.s))}return Object(a.hexConcat)(["0x01",l.encode(r)])}function S(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&h.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){Object(c.checkProperties)(e,g);var r=[];m.forEach((function(t){var n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=Object(a.arrayify)(Object(a.hexlify)(n,i)),t.length&&n.length!==t.length&&n.length>0&&h.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(a.stripZeros)(n)).length>t.maxLength&&h.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push(Object(a.hexlify)(n))}));var n=0;if(null!=e.chainId?"number"!==typeof(n=e.chainId)&&h.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!Object(a.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(a.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return l.encode(r);var i=Object(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&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(a.hexlify)(o)),r.push(Object(a.stripZeros)(Object(a.arrayify)(i.r))),r.push(Object(a.stripZeros)(Object(a.arrayify)(i.s))),l.encode(r)}(e,t);switch(e.type){case 1:return x(e,t);case 2:return j(e,t)}return h.throwError("unsupported transaction type: ".concat(e.type),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function A(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){h.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(a.hexZeroPad)(t[1],32),e.s=Object(a.hexZeroPad)(t[2],32);try{var i=Object(s.keccak256)(r(e));e.from=y(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(o){}}function P(e){var t=Object(a.arrayify)(e);if(t[0]>127)return function(e){var t=l.decode(e);9!==t.length&&6!==t.length&&h.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.a.from(t[6]).toNumber()}catch(c){return r}if(r.r=Object(a.hexZeroPad)(t[7],32),r.s=Object(a.hexZeroPad)(t[8],32),o.a.from(r.r).isZero()&&o.a.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=t.slice(0,6);0!==r.chainId&&(i.push(Object(a.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var u=Object(s.keccak256)(l.encode(i));try{r.from=y(u,{r:Object(a.hexlify)(r.r),s:Object(a.hexlify)(r.s),recoveryParam:n})}catch(c){}r.hash=Object(s.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){var t=l.decode(e.slice(1));8!==t.length&&11!==t.length&&h.throwArgumentError("invalid component count for transaction type: 1","payload",Object(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:k(t[7])};return 8===t.length||(r.hash=Object(s.keccak256)(e),A(r,t.slice(8),x)),r}(t);case 2:return function(e){var t=l.decode(e.slice(1));9!==t.length&&12!==t.length&&h.throwArgumentError("invalid component count for transaction type: 2","payload",Object(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:k(t[8])};return 9===t.length||(i.hash=Object(s.keccak256)(e),A(i,t.slice(9),j)),i}(t)}return h.throwError("unsupported transaction type: ".concat(t[0]),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},function(e,t,r){"use strict";r.d(t,"d",(function(){return g})),r.d(t,"g",(function(){return y})),r.d(t,"e",(function(){return O})),r.d(t,"c",(function(){return k})),r.d(t,"a",(function(){return S})),r.d(t,"f",(function(){return A})),r.d(t,"b",(function(){return C}));var n=r(9),i=r(10),o=r(6),a=r(7),u=r(28),s=r(4),c=r(5),l=r(55),f=new c.Logger(l.a),d={},h={calldata:!0,memory:!0,storage:!0},p={calldata:!0,memory:!0};function v(e,t){if("bytes"===e||"string"===e){if(h[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&p[t])return!0;return(h[t]||"payable"===t)&&f.throwArgumentError("invalid modifier","name",t),!1}function m(e,t){for(var r in t)Object(s.defineReadOnly)(e,r,t[r])}var g=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),b=new RegExp(/^(.*)\[([0-9]*)\]$/),y=function(){function e(t,r){Object(o.a)(this,e),t!==d&&f.throwError("use fromString",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),m(this,r);var n=this.type.match(b);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 Object(a.a)(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(d,{name:t.name||null,type:T(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.a.from(r[1]),r[0]):e}function j(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 x(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 S=function(e){Object(n.a)(r,e);var t=Object(i.a)(r);function r(){return Object(o.a)(this,r),t.apply(this,arguments)}return Object(a.a)(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",c.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=x(e);t.constant&&f.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(y.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?u.a.from(e.gas):null};return new r(d,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=E(e,t)).match(N);return n&&"constructor"===n[1].trim()||f.throwArgumentError("invalid constructor string","value",e),t.inputs=w(n[2].trim(),!1),j(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(O),A=function(e){Object(n.a)(r,e);var t=Object(i.a)(r);function r(){return Object(o.a)(this,r),t.apply(this,arguments)}return Object(a.a)(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=x(e),n={type:e.type,name:R(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(y.fromObject):[],outputs:e.outputs?e.outputs.map(y.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?u.a.from(e.gas):null};return new r(d,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=E(e,t)).split(" returns ");n.length>2&&f.throwArgumentError("invalid function string","value",e);var i=n[0].match(N);if(i||f.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&R(t.name),t.inputs=w(i[2],!1),j(i[3].trim(),t),n.length>1){var o=n[1].match(N);""==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}(S);function P(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 C=function(e){Object(n.a)(r,e);var t=Object(i.a)(r);function r(){return Object(o.a)(this,r),t.apply(this,arguments)}return Object(a.a)(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:R(e.name),inputs:e.inputs?e.inputs.map(y.fromObject):[]};return P(new r(d,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(N);return n||f.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&R(t.name),t.inputs=w(n[2],!1),P(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(O);function T(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var M=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function R(e){return e&&e.match(M)||f.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var N=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},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(118);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(29);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(91));t.base64=s;var c=r(60);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return c.Base58}});var l=r(2);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return l.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return l.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return l.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return l.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return l.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return l.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return l.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return l.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return l.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return l.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return l.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return l.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return l.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return l.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return l.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return l.stripZeros}});var f=r(66);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 d=r(43);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var h=r(104);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return h.getJsonWalletAddress}});var p=r(26);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return p.keccak256}});var v=r(5);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return v.Logger}});var m=r(67);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(159);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 b=r(92);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return b.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return b.shuffled}});var y=r(4);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return y.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return y.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return y.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return y.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return y.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return y.shallowCopy}});var w=o(r(49));t.RLP=w;var O=r(52);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return O.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return O.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return O.SigningKey}});var k=r(44);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return k.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return k.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return k.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return k._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return k.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return k.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return k.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return k.Utf8ErrorFuncs}});var E=r(35);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return E.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return E.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return E.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return E.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return E.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return E.TransactionTypes}});var j=r(160);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return j.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return j.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return j.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return j.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return j.parseUnits}});var x=r(93);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return x.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return x.verifyTypedData}});var S=r(40);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return S._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return S.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return S.poll}});var A=r(67);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return A.SupportedAlgorithm}});var P=r(44);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return P.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return P.Utf8ErrorReason}})},function(e,t,r){"use strict";r.r(t);var n=r(28);r.d(t,"BigNumber",(function(){return n.a}));var i=r(83);r.d(t,"formatFixed",(function(){return i.c})),r.d(t,"FixedFormat",(function(){return i.a})),r.d(t,"FixedNumber",(function(){return i.b})),r.d(t,"parseFixed",(function(){return i.d})),r.d(t,"_base16To36",(function(){return n.b})),r.d(t,"_base36To16",(function(){return n.c}))},function(e,t,r){"use strict";function n(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);var a="object"===typeof e?e.throttleCallback:null,l="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;h.assertArgument(l>0&&l%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",l);var m="object"===typeof e&&!!e.errorPassThrough,g={},b=null,y={method:"GET"},w=!1,O=12e4;if("string"===typeof e)b=e;else if("object"===typeof e){if(null!=e&&null!=e.url||h.throwArgumentError("missing URL","connection.url",e),b=e.url,"number"===typeof e.timeout&&e.timeout>0&&(O=e.timeout),e.headers)for(var k in e.headers)g[k.toLowerCase()]={key:k,value:String(e.headers[k])},["if-none-match","if-modified-since"].indexOf(k.toLowerCase())>=0&&(w=!0);if(y.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==b.substring(0,6)&&!0!==e.allowInsecureAuthentication&&h.throwError("basic authentication requires a secure https url",c.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:b,user:e.user,password:"[REDACTED]"});var E=e.user+":"+e.password;g.authorization={key:"Authorization",value:"Basic "+Object(o.b)(Object(s.f)(E))}}null!=e.skipFetchSetup&&(y.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(y.fetchOptions=Object(u.shallowCopy)(e.fetchOptions))}var j,x=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),S=b?b.match(x):null;if(S)try{var A={statusCode:200,statusMessage:"OK",headers:{"content-type":S[1]||"text/plain"},body:S[2]?Object(o.a)(S[3]):(j=S[3],Object(s.f)(j.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},P=A.body;return r&&(P=r(A.body,A)),Promise.resolve(P)}catch(R){h.throwError("processing response error",c.Logger.errors.SERVER_ERROR,{body:v(S[1],S[2]),error:R,requestBody:null,requestMethod:"GET",url:b})}t&&(y.method="POST",y.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 C={};Object.keys(g).forEach((function(e){var t=g[e];C[t.key]=t.value})),y.headers=C;var T=function(){var e=null;return{promise:new Promise((function(t,r){O&&(e=setTimeout((function(){null!=e&&(e=null,r(h.makeError("timeout",c.Logger.errors.TIMEOUT,{requestBody:v(y.body,C["content-type"]),requestMethod:y.method,timeout:O,url:b})))}),O))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),M=function(){return d(this,void 0,void 0,i.a.mark((function e(){var t,o,u,s,d,g,O,k,E,j;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(T.cancel(),h.throwError("bad response",c.Logger.errors.SERVER_ERROR,{status:o.statusCode,headers:o.headers,body:v(O,o.headers?o.headers["content-type"]:null),requestBody:v(y.body,C["content-type"]),requestMethod:y.method,url:b})),!r){e.next=60;break}return e.prev=37,e.next=40,r(O,o);case 40:return k=e.sent,T.cancel(),e.abrupt("return",k);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 c=t.interval*parseInt(String(Math.random()*Math.pow(2,s)));ct.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&n(e)}))}()}))}},function(e,t,r){var n=t;n.utils=r(54),n.common=r(82),n.sha=r(145),n.ripemd=r(149),n.hmac=r(150),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";r.d(t,"c",(function(){return N})),r.d(t,"b",(function(){return V})),r.d(t,"a",(function(){return Q})),r.d(t,"d",(function(){return Z})),r.d(t,"e",(function(){return ee})),r.d(t,"f",(function(){return ue})),r.d(t,"g",(function(){return le})),r.d(t,"h",(function(){return E}));var n=r(12),i=r(17),o=r(1),a=r(8),u=r(15),s=r(6),c=r(7),l=r(20),f=r(0),d=r.n(f);function h(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}h({},"Pressable",(function(){return M}));h({},"usePress",(function(){return E}));var p="default",v="",m=new WeakMap;function g(e){Object(l.e)()?("default"===p&&(v=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),p="disabled"):e&&(m.set(e,e.style.userSelect),e.style.userSelect="none")}function b(e){if(Object(l.e)()){if("disabled"!==p)return;p="restoring",setTimeout((function(){Object(l.h)((function(){"restoring"===p&&("none"===document.documentElement.style.webkitUserSelect&&(document.documentElement.style.webkitUserSelect=v||""),v="",p="default")}))}),300)}else if(e&&m.has(e)){var t=m.get(e);"none"===e.style.userSelect&&(e.style.userSelect=t),""===e.getAttribute("style")&&e.removeAttribute("style"),m.delete(e)}}function y(e){return!(0!==e.mozInputSource||!e.isTrusted)||0===e.detail&&!e.pointerType}var w=function(){function e(t,r){Object(s.a)(this,e),this.nativeEvent=r,this.target=r.target,this.currentTarget=r.currentTarget,this.relatedTarget=r.relatedTarget,this.bubbles=r.bubbles,this.cancelable=r.cancelable,this.defaultPrevented=r.defaultPrevented,this.eventPhase=r.eventPhase,this.isTrusted=r.isTrusted,this.timeStamp=r.timeStamp,this.type=t}return Object(c.a)(e,[{key:"isDefaultPrevented",value:function(){return this.nativeEvent.defaultPrevented}},{key:"preventDefault",value:function(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=function(){return!0}}},{key:"isPropagationStopped",value:function(){return!1}},{key:"persist",value:function(){}}]),e}();function O(e){var t=Object(f.useRef)({isFocused:!1,onBlur:e,observer:null});return t.current.onBlur=e,Object(l.n)((function(){var e=t.current;return function(){e.observer&&(e.observer.disconnect(),e.observer=null)}}),[]),Object(f.useCallback)((function(e){if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;var r=e.target;r.addEventListener("focusout",(function(e){var n,i;t.current.isFocused=!1,r.disabled&&(null===(i=(n=t.current).onBlur)||void 0===i||i.call(n,new w("blur",e))),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)}),{once:!0}),t.current.observer=new MutationObserver((function(){t.current.isFocused&&r.disabled&&(t.current.observer.disconnect(),r.dispatchEvent(new FocusEvent("blur")),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0})))})),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}}),[])}var k=d.a.createContext(null);function E(e){var t=function(e){var t=Object(f.useContext)(k);if(t){var r=t.register,n=Object(u.a)(t,["register"]);e=Object(l.g)(n,e),r()}return Object(l.o)(t,e.ref),e}(e),r=t.onPress,n=t.onPressChange,i=t.onPressStart,o=t.onPressEnd,s=t.onPressUp,c=t.isDisabled,d=t.isPressed,h=t.preventFocusOnPress,p=t.shouldCancelOnPointerExit,v=t.allowTextSelectionOnPress,m=(t.ref,Object(u.a)(t,["onPress","onPressChange","onPressStart","onPressEnd","onPressUp","isDisabled","isPressed","preventFocusOnPress","shouldCancelOnPointerExit","allowTextSelectionOnPress","ref"])),w=Object(f.useRef)(null);w.current={onPress:r,onPressChange:n,onPressStart:i,onPressEnd:o,onPressUp:s,isDisabled:c,shouldCancelOnPointerExit:p};var O=Object(f.useState)(!1),E=Object(a.a)(O,2),M=E[0],R=E[1],N=Object(f.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),_=Object(l.k)(),L=_.addGlobalListener,I=_.removeAllGlobalListeners,B=Object(f.useMemo)((function(){var e=N.current,t=function(t,r){var n=w.current,i=n.onPressStart,o=n.onPressChange;n.isDisabled||e.didFirePressStart||(i&&i({type:"pressstart",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),o&&o(!0),e.didFirePressStart=!0,R(!0))},r=function(t,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=w.current,o=i.onPressEnd,a=i.onPressChange,u=i.onPress,s=i.isDisabled;e.didFirePressStart&&(e.ignoreClickAfterPress=!0,e.didFirePressStart=!1,o&&o({type:"pressend",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),a&&a(!1),R(!1),u&&n&&!s&&u({type:"press",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}))},n=function(e,t){var r=w.current,n=r.onPressUp;r.isDisabled||n&&n({type:"pressup",pointerType:t,target:e.currentTarget,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},i=function(t){e.isPressed&&(e.isOverTarget&&r(A(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,I(),v||b(e.target))},o={onKeyDown:function(r){x(r.nativeEvent)&&r.currentTarget.contains(r.target)&&(T(r.target)&&r.preventDefault(),r.stopPropagation(),e.isPressed||r.repeat||(e.target=r.currentTarget,e.isPressed=!0,t(r,"keyboard"),L(document,"keyup",a,!1)))},onKeyUp:function(t){x(t.nativeEvent)&&!t.repeat&&t.currentTarget.contains(t.target)&&n(A(e.target,t),"keyboard")},onClick:function(i){i&&!i.currentTarget.contains(i.target)||i&&0===i.button&&(i.stopPropagation(),c&&i.preventDefault(),e.ignoreClickAfterPress||e.ignoreEmulatedMouseEvents||"virtual"!==e.pointerType&&!y(i.nativeEvent)||(c||h||Object(l.c)(i.currentTarget),t(i,"virtual"),n(i,"virtual"),r(i,"virtual")),e.ignoreEmulatedMouseEvents=!1,e.ignoreClickAfterPress=!1)}},a=function(t){if(e.isPressed&&x(t)){T(t.target)&&t.preventDefault(),t.stopPropagation(),e.isPressed=!1;var n=t.target;r(A(e.target,t),"keyboard",e.target.contains(n)),I(),(e.target.contains(n)&&j(e.target)||"link"===e.target.getAttribute("role"))&&e.target.click()}};if("undefined"!==typeof PointerEvent){o.onPointerDown=function(r){var n;0===r.button&&r.currentTarget.contains(r.target)&&(0===(n=r.nativeEvent).width&&0===n.height||1===n.width&&1===n.height&&0===n.pressure&&0===n.detail&&"mouse"===n.pointerType?e.pointerType="virtual":(C(r.currentTarget)&&r.preventDefault(),e.pointerType=r.pointerType,r.stopPropagation(),e.isPressed||(e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=r.pointerId,e.target=r.currentTarget,c||h||Object(l.c)(r.currentTarget),v||g(e.target),t(r,e.pointerType),L(document,"pointermove",u,!1),L(document,"pointerup",s,!1),L(document,"pointercancel",f,!1))))},o.onMouseDown=function(e){e.currentTarget.contains(e.target)&&0===e.button&&(C(e.currentTarget)&&e.preventDefault(),e.stopPropagation())},o.onPointerUp=function(t){t.currentTarget.contains(t.target)&&"virtual"!==e.pointerType&&0===t.button&&P(t,t.currentTarget)&&n(t,e.pointerType||t.pointerType)};var u=function(n){n.pointerId===e.activePointerId&&(P(n,e.target)?e.isOverTarget||(e.isOverTarget=!0,t(A(e.target,n),e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,r(A(e.target,n),e.pointerType,!1),w.current.shouldCancelOnPointerExit&&i(n)))},s=function(t){t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&(P(t,e.target)?r(A(e.target,t),e.pointerType):e.isOverTarget&&r(A(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,I(),v||b(e.target))},f=function(e){i(e)};o.onDragStart=function(e){e.currentTarget.contains(e.target)&&i(e)}}else{o.onMouseDown=function(r){0===r.button&&r.currentTarget.contains(r.target)&&(C(r.currentTarget)&&r.preventDefault(),r.stopPropagation(),e.ignoreEmulatedMouseEvents||(e.isPressed=!0,e.isOverTarget=!0,e.target=r.currentTarget,e.pointerType=y(r.nativeEvent)?"virtual":"mouse",c||h||Object(l.c)(r.currentTarget),t(r,e.pointerType),L(document,"mouseup",d,!1)))},o.onMouseEnter=function(r){r.currentTarget.contains(r.target)&&(r.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!0,t(r,e.pointerType)))},o.onMouseLeave=function(t){t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!1,r(t,e.pointerType,!1),w.current.shouldCancelOnPointerExit&&i(t)))},o.onMouseUp=function(t){t.currentTarget.contains(t.target)&&(e.ignoreEmulatedMouseEvents||0!==t.button||n(t,e.pointerType))};var d=function(t){0===t.button&&(e.isPressed=!1,I(),e.ignoreEmulatedMouseEvents?e.ignoreEmulatedMouseEvents=!1:(P(t,e.target)?r(A(e.target,t),e.pointerType):e.isOverTarget&&r(A(e.target,t),e.pointerType,!1),e.isOverTarget=!1))};o.onTouchStart=function(r){if(r.currentTarget.contains(r.target)){r.stopPropagation();var n=function(e){var t=e.targetTouches;return t.length>0?t[0]:null}(r.nativeEvent);n&&(e.activePointerId=n.identifier,e.ignoreEmulatedMouseEvents=!0,e.isOverTarget=!0,e.isPressed=!0,e.target=r.currentTarget,e.pointerType="touch",c||h||Object(l.c)(r.currentTarget),v||g(e.target),t(r,e.pointerType),L(window,"scroll",p,!0))}},o.onTouchMove=function(n){if(n.currentTarget.contains(n.target)&&(n.stopPropagation(),e.isPressed)){var o=S(n.nativeEvent,e.activePointerId);o&&P(o,n.currentTarget)?e.isOverTarget||(e.isOverTarget=!0,t(n,e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,r(n,e.pointerType,!1),w.current.shouldCancelOnPointerExit&&i(n))}},o.onTouchEnd=function(t){if(t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed)){var i=S(t.nativeEvent,e.activePointerId);i&&P(i,t.currentTarget)?(n(t,e.pointerType),r(t,e.pointerType)):e.isOverTarget&&r(t,e.pointerType,!1),e.isPressed=!1,e.activePointerId=null,e.isOverTarget=!1,e.ignoreEmulatedMouseEvents=!0,v||b(e.target),I()}},o.onTouchCancel=function(t){t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&i(t))};var p=function(t){e.isPressed&&t.target.contains(e.target)&&i({currentTarget:e.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};o.onDragStart=function(e){e.currentTarget.contains(e.target)&&i(e)}}return o}),[L,c,h,I,v]);return Object(f.useEffect)((function(){return function(){v||b(N.current.target)}}),[v]),{isPressed:d||M,pressProps:Object(l.g)(m,B)}}function j(e){return"A"===e.tagName&&e.hasAttribute("href")}function x(e){var t=e.key,r=e.code,n=e.target,i=n.tagName,o=n.isContentEditable,a=n.getAttribute("role");return("Enter"===t||" "===t||"Spacebar"===t||"Space"===r)&&"INPUT"!==i&&"TEXTAREA"!==i&&!0!==o&&(!j(n)||"button"===a&&"Enter"!==t)&&!("link"===a&&"Enter"!==t)}function S(e,t){for(var r=e.changedTouches,n=0;nn.right||n.left>r.right)&&!(r.top>n.bottom||n.top>r.bottom)}function C(e){return!e.draggable}function T(e){return!(("INPUT"===e.tagName||"BUTTON"===e.tagName)&&"submit"===e.type)}k.displayName="PressResponderContext";var M=d.a.forwardRef((function(e,t){var r=e.children,n=Object(u.a)(e,["children"]),i=Object(f.useRef)();t=null!==t&&void 0!==t?t:i;var a=E(Object(o.a)(Object(o.a)({},n),{},{ref:t})).pressProps,s=d.a.Children.only(r);return d.a.cloneElement(s,Object(o.a)({ref:t},Object(l.g)(s.props,a)))}));h({},"PressResponder",(function(){return R}));var R=d.a.forwardRef((function(e,t){var r=e.children,n=Object(u.a)(e,["children"]),i=Object(f.useRef)(!1),a=Object(f.useContext)(k),s=Object(l.g)(a||{},Object(o.a)(Object(o.a)({},n),{},{ref:t||(null===a||void 0===a?void 0:a.ref),register:function(){i.current=!0,a&&a.register()}}));return Object(l.o)(a,t),Object(f.useEffect)((function(){i.current||console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with component.")}),[]),d.a.createElement(k.Provider,{value:s},r)}));function N(e){var t=e.isDisabled,r=e.onFocus,n=e.onBlur,i=e.onFocusChange,o=Object(f.useCallback)((function(e){if(e.target===e.currentTarget)return n&&n(e),i&&i(!1),!0}),[n,i]),a=O(o),u=Object(f.useCallback)((function(e){e.target===e.currentTarget&&(r&&r(e),i&&i(!0),a(e))}),[i,r,a]);return{focusProps:{onFocus:!t&&(r||i||n)?u:void 0,onBlur:t||!n&&!i?null:o}}}h({},"useFocus",(function(){return N}));var _={};h(_,"isFocusVisible",(function(){return V})),h(_,"getInteractionModality",(function(){return Q})),h(_,"setInteractionModality",(function(){return J})),h(_,"useInteractionModality",(function(){return Y})),h(_,"useFocusVisible",(function(){return X})),h(_,"useFocusVisibleListener",(function(){return Z}));var L=null,I=new Set,B=!1,D=!1,F=!1,U={Tab:!0,Escape:!0};function $(e,t){var r,n=Object(i.a)(I);try{for(n.s();!(r=n.n()).done;){(0,r.value)(e,t)}}catch(o){n.e(o)}finally{n.f()}}function H(e){D=!0,function(e){return!(e.metaKey||!Object(l.f)()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(L="keyboard",$("keyboard",e))}function z(e){L="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(D=!0,$("pointer",e))}function K(e){y(e)&&(D=!0,L="virtual")}function W(e){e.target!==window&&e.target!==document&&(D||F||(L="virtual",$("virtual",e)),D=!1,F=!1)}function G(){D=!1,F=!0}function q(){if("undefined"!==typeof window&&!B){var e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){D=!0,e.apply(this,arguments)},document.addEventListener("keydown",H,!0),document.addEventListener("keyup",H,!0),document.addEventListener("click",K,!0),window.addEventListener("focus",W,!0),window.addEventListener("blur",G,!1),"undefined"!==typeof PointerEvent?(document.addEventListener("pointerdown",z,!0),document.addEventListener("pointermove",z,!0),document.addEventListener("pointerup",z,!0)):(document.addEventListener("mousedown",z,!0),document.addEventListener("mousemove",z,!0),document.addEventListener("mouseup",z,!0)),B=!0}}function V(){return"pointer"!==L}function Q(){return L}function J(e){L=e,$(e,null)}function Y(){q();var e=Object(f.useState)(L),t=Object(a.a)(e,2),r=t[0],n=t[1];return Object(f.useEffect)((function(){var e=function(){n(L)};return I.add(e),function(){I.delete(e)}}),[]),r}function X(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isTextInput,r=e.autoFocus,n=Object(f.useState)(r||V()),i=Object(a.a)(n,2),o=i[0],u=i[1];return Z((function(e){u(e)}),[t],{isTextInput:t}),{isFocusVisible:o}}function Z(e,t,r){q(),Object(f.useEffect)((function(){var t=function(t,n){(function(e,t,r){return!(e&&"keyboard"===t&&r instanceof KeyboardEvent&&!U[r.key])})(null===r||void 0===r?void 0:r.isTextInput,t,n)&&e(V())};return I.add(t),function(){I.delete(t)}}),t)}"undefined"!==typeof document&&("loading"!==document.readyState?q():document.addEventListener("DOMContentLoaded",q));function ee(e){var t=e.isDisabled,r=e.onBlurWithin,n=e.onFocusWithin,i=e.onFocusWithinChange,o=Object(f.useRef)({isFocusWithin:!1}),a=Object(f.useCallback)((function(e){o.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(o.current.isFocusWithin=!1,r&&r(e),i&&i(!1))}),[r,i,o]),u=O(a),s=Object(f.useCallback)((function(e){o.current.isFocusWithin||(n&&n(e),i&&i(!0),o.current.isFocusWithin=!0,u(e))}),[n,i,u]);return t?{focusWithinProps:{onFocus:null,onBlur:null}}:{focusWithinProps:{onFocus:s,onBlur:a}}}h({},"useFocusWithin",(function(){return ee}));h({},"useHover",(function(){return ae}));var te=!1,re=0;function ne(){te=!0,setTimeout((function(){te=!1}),50)}function ie(e){"touch"===e.pointerType&&ne()}function oe(){if("undefined"!==typeof document)return"undefined"!==typeof PointerEvent?document.addEventListener("pointerup",ie):document.addEventListener("touchend",ne),re++,function(){--re>0||("undefined"!==typeof PointerEvent?document.removeEventListener("pointerup",ie):document.removeEventListener("touchend",ne))}}function ae(e){var t=e.onHoverStart,r=e.onHoverChange,n=e.onHoverEnd,i=e.isDisabled,o=Object(f.useState)(!1),u=Object(a.a)(o,2),s=u[0],c=u[1],l=Object(f.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;Object(f.useEffect)(oe,[]);var d=Object(f.useMemo)((function(){var e=function(e,n){if(l.pointerType=n,!i&&"touch"!==n&&!l.isHovered&&e.currentTarget.contains(e.target)){l.isHovered=!0;var o=e.currentTarget;l.target=o,t&&t({type:"hoverstart",target:o,pointerType:n}),r&&r(!0),c(!0)}},o=function(e,t){if(l.pointerType="",l.target=null,"touch"!==t&&l.isHovered){l.isHovered=!1;var i=e.currentTarget;n&&n({type:"hoverend",target:i,pointerType:t}),r&&r(!1),c(!1)}},a={};return"undefined"!==typeof PointerEvent?(a.onPointerEnter=function(t){te&&"mouse"===t.pointerType||e(t,t.pointerType)},a.onPointerLeave=function(e){!i&&e.currentTarget.contains(e.target)&&o(e,e.pointerType)}):(a.onTouchStart=function(){l.ignoreEmulatedMouseEvents=!0},a.onMouseEnter=function(t){l.ignoreEmulatedMouseEvents||te||e(t,"mouse"),l.ignoreEmulatedMouseEvents=!1},a.onMouseLeave=function(e){!i&&e.currentTarget.contains(e.target)&&o(e,"mouse")}),{hoverProps:a,triggerHoverEnd:o}}),[t,r,n,i,l]),h=d.hoverProps,p=d.triggerHoverEnd;return Object(f.useEffect)((function(){i&&p({currentTarget:l.target},l.pointerType)}),[i]),{hoverProps:h,isHovered:s}}function ue(e){var t=e.ref,r=e.onInteractOutside,n=e.isDisabled,i=e.onInteractOutsideStart,o=Object(f.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1,onInteractOutside:r,onInteractOutsideStart:i}).current;o.onInteractOutside=r,o.onInteractOutsideStart=i,Object(f.useEffect)((function(){if(!n){var e=function(e){se(e,t)&&o.onInteractOutside&&(o.onInteractOutsideStart&&o.onInteractOutsideStart(e),o.isPointerDown=!0)};if("undefined"!==typeof PointerEvent){var r=function(e){o.isPointerDown&&o.onInteractOutside&&se(e,t)&&(o.isPointerDown=!1,o.onInteractOutside(e))};return document.addEventListener("pointerdown",e,!0),document.addEventListener("pointerup",r,!0),function(){document.removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerup",r,!0)}}var i=function(e){o.ignoreEmulatedMouseEvents?o.ignoreEmulatedMouseEvents=!1:o.isPointerDown&&o.onInteractOutside&&se(e,t)&&(o.isPointerDown=!1,o.onInteractOutside(e))},a=function(e){o.ignoreEmulatedMouseEvents=!0,o.onInteractOutside&&o.isPointerDown&&se(e,t)&&(o.isPointerDown=!1,o.onInteractOutside(e))};return document.addEventListener("mousedown",e,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("touchstart",e,!0),document.addEventListener("touchend",a,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("mouseup",i,!0),document.removeEventListener("touchstart",e,!0),document.removeEventListener("touchend",a,!0)}}}),[t,o,n])}function se(e,t){if(e.button>0)return!1;if(e.target){var r=e.target.ownerDocument;if(!r||!r.documentElement.contains(e.target))return!1}return t.current&&!t.current.contains(e.target)}h({},"useInteractOutside",(function(){return ue}));function ce(e){if(e){var t=!0;return function(r){var n=Object(o.a)(Object(o.a)({},r),{},{preventDefault:function(){r.preventDefault()},isDefaultPrevented:function(){return r.isDefaultPrevented()},stopPropagation:function(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation:function(){t=!1}});e(n),t&&r.stopPropagation()}}}function le(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:ce(e.onKeyDown),onKeyUp:ce(e.onKeyUp)}}}h({},"useKeyboard",(function(){return le}));function fe(e){var t=e.onMoveStart,r=e.onMove,i=e.onMoveEnd,o=Object(f.useRef)({didMove:!1,lastPosition:null,id:null}),a=Object(l.k)(),u=a.addGlobalListener,s=a.removeGlobalListener;return{moveProps:Object(f.useMemo)((function(){var e={},a=function(){g(),o.current.didMove=!1},c=function(e,n,i,a){0===i&&0===a||(o.current.didMove||(o.current.didMove=!0,null===t||void 0===t||t({type:"movestart",pointerType:n,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})),r({type:"move",pointerType:n,deltaX:i,deltaY:a,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey}))},l=function(e,t){b(),o.current.didMove&&(null===i||void 0===i||i({type:"moveend",pointerType:t,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey}))};if("undefined"===typeof PointerEvent){var f=function(e){0===e.button&&(c(e,"mouse",e.pageX-o.current.lastPosition.pageX,e.pageY-o.current.lastPosition.pageY),o.current.lastPosition={pageX:e.pageX,pageY:e.pageY})},d=function e(t){0===t.button&&(l(t,"mouse"),s(window,"mousemove",f,!1),s(window,"mouseup",e,!1))};e.onMouseDown=function(e){0===e.button&&(a(),e.stopPropagation(),e.preventDefault(),o.current.lastPosition={pageX:e.pageX,pageY:e.pageY},u(window,"mousemove",f,!1),u(window,"mouseup",d,!1))};var h=function(e){var t=Object(n.a)(e.changedTouches).findIndex((function(e){return e.identifier===o.current.id}));if(t>=0){var r=e.changedTouches[t],i=r.pageX,a=r.pageY;c(e,"touch",i-o.current.lastPosition.pageX,a-o.current.lastPosition.pageY),o.current.lastPosition={pageX:i,pageY:a}}},p=function e(t){Object(n.a)(t.changedTouches).findIndex((function(e){return e.identifier===o.current.id}))>=0&&(l(t,"touch"),o.current.id=null,s(window,"touchmove",h),s(window,"touchend",e),s(window,"touchcancel",e))};e.onTouchStart=function(e){if(0!==e.changedTouches.length&&null==o.current.id){var t=e.changedTouches[0],r=t.pageX,n=t.pageY,i=t.identifier;a(),e.stopPropagation(),e.preventDefault(),o.current.lastPosition={pageX:r,pageY:n},o.current.id=i,u(window,"touchmove",h,!1),u(window,"touchend",p,!1),u(window,"touchcancel",p,!1)}}}else{var v=function(e){if(e.pointerId===o.current.id){var t=e.pointerType||"mouse";c(e,t,e.pageX-o.current.lastPosition.pageX,e.pageY-o.current.lastPosition.pageY),o.current.lastPosition={pageX:e.pageX,pageY:e.pageY}}},m=function e(t){if(t.pointerId===o.current.id){var r=t.pointerType||"mouse";l(t,r),o.current.id=null,s(window,"pointermove",v,!1),s(window,"pointerup",e,!1),s(window,"pointercancel",e,!1)}};e.onPointerDown=function(e){0===e.button&&null==o.current.id&&(a(),e.stopPropagation(),e.preventDefault(),o.current.lastPosition={pageX:e.pageX,pageY:e.pageY},o.current.id=e.pointerId,u(window,"pointermove",v,!1),u(window,"pointerup",m,!1),u(window,"pointercancel",m,!1))}}var y=function(e,t,r){a(),c(e,"keyboard",t,r),l(e,"keyboard")};return e.onKeyDown=function(e){switch(e.key){case"Left":case"ArrowLeft":e.preventDefault(),e.stopPropagation(),y(e,-1,0);break;case"Right":case"ArrowRight":e.preventDefault(),e.stopPropagation(),y(e,1,0);break;case"Up":case"ArrowUp":e.preventDefault(),e.stopPropagation(),y(e,0,-1);break;case"Down":case"ArrowDown":e.preventDefault(),e.stopPropagation(),y(e,0,1)}},e}),[o,t,r,i,u,s])}}h({},"useMove",(function(){return fe}));function de(e,t){var r=e.onScroll,n=e.isDisabled,i=Object(f.useCallback)((function(e){e.ctrlKey||(e.preventDefault(),e.stopPropagation(),r&&r({deltaX:e.deltaX,deltaY:e.deltaY}))}),[r]);Object(l.j)(t,"wheel",n?null:i)}h({},"useScrollWheel",(function(){return de}));h({},"useLongPress",(function(){return he}));function he(e){var t=e.isDisabled,r=e.onLongPressStart,n=e.onLongPressEnd,i=e.onLongPress,a=e.threshold,u=void 0===a?500:a,s=e.accessibilityDescription,c=Object(f.useRef)(null),d=Object(l.k)(),h=d.addGlobalListener,p=d.removeGlobalListener,v=E({isDisabled:t,onPressStart:function(e){if(("mouse"===e.pointerType||"touch"===e.pointerType)&&(r&&r(Object(o.a)(Object(o.a)({},e),{},{type:"longpressstart"})),c.current=setTimeout((function(){e.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),i&&i(Object(o.a)(Object(o.a)({},e),{},{type:"longpress"})),c.current=null}),u),"touch"===e.pointerType)){var t=function(e){e.preventDefault()};h(e.target,"contextmenu",t,{once:!0}),h(window,"pointerup",(function(){setTimeout((function(){p(e.target,"contextmenu",t)}),30)}),{once:!0})}},onPressEnd:function(e){c.current&&clearTimeout(c.current),!n||"mouse"!==e.pointerType&&"touch"!==e.pointerType||n(Object(o.a)(Object(o.a)({},e),{},{type:"longpressend"}))}}).pressProps,m=Object(l.i)(i&&!t?s:null);return{longPressProps:Object(l.g)(v,m)}}},function(e,t,r){"use strict";r.r(t),r.d(t,"defaultPath",(function(){return x})),r.d(t,"HDNode",(function(){return S})),r.d(t,"mnemonicToSeed",(function(){return A})),r.d(t,"mnemonicToEntropy",(function(){return P})),r.d(t,"entropyToMnemonic",(function(){return C})),r.d(t,"isValidMnemonic",(function(){return T})),r.d(t,"getAccountPath",(function(){return M}));var n=r(6),i=r(7),o=r(60),a=r(2),u=r(28),s=r(34),c=r(161),l=r(4),f=r(52),d=r(63),h=r(94),p=r(35),v=r(128),m=new(r(5).Logger)("hdnode/5.7.0"),g=u.a.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),b=Object(s.f)("Bitcoin seed"),y=2147483648;function w(e){return(1<=256)throw new Error("Depth too large!");return k(Object(a.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(a.hexlify)(this.depth),this.parentFingerprint,Object(a.hexZeroPad)(Object(a.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?Object(a.concat)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(j,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+="/"+(2147483647&t));var n=new Uint8Array(37);if(t&y){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Object(a.arrayify)(this.privateKey),1),r&&(r+="'")}else n.set(Object(a.arrayify)(this.publicKey));for(var i=24;i>=0;i-=8)n[33+(i>>3)]=t>>24-i&255;var o=Object(a.arrayify)(Object(d.a)(h.a.sha512,this.chainCode,n)),s=o.slice(0,32),c=o.slice(32),l=null,p=null;this.privateKey?l=O(u.a.from(s).add(this.privateKey).mod(g)):p=new f.SigningKey(Object(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(j,l,p,this.fingerprint,O(c),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=y)throw new Error("invalid path index - "+i);r=r._derive(y+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);var a=parseInt(i);if(a>=y)throw new Error("invalid path index - "+i);r=r._derive(a)}}return r}}],[{key:"_fromSeed",value:function(t,r){var n=Object(a.arrayify)(t);if(n.length<16||n.length>64)throw new Error("invalid seed");var i=Object(a.arrayify)(Object(d.a)(h.a.sha512,b,n));return new e(j,O(i.slice(0,32)),null,"0x00000000",O(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=C(P(t,n=E(n)),n),e._fromSeed(A(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&&k(r.slice(0,78))===t||m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],i=Object(a.hexlify)(r.slice(5,9)),u=parseInt(Object(a.hexlify)(r.slice(9,13)).substring(2),16),s=Object(a.hexlify)(r.slice(13,45)),c=r.slice(45,78);switch(Object(a.hexlify)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(j,null,Object(a.hexlify)(c),i,s,u,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new e(j,Object(a.hexlify)(c.slice(1)),null,i,s,u,n,null)}return m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}]),e}();function A(e,t){t||(t="");var r=Object(s.f)("mnemonic"+t,s.a.NFKD);return Object(c.a)(Object(s.f)(e,s.a.NFKD),r,2048,64,"sha512")}function P(e,t){t=E(t),m.checkNormalize();var r=t.split(e);if(r.length%3!==0)throw new Error("invalid mnemonic");for(var n=Object(a.arrayify)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o>3]|=1<<7-i%8),i++}var c=32*r.length/3,l=w(r.length/3);if((Object(a.arrayify)(Object(d.c)(n.slice(0,c/8)))[0]&l)!==(n[n.length-1]&l))throw new Error("invalid checksum");return Object(a.hexlify)(n.slice(0,c/8))}function C(e,t){if(t=E(t),(e=Object(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=Object(a.arrayify)(Object(d.c)(e))[0]&w(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 T(e,t){try{return P(e,t),!0}catch(r){}return!1}function M(e){return("number"!==typeof e||e<0||e>=y||e%1)&&m.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}},function(e,t,r){"use strict";r.r(t),r.d(t,"_toEscapedUtf8String",(function(){return o.d})),r.d(t,"toUtf8Bytes",(function(){return o.f})),r.d(t,"toUtf8CodePoints",(function(){return o.g})),r.d(t,"toUtf8String",(function(){return o.h})),r.d(t,"Utf8ErrorFuncs",(function(){return o.b})),r.d(t,"Utf8ErrorReason",(function(){return o.c})),r.d(t,"UnicodeNormalizationForm",(function(){return o.a})),r.d(t,"formatBytes32String",(function(){return a})),r.d(t,"parseBytes32String",(function(){return u})),r.d(t,"nameprep",(function(){return b}));var n=r(126),i=r(2),o=r(34);function a(e){var t=Object(o.f)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(i.hexlify)(Object(i.concat)([t,n.a]).slice(0,32))}function u(e){var t=Object(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 Object(o.h)(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 c(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 l(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=c("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"),d="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),h=[{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=l(e,h);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=Object(o.g)(Object(o.e)(r),o.a.NFKC)).forEach((function(e){if(l(e,g))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(e){if(l(e,f))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=Object(o.e)(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}},function(e,t,r){"use strict";function n(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t to ensure consistent ids are generated between the client and server."),Object(i.useMemo)((function(){return e||"react-aria".concat(t.prefix,"-").concat(++t.current)}),[e])}function h(){var e=Object(i.useContext)(c)!==s,t=Object(i.useState)(e),r=Object(n.a)(t,2),o=r[0],a=r[1];return"undefined"!==typeof window&&e&&Object(i.useLayoutEffect)((function(){a(!1)}),[]),o}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=!1},function(e,t,r){"use strict";r.r(t),r.d(t,"Signer",(function(){return m})),r.d(t,"VoidSigner",(function(){return g}));var n=r(13),i=r(9),o=r(10),a=r(3),u=r.n(a),s=r(6),c=r(7),l=r(4),f=r(5),d=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 f.Logger("abstract-signer/5.7.0"),p=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],v=[f.Logger.errors.INSUFFICIENT_FUNDS,f.Logger.errors.NONCE_EXPIRED,f.Logger.errors.REPLACEMENT_UNDERPRICED],m=function(){function e(){Object(s.a)(this,e),h.checkAbstract(this instanceof e?this.constructor:void 0,e),Object(l.defineReadOnly)(this,"_isSigner",!0)}return Object(c.a)(e,[{key:"getBalance",value:function(e){return d(this,void 0,void 0,u.a.mark((function t(){return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getBalance"),t.next=3,this.provider.getBalance(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getTransactionCount",value:function(e){return d(this,void 0,void 0,u.a.mark((function t(){return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getTransactionCount"),t.next=3,this.provider.getTransactionCount(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"estimateGas",value:function(e){return d(this,void 0,void 0,u.a.mark((function t(){var r;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("estimateGas"),t.next=3,Object(l.resolveProperties)(this.checkTransaction(e));case 3:return r=t.sent,t.next=6,this.provider.estimateGas(r);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"call",value:function(e,t){return d(this,void 0,void 0,u.a.mark((function r(){var n;return u.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this._checkProvider("call"),r.next=3,Object(l.resolveProperties)(this.checkTransaction(e));case 3:return n=r.sent,r.next=6,this.provider.call(n,t);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sendTransaction",value:function(e){return d(this,void 0,void 0,u.a.mark((function t(){var r,n;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("sendTransaction"),t.next=3,this.populateTransaction(e);case 3:return r=t.sent,t.next=6,this.signTransaction(r);case 6:return n=t.sent,t.next=9,this.provider.sendTransaction(n);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getChainId",value:function(){return d(this,void 0,void 0,u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getChainId"),e.next=3,this.provider.getNetwork();case 3:return t=e.sent,e.abrupt("return",t.chainId);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return d(this,void 0,void 0,u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getGasPrice"),e.next=3,this.provider.getGasPrice();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getFeeData",value:function(){return d(this,void 0,void 0,u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getFeeData"),e.next=3,this.provider.getFeeData();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"resolveName",value:function(e){return d(this,void 0,void 0,u.a.mark((function t(){return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("resolveName"),t.next=3,this.provider.resolveName(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"checkTransaction",value:function(e){for(var t in e)-1===p.indexOf(t)&&h.throwArgumentError("invalid transaction key: "+t,"transaction",e);var r=Object(l.shallowCopy)(e);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then((function(t){return t[0].toLowerCase()!==t[1].toLowerCase()&&h.throwArgumentError("from address mismatch","transaction",e),t[0]})),r}},{key:"populateTransaction",value:function(e){return d(this,void 0,void 0,u.a.mark((function t(){var r,n,i,o,a=this;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(l.resolveProperties)(this.checkTransaction(e));case 2:if(null!=(r=t.sent).to&&(r.to=Promise.resolve(r.to).then((function(e){return d(a,void 0,void 0,u.a.mark((function t(){var r;return u.a.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.resolveName(e);case 4:return null==(r=t.sent)&&h.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))})),r.to.catch((function(e){}))),n=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas,null==r.gasPrice||2!==r.type&&!n?0!==r.type&&1!==r.type||!n||h.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):h.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas){t.next=10;break}r.type=2,t.next=18;break;case 10:if(0!==r.type&&1!==r.type){t.next=14;break}null==r.gasPrice&&(r.gasPrice=this.getGasPrice()),t.next=18;break;case 14:return t.next=16,this.getFeeData();case 16:i=t.sent,null==r.type?null!=i.maxFeePerGas&&null!=i.maxPriorityFeePerGas?(r.type=2,null!=r.gasPrice?(o=r.gasPrice,delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o):(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))):null!=i.gasPrice?(n&&h.throwError("network does not support EIP-1559",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=i.gasPrice),r.type=0):h.throwError("failed to get consistent fee data",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas));case 18:return null==r.nonce&&(r.nonce=this.getTransactionCount("pending")),null==r.gasLimit&&(r.gasLimit=this.estimateGas(r).catch((function(e){if(v.indexOf(e.code)>=0)throw e;return h.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",f.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,Object(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",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),g=function(e){Object(i.a)(r,e);var t=Object(o.a)(r);function r(e,i){var o;return Object(s.a)(this,r),o=t.call(this),Object(l.defineReadOnly)(Object(n.a)(o),"address",e),Object(l.defineReadOnly)(Object(n.a)(o),"provider",i||null),o}return Object(c.a)(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){h.throwError(e,f.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}(m)},function(e,t,r){"use strict";r.r(t),r.d(t,"encode",(function(){return c})),r.d(t,"decode",(function(){return d}));var n=r(2),i=r(5),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,{}),l(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,{}),l(e,t,t+1,s)}if(e[t]>=184){var c=e[t]-183;t+1+c>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});var f=u(e,t+1,c);return t+1+c+f>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+c+f,result:Object(n.hexlify)(e.slice(t+1+c,t+1+c+f))}}if(e[t]>=128){var d=e[t]-128;return t+1+d>e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+d,result:Object(n.hexlify)(e.slice(t+1,t+1+d))}}return{consumed:1,result:Object(n.hexlify)(e[t])}}function d(e){var t=Object(n.arrayify)(e),r=f(t,0);return r.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),r.result}},function(e,t,r){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var 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("")}}}(),c={16:10,24:12,32:14},l=[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],d=[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],h=[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],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],y=[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],O=[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],k=[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],E=[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],j=[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 x(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]^l[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,h=s%4,this._Ke[d][h]=o[t],this._Kd[e-d][h]=o[t++],s++}for(var d=1;d>24&255]^k[a>>16&255]^E[a>>8&255]^j[255&a]},S.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=x(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},S.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=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^b[n[(i+3)%4]>>16&255]^y[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&(d[n[i]>>24&255]^u>>24),s[4*i+1]=255&(d[n[(i+3)%4]>>16&255]^u>>16),s[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^u>>8),s[4*i+3]=255&(d[255&n[(i+1)%4]]^u);return s};var A=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 S(t)};A.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},M.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},M.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof M||(r=new M(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new S(t)};R.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;n1&&void 0!==arguments[1]?arguments[1]:100,n=null;return function(){for(var i=arguments.length,o=new Array(i),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=e.context,r=p.useContext(g(t,p.useContext(m)));if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},y=function(e){var t=e.client,r=e.children,n=e.context,i=e.contextSharing,o=void 0!==i&&i;p.useEffect((function(){return t.mount(),function(){t.unmount()}}),[t]);var a=g(n,o);return p.createElement(m.Provider,{value:!n&&o},p.createElement(a.Provider,{value:t},r))},w=p.createContext(!1);w.Provider;function O(){var e=!1;return{clearReset:function(){e=!1},reset:function(){e=!0},isReset:function(){return e}}}var k=p.createContext(O()),E="undefined"===typeof window;function j(){}function x(e){return"number"===typeof e&&e>=0&&e!==1/0}function S(e,t){return Math.max(e+(t||0)-Date.now(),0)}function A(e,t,r){return $(e)?"function"===typeof t?Object(f.a)(Object(f.a)({},r),{},{queryKey:e,queryFn:t}):Object(f.a)(Object(f.a)({},t),{},{queryKey:e}):e}function P(e,t,r){return $(e)?"function"===typeof t?Object(f.a)(Object(f.a)({},r),{},{mutationKey:e,mutationFn:t}):Object(f.a)(Object(f.a)({},t),{},{mutationKey:e}):"function"===typeof e?Object(f.a)(Object(f.a)({},t),{},{mutationFn:e}):Object(f.a)({},e)}function C(e,t,r){return $(e)?[Object(f.a)(Object(f.a)({},t),{},{queryKey:e}),r]:[e||{},t]}function T(e,t){var r=e.type,n=void 0===r?"all":r,i=e.exact,o=e.fetchStatus,a=e.predicate,u=e.queryKey,s=e.stale;if($(u))if(i){if(t.queryHash!==R(u,t.options))return!1}else if(!_(t.queryKey,u))return!1;if("all"!==n){var c=t.isActive();if("active"===n&&!c)return!1;if("inactive"===n&&c)return!1}return("boolean"!==typeof s||t.isStale()===s)&&(("undefined"===typeof o||o===t.state.fetchStatus)&&!(a&&!a(t)))}function M(e,t){var r=e.exact,n=e.fetching,i=e.predicate,o=e.mutationKey;if($(o)){if(!t.options.mutationKey)return!1;if(r){if(N(t.options.mutationKey)!==N(o))return!1}else if(!_(t.options.mutationKey,o))return!1}return("boolean"!==typeof n||"loading"===t.state.status===n)&&!(i&&!i(t))}function R(e,t){return((null==t?void 0:t.queryKeyHashFn)||N)(e)}function N(e){return JSON.stringify(e,(function(e,t){return F(t)?Object.keys(t).sort().reduce((function(e,r){return e[r]=t[r],e}),{}):t}))}function _(e,t){return L(e,t)}function L(e,t){return e===t||typeof e===typeof t&&(!(!e||!t||"object"!==typeof e||"object"!==typeof t)&&!Object.keys(t).some((function(r){return!L(e[r],t[r])})))}function I(e,t){if(e===t)return e;var r=D(e)&&D(t);if(r||F(e)&&F(t)){for(var n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),o=i.length,a=r?[]:{},u=0,s=0;s0}},{key:"onSubscribe",value:function(){}},{key:"onUnsubscribe",value:function(){}}]),e}(),Z=new(function(e){Object(J.a)(r,e);var t=Object(Y.a)(r);function r(){var e;return Object(G.a)(this,r),(e=t.call(this)).setup=function(e){if(!E&&window.addEventListener){var t=function(){return e()};return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),function(){window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}},e}return Object(q.a)(r,[{key:"onSubscribe",value:function(){this.cleanup||this.setEventListener(this.setup)}},{key:"onUnsubscribe",value:function(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}},{key:"setEventListener",value:function(e){var t,r=this;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e((function(e){"boolean"===typeof e?r.setFocused(e):r.onFocus()}))}},{key:"setFocused",value:function(e){this.focused=e,e&&this.onFocus()}},{key:"onFocus",value:function(){this.listeners.forEach((function(e){e()}))}},{key:"isFocused",value:function(){return"boolean"===typeof this.focused?this.focused:"undefined"===typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}}]),r}(X)),ee=new(function(e){Object(J.a)(r,e);var t=Object(Y.a)(r);function r(){var e;return Object(G.a)(this,r),(e=t.call(this)).setup=function(e){if(!E&&window.addEventListener){var t=function(){return e()};return window.addEventListener("online",t,!1),window.addEventListener("offline",t,!1),function(){window.removeEventListener("online",t),window.removeEventListener("offline",t)}}},e}return Object(q.a)(r,[{key:"onSubscribe",value:function(){this.cleanup||this.setEventListener(this.setup)}},{key:"onUnsubscribe",value:function(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}},{key:"setEventListener",value:function(e){var t,r=this;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e((function(e){"boolean"===typeof e?r.setOnline(e):r.onOnline()}))}},{key:"setOnline",value:function(e){this.online=e,e&&this.onOnline()}},{key:"onOnline",value:function(){this.listeners.forEach((function(e){e()}))}},{key:"isOnline",value:function(){return"boolean"===typeof this.online?this.online:"undefined"===typeof navigator||"undefined"===typeof navigator.onLine||navigator.onLine}}]),r}(X));function te(e){return Math.min(1e3*Math.pow(2,e),3e4)}function re(e){return"online"!==(null!=e?e:"online")||ee.isOnline()}var ne=function e(t){Object(G.a)(this,e),this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent};function ie(e){return e instanceof ne}function oe(e){var t,r,n,i=!1,o=0,a=!1,u=new Promise((function(e,t){r=e,n=t})),s=function(){return!Z.isFocused()||"always"!==e.networkMode&&!ee.isOnline()},c=function(n){a||(a=!0,null==e.onSuccess||e.onSuccess(n),null==t||t(),r(n))},l=function(r){a||(a=!0,null==e.onError||e.onError(r),null==t||t(),n(r))},f=function(){return new Promise((function(r){t=function(e){if(a||!s())return r(e)},null==e.onPause||e.onPause()})).then((function(){t=void 0,a||null==e.onContinue||e.onContinue()}))},d=function t(){if(!a){var r;try{r=e.fn()}catch(n){r=Promise.reject(n)}Promise.resolve(r).then(c).catch((function(r){var n,u;if(!a){var c=null!=(n=e.retry)?n:3,d=null!=(u=e.retryDelay)?u:te,h="function"===typeof d?d(o,r):d,p=!0===c||"number"===typeof c&&o0&&void 0!==arguments[0]?arguments[0]:{},t=e.refetchPage,r=Object(a.a)(e,["refetchPage"]);return this.fetch(Object(f.a)(Object(f.a)({},r),{},{meta:{refetchPage:t}}))}},{key:"fetchOptimistic",value:function(e){var t=this,r=this.client.defaultQueryOptions(e),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then((function(){return t.createResult(n,r)}))}},{key:"fetch",value:function(e){var t,r=this;return this.executeFetch(Object(f.a)(Object(f.a)({},e),{},{cancelRefetch:null==(t=e.cancelRefetch)||t})).then((function(){return r.updateResult(),r.currentResult}))}},{key:"executeFetch",value:function(e){this.updateQuery();var t=this.currentQuery.fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(j)),t}},{key:"updateStaleTimeout",value:function(){var e=this;if(this.clearStaleTimeout(),!E&&!this.currentResult.isStale&&x(this.options.staleTime)){var t=S(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout((function(){e.currentResult.isStale||e.updateResult()}),t)}}},{key:"computeRefetchInterval",value:function(){var e;return"function"===typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e}},{key:"updateRefetchInterval",value:function(e){var t=this;this.clearRefetchInterval(),this.currentRefetchInterval=e,!E&&!1!==this.options.enabled&&x(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval((function(){(t.options.refetchIntervalInBackground||Z.isFocused())&&t.executeFetch()}),this.currentRefetchInterval))}},{key:"updateTimers",value:function(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}},{key:"clearStaleTimeout",value:function(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}},{key:"clearRefetchInterval",value:function(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}},{key:"createResult",value:function(e,t){var r,n=this.currentQuery,i=this.options,o=this.currentResult,a=this.currentResultState,u=this.currentResultOptions,s=e!==n,c=s?e.state:this.currentQueryInitialState,l=s?this.currentResult:this.previousQueryResult,f=e.state,d=f.dataUpdatedAt,h=f.error,p=f.errorUpdatedAt,v=f.fetchStatus,m=f.status,g=!1,b=!1;if(t._optimisticResults){var y=this.hasListeners(),w=!y&&ue(e,t),O=y&&ce(e,n,t,i);(w||O)&&(v=re(e.options.networkMode)?"fetching":"paused",d||(m="loading")),"isRestoring"===t._optimisticResults&&(v="idle")}if(t.keepPreviousData&&!f.dataUpdateCount&&null!=l&&l.isSuccess&&"error"!==m)r=l.data,d=l.dataUpdatedAt,m=l.status,g=!0;else if(t.select&&"undefined"!==typeof f.data)if(o&&f.data===(null==a?void 0:a.data)&&t.select===this.selectFn)r=this.selectResult;else try{this.selectFn=t.select,r=t.select(f.data),r=K(null==o?void 0:o.data,r,t),this.selectResult=r,this.selectError=null}catch(S){0,this.selectError=S}else r=f.data;if("undefined"!==typeof t.placeholderData&&"undefined"===typeof r&&"loading"===m){var k;if(null!=o&&o.isPlaceholderData&&t.placeholderData===(null==u?void 0:u.placeholderData))k=o.data;else if(k="function"===typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&"undefined"!==typeof k)try{k=t.select(k),k=K(null==o?void 0:o.data,k,t),this.selectError=null}catch(S){0,this.selectError=S}"undefined"!==typeof k&&(m="success",r=k,b=!0)}this.selectError&&(h=this.selectError,r=this.selectResult,p=Date.now(),m="error");var E="fetching"===v,j="loading"===m,x="error"===m;return{status:m,fetchStatus:v,isLoading:j,isSuccess:"success"===m,isError:x,isInitialLoading:j&&E,data:r,dataUpdatedAt:d,error:h,errorUpdatedAt:p,failureCount:f.fetchFailureCount,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:E,isRefetching:E&&!j,isLoadingError:x&&0===f.dataUpdatedAt,isPaused:"paused"===v,isPlaceholderData:b,isPreviousData:g,isRefetchError:x&&0!==f.dataUpdatedAt,isStale:le(e,t),refetch:this.refetch,remove:this.remove}}},{key:"updateResult",value:function(e){var t=this,r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!B(n,r)){this.currentResult=n;var i={cache:!0};!1!==(null==e?void 0:e.listeners)&&function(){if(!r)return!0;var e=t.options.notifyOnChangeProps;if("all"===e||!e&&!t.trackedProps.size)return!0;var n=new Set(null!=e?e:t.trackedProps);return t.options.useErrorBoundary&&n.add("error"),Object.keys(t.currentResult).some((function(e){var i=e;return t.currentResult[i]!==r[i]&&n.has(i)}))}()&&(i.listeners=!0),this.notify(Object(f.a)(Object(f.a)({},i),e))}}},{key:"updateQuery",value:function(){var e=this.client.getQueryCache().build(this.client,this.options);if(e!==this.currentQuery){var t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}}},{key:"onQueryUpdate",value:function(e){var t={};"success"===e.type?t.onSuccess=!e.manual:"error"!==e.type||ie(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}},{key:"notify",value:function(e){var t=this;W.batch((function(){var r,n,i,o;if(e.onSuccess)null==(r=(n=t.options).onSuccess)||r.call(n,t.currentResult.data),null==(i=(o=t.options).onSettled)||i.call(o,t.currentResult.data,null);else if(e.onError){var a,u,s,c;null==(a=(u=t.options).onError)||a.call(u,t.currentResult.error),null==(s=(c=t.options).onSettled)||s.call(c,void 0,t.currentResult.error)}e.listeners&&t.listeners.forEach((function(e){e(t.currentResult)})),e.cache&&t.client.getQueryCache().notify({query:t.currentQuery,type:"observerResultsUpdated"})}))}}]),r}(X);function ue(e,t){return function(e,t){return!1!==t.enabled&&!e.state.dataUpdatedAt&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||e.state.dataUpdatedAt>0&&se(e,t,t.refetchOnMount)}function se(e,t,r){if(!1!==t.enabled){var n="function"===typeof r?r(e):r;return"always"===n||!1!==n&&le(e,t)}return!1}function ce(e,t,r,n){return!1!==r.enabled&&(e!==t||!1===n.enabled)&&(!r.suspense||"error"!==e.state.status)&&le(e,r)}function le(e,t){return e.isStaleByTime(t.staleTime)}function fe(){return{onFetch:function(e){e.fetchFn=function(){var t,r,n,i,o,a,u,s=null==(t=e.fetchOptions)||null==(r=t.meta)?void 0:r.refetchPage,c=null==(n=e.fetchOptions)||null==(i=n.meta)?void 0:i.fetchMore,f=null==c?void 0:c.pageParam,d="forward"===(null==c?void 0:c.direction),h="backward"===(null==c?void 0:c.direction),p=(null==(o=e.state.data)?void 0:o.pages)||[],v=(null==(a=e.state.data)?void 0:a.pageParams)||[],m=v,g=!1,b=e.options.queryFn||function(){return Promise.reject("Missing queryFn")},y=function(e,t,r,n){return m=n?[t].concat(Object(l.a)(m)):[].concat(Object(l.a)(m),[t]),n?[r].concat(Object(l.a)(e)):[].concat(Object(l.a)(e),[r])},w=function(t,r,n,i){if(g)return Promise.reject("Cancelled");if("undefined"===typeof n&&!r&&t.length)return Promise.resolve(t);var o,a={queryKey:e.queryKey,pageParam:n,meta:e.meta};o=a,Object.defineProperty(o,"signal",{enumerable:!0,get:function(){var t,r;return null!=(t=e.signal)&&t.aborted?g=!0:null==(r=e.signal)||r.addEventListener("abort",(function(){g=!0})),e.signal}});var u=b(a);return Promise.resolve(u).then((function(e){return y(t,n,e,i)}))};if(p.length)if(d){var O="undefined"!==typeof f,k=O?f:de(e.options,p);u=w(p,O,k)}else if(h){var E="undefined"!==typeof f,j=E?f:he(e.options,p);u=w(p,E,j,!0)}else!function(){m=[];var t="undefined"===typeof e.options.getNextPageParam,r=!s||!p[0]||s(p[0],0,p);u=r?w([],t,v[0]):Promise.resolve(y([],v[0],p[0]));for(var n=function(r){u=u.then((function(n){if(!s||!p[r]||s(p[r],r,p)){var i=t?v[r]:de(e.options,n);return w(n,t,i)}return Promise.resolve(y(n,v[r],p[r]))}))},i=1;i0&&!this.isActive()}},{key:"isStale",value:function(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some((function(e){return e.getCurrentResult().isStale}))}},{key:"isStaleByTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.state.isInvalidated||!this.state.dataUpdatedAt||!S(this.state.dataUpdatedAt,e)}},{key:"onFocus",value:function(){var e,t=this.observers.find((function(e){return e.shouldFetchOnWindowFocus()}));t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}},{key:"onOnline",value:function(){var e,t=this.observers.find((function(e){return e.shouldFetchOnReconnect()}));t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}},{key:"addObserver",value:function(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}},{key:"removeObserver",value:function(e){-1!==this.observers.indexOf(e)&&(this.observers=this.observers.filter((function(t){return t!==e})),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}},{key:"getObserversCount",value:function(){return this.observers.length}},{key:"invalidate",value:function(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}},{key:"fetch",value:function(e,t){var r,n,i=this;if("idle"!==this.state.fetchStatus)if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return null==(o=this.retryer)||o.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){var a=this.observers.find((function(e){return e.options.queryFn}));a&&this.setOptions(a.options)}Array.isArray(this.options.queryKey);var u=function(){if("function"===typeof AbortController)return new AbortController}(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},c=function(e){Object.defineProperty(e,"signal",{enumerable:!0,get:function(){if(u)return i.abortSignalConsumed=!0,u.signal}})};c(s);var l,f={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:function(){return i.options.queryFn?(i.abortSignalConsumed=!1,i.options.queryFn(s)):Promise.reject("Missing queryFn")},meta:this.meta};(c(f),null==(r=this.options.behavior)||r.onFetch(f),this.revertState=this.state,"idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=f.fetchOptions)?void 0:n.meta))&&this.dispatch({type:"fetch",meta:null==(l=f.fetchOptions)?void 0:l.meta});var d=function(e){var t,r;(ie(e)&&e.silent||i.dispatch({type:"error",error:e}),ie(e))||(null==(t=(r=i.cache.config).onError)||t.call(r,e,i));i.isFetchingOptimistic||i.scheduleGc(),i.isFetchingOptimistic=!1};return this.retryer=oe({fn:f.fetchFn,abort:null==u?void 0:u.abort.bind(u),onSuccess:function(e){var t,r;"undefined"!==typeof e?(i.setData(e),null==(t=(r=i.cache.config).onSuccess)||t.call(r,e,i),i.isFetchingOptimistic||i.scheduleGc(),i.isFetchingOptimistic=!1):d(new Error("undefined"))},onError:d,onFail:function(){i.dispatch({type:"failed"})},onPause:function(){i.dispatch({type:"pause"})},onContinue:function(){i.dispatch({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode}),this.promise=this.retryer.promise,this.promise}},{key:"dispatch",value:function(e){var t=this;this.state=function(r){var n,i;switch(e.type){case"failed":return Object(f.a)(Object(f.a)({},r),{},{fetchFailureCount:r.fetchFailureCount+1});case"pause":return Object(f.a)(Object(f.a)({},r),{},{fetchStatus:"paused"});case"continue":return Object(f.a)(Object(f.a)({},r),{},{fetchStatus:"fetching"});case"fetch":return Object(f.a)(Object(f.a)({},r),{},{fetchFailureCount:0,fetchMeta:null!=(n=e.meta)?n:null,fetchStatus:re(t.options.networkMode)?"fetching":"paused"},!r.dataUpdatedAt&&{error:null,status:"loading"});case"success":return Object(f.a)(Object(f.a)({},r),{},{data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:null!=(i=e.dataUpdatedAt)?i:Date.now(),error:null,isInvalidated:!1,status:"success"},!e.manual&&{fetchStatus:"idle",fetchFailureCount:0});case"error":var o=e.error;return ie(o)&&o.revert&&t.revertState?Object(f.a)({},t.revertState):Object(f.a)(Object(f.a)({},r),{},{error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchStatus:"idle",status:"error"});case"invalidate":return Object(f.a)(Object(f.a)({},r),{},{isInvalidated:!0});case"setState":return Object(f.a)(Object(f.a)({},r),e.state)}}(this.state),W.batch((function(){t.observers.forEach((function(t){t.onQueryUpdate(e)})),t.cache.notify({query:t,type:"updated",action:e})}))}}]),r}(ge);var je=function(e){Object(J.a)(r,e);var t=Object(Y.a)(r);function r(e){var n;return Object(G.a)(this,r),(n=t.call(this)).config=e||{},n.queries=[],n.queriesMap={},n}return Object(q.a)(r,[{key:"build",value:function(e,t,r){var n,i=t.queryKey,o=null!=(n=t.queryHash)?n:R(i,t),a=this.get(o);return a||(a=new Ee({cache:this,logger:e.getLogger(),queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i),meta:t.meta}),this.add(a)),a}},{key:"add",value:function(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}},{key:"remove",value:function(e){var t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter((function(t){return t!==e})),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}},{key:"clear",value:function(){var e=this;W.batch((function(){e.queries.forEach((function(t){e.remove(t)}))}))}},{key:"get",value:function(e){return this.queriesMap[e]}},{key:"getAll",value:function(){return this.queries}},{key:"find",value:function(e,t){var r=C(e,t),n=Object(c.a)(r,1)[0];return"undefined"===typeof n.exact&&(n.exact=!0),this.queries.find((function(e){return T(n,e)}))}},{key:"findAll",value:function(e,t){var r=C(e,t),n=Object(c.a)(r,1)[0];return Object.keys(n).length>0?this.queries.filter((function(e){return T(n,e)})):this.queries}},{key:"notify",value:function(e){var t=this;W.batch((function(){t.listeners.forEach((function(t){t(e)}))}))}},{key:"onFocus",value:function(){var e=this;W.batch((function(){e.queries.forEach((function(e){e.onFocus()}))}))}},{key:"onOnline",value:function(){var e=this;W.batch((function(){e.queries.forEach((function(e){e.onOnline()}))}))}}]),r}(X),xe=function(e){Object(J.a)(r,e);var t=Object(Y.a)(r);function r(e){var n;return Object(G.a)(this,r),(n=t.call(this)).config=e||{},n.mutations=[],n.mutationId=0,n}return Object(q.a)(r,[{key:"build",value:function(e,t,r){var n=new be({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:r,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0,meta:t.meta});return this.add(n),n}},{key:"add",value:function(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}},{key:"remove",value:function(e){this.mutations=this.mutations.filter((function(t){return t!==e})),this.notify({type:"removed",mutation:e})}},{key:"clear",value:function(){var e=this;W.batch((function(){e.mutations.forEach((function(t){e.remove(t)}))}))}},{key:"getAll",value:function(){return this.mutations}},{key:"find",value:function(e){return"undefined"===typeof e.exact&&(e.exact=!0),this.mutations.find((function(t){return M(e,t)}))}},{key:"findAll",value:function(e){return this.mutations.filter((function(t){return M(e,t)}))}},{key:"notify",value:function(e){var t=this;W.batch((function(){t.listeners.forEach((function(t){t(e)}))}))}},{key:"resumePausedMutations",value:function(){var e=this.mutations.filter((function(e){return e.state.isPaused}));return W.batch((function(){return e.reduce((function(e,t){return e.then((function(){return t.continue().catch(j)}))}),Promise.resolve())}))}}]),r}(X),Se=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(G.a)(this,e),this.queryCache=t.queryCache||new je,this.mutationCache=t.mutationCache||new xe,this.logger=t.logger||me,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}return Object(q.a)(e,[{key:"mount",value:function(){var e=this;this.unsubscribeFocus=Z.subscribe((function(){Z.isFocused()&&(e.resumePausedMutations(),e.queryCache.onFocus())})),this.unsubscribeOnline=ee.subscribe((function(){ee.isOnline()&&(e.resumePausedMutations(),e.queryCache.onOnline())}))}},{key:"unmount",value:function(){var e,t;null==(e=this.unsubscribeFocus)||e.call(this),null==(t=this.unsubscribeOnline)||t.call(this)}},{key:"isFetching",value:function(e,t){var r=C(e,t),n=Object(c.a)(r,1)[0];return n.fetchStatus="fetching",this.queryCache.findAll(n).length}},{key:"isMutating",value:function(e){return this.mutationCache.findAll(Object(f.a)(Object(f.a)({},e),{},{fetching:!0})).length}},{key:"getQueryData",value:function(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state.data}},{key:"getQueriesData",value:function(e){return this.getQueryCache().findAll(e).map((function(e){return[e.queryKey,e.state.data]}))}},{key:"setQueryData",value:function(e,t,r){var n=this.queryCache.find(e),i=function(e,t){return"function"===typeof e?e(t):e}(t,null==n?void 0:n.state.data);if("undefined"!==typeof i){var o=A(e),a=this.defaultQueryOptions(o);return this.queryCache.build(this,a).setData(i,Object(f.a)(Object(f.a)({},r),{},{manual:!0}))}}},{key:"setQueriesData",value:function(e,t,r){var n=this;return W.batch((function(){return n.getQueryCache().findAll(e).map((function(e){var i=e.queryKey;return[i,n.setQueryData(i,t,r)]}))}))}},{key:"getQueryState",value:function(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state}},{key:"removeQueries",value:function(e,t){var r=C(e,t),n=Object(c.a)(r,1)[0],i=this.queryCache;W.batch((function(){i.findAll(n).forEach((function(e){i.remove(e)}))}))}},{key:"resetQueries",value:function(e,t,r){var n=this,i=C(e,t,r),o=Object(c.a)(i,2),a=o[0],u=o[1],s=this.queryCache,l=Object(f.a)({type:"active"},a);return W.batch((function(){return s.findAll(a).forEach((function(e){e.reset()})),n.refetchQueries(l,u)}))}},{key:"cancelQueries",value:function(e,t,r){var n=this,i=C(e,t,r),o=Object(c.a)(i,2),a=o[0],u=o[1],s=void 0===u?{}:u;"undefined"===typeof s.revert&&(s.revert=!0);var l=W.batch((function(){return n.queryCache.findAll(a).map((function(e){return e.cancel(s)}))}));return Promise.all(l).then(j).catch(j)}},{key:"invalidateQueries",value:function(e,t,r){var n=this,i=C(e,t,r),o=Object(c.a)(i,2),a=o[0],u=o[1];return W.batch((function(){var e,t;if(n.queryCache.findAll(a).forEach((function(e){e.invalidate()})),"none"===a.refetchType)return Promise.resolve();var r=Object(f.a)(Object(f.a)({},a),{},{type:null!=(e=null!=(t=a.refetchType)?t:a.type)?e:"active"});return n.refetchQueries(r,u)}))}},{key:"refetchQueries",value:function(e,t,r){var n=this,i=C(e,t,r),o=Object(c.a)(i,2),a=o[0],u=o[1],s=W.batch((function(){return n.queryCache.findAll(a).filter((function(e){return!e.isDisabled()})).map((function(e){var t;return e.fetch(void 0,Object(f.a)(Object(f.a)({},u),{},{cancelRefetch:null==(t=null==u?void 0:u.cancelRefetch)||t,meta:{refetchPage:a.refetchPage}}))}))})),l=Promise.all(s).then(j);return null!=u&&u.throwOnError||(l=l.catch(j)),l}},{key:"fetchQuery",value:function(e,t,r){var n=A(e,t,r),i=this.defaultQueryOptions(n);"undefined"===typeof i.retry&&(i.retry=!1);var o=this.queryCache.build(this,i);return o.isStaleByTime(i.staleTime)?o.fetch(i):Promise.resolve(o.state.data)}},{key:"prefetchQuery",value:function(e,t,r){return this.fetchQuery(e,t,r).then(j).catch(j)}},{key:"fetchInfiniteQuery",value:function(e,t,r){var n=A(e,t,r);return n.behavior=fe(),this.fetchQuery(n)}},{key:"prefetchInfiniteQuery",value:function(e,t,r){return this.fetchInfiniteQuery(e,t,r).then(j).catch(j)}},{key:"resumePausedMutations",value:function(){return this.mutationCache.resumePausedMutations()}},{key:"getQueryCache",value:function(){return this.queryCache}},{key:"getMutationCache",value:function(){return this.mutationCache}},{key:"getLogger",value:function(){return this.logger}},{key:"getDefaultOptions",value:function(){return this.defaultOptions}},{key:"setDefaultOptions",value:function(e){this.defaultOptions=e}},{key:"setQueryDefaults",value:function(e,t){var r=this.queryDefaults.find((function(t){return N(e)===N(t.queryKey)}));r?r.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}},{key:"getQueryDefaults",value:function(e){if(e){var t=this.queryDefaults.find((function(t){return _(e,t.queryKey)}));return null==t?void 0:t.defaultOptions}}},{key:"setMutationDefaults",value:function(e,t){var r=this.mutationDefaults.find((function(t){return N(e)===N(t.mutationKey)}));r?r.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}},{key:"getMutationDefaults",value:function(e){if(e){var t=this.mutationDefaults.find((function(t){return _(e,t.mutationKey)}));return null==t?void 0:t.defaultOptions}}},{key:"defaultQueryOptions",value:function(e){if(null!=e&&e._defaulted)return e;var t=Object(f.a)(Object(f.a)(Object(f.a)(Object(f.a)({},this.defaultOptions.queries),this.getQueryDefaults(null==e?void 0:e.queryKey)),e),{},{_defaulted:!0});return!t.queryHash&&t.queryKey&&(t.queryHash=R(t.queryKey,t)),"undefined"===typeof t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),"undefined"===typeof t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}},{key:"defaultMutationOptions",value:function(e){return null!=e&&e._defaulted?e:Object(f.a)(Object(f.a)(Object(f.a)(Object(f.a)({},this.defaultOptions.mutations),this.getMutationDefaults(null==e?void 0:e.mutationKey)),e),{},{_defaulted:!0})}},{key:"clear",value:function(){this.queryCache.clear(),this.mutationCache.clear()}}]),e}();function Ae(e){return{mutationKey:e.options.mutationKey,state:e.state}}function Pe(e){return{state:e.state,queryKey:e.queryKey,queryHash:e.queryHash}}function Ce(e){return e.state.isPaused}function Te(e){return"success"===e.state.status}function Me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],n=[];if(!1!==t.dehydrateMutations){var i=t.shouldDehydrateMutation||Ce;e.getMutationCache().getAll().forEach((function(e){i(e)&&r.push(Ae(e))}))}if(!1!==t.dehydrateQueries){var o=t.shouldDehydrateQuery||Te;e.getQueryCache().getAll().forEach((function(e){o(e)&&n.push(Pe(e))}))}return{mutations:r,queries:n}}function Re(e,t,r){if("object"===typeof t&&null!==t){var n=e.getMutationCache(),i=e.getQueryCache(),o=t.mutations||[],a=t.queries||[];o.forEach((function(t){var i;n.build(e,Object(f.a)(Object(f.a)({},null==r||null==(i=r.defaultOptions)?void 0:i.mutations),{},{mutationKey:t.mutationKey}),t.state)})),a.forEach((function(t){var n,o=i.get(t.queryHash);o?o.state.dataUpdatedAta,d=l.buster!==s,f||d?n.removeClient():Re(r,l.clientState,c)):n.removeClient()),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),n.removeClient();case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function _e(e){return Le.apply(this,arguments)}function Le(){return(Le=Object(o.a)(i.a.mark((function e(t){var r,n,o,a,u,s;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.queryClient,n=t.persister,o=t.buster,a=void 0===o?"":o,u=t.dehydrateOptions,s={buster:a,timestamp:Date.now(),clientState:Me(r,u)},e.next=4,n.persistClient(s);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ie(e){var t,r=!1;return[function(){r=!0,null==t||t()},function(e){return Ne.apply(this,arguments)}(e).then((function(){r||(t=function(e){var t=e.queryClient.getQueryCache().subscribe((function(){_e(e)})),r=e.queryClient.getMutationCache().subscribe((function(){_e(e)}));return function(){t(),r()}}(e))}))]}var Be=r(21),De=r(14),Fe=r(77),Ue=r(106),$e=r(95),He=pe.useSyncExternalStore;function ze(e,t,r){return n=e,Array.isArray(n)?"function"===typeof t?Object(f.a)(Object(f.a)({},r),{},{queryKey:e,queryFn:t}):Object(f.a)(Object(f.a)({},t),{},{queryKey:e}):e;var n}function Ke(e,t){var r={};return Object.keys(e).forEach((function(n){Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:function(){return t.trackedProps.add(n),e[n]}})})),r}function We(e,t){var r=b({context:e.context}),n=p.useContext(w),i=p.useContext(k),o=r.defaultQueryOptions(e);o._optimisticResults=n?"isRestoring":"optimistic",o.onError&&(o.onError=W.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=W.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=W.batchCalls(o.onSettled)),o.suspense&&"number"!==typeof o.staleTime&&(o.staleTime=1e3),(o.suspense||o.useErrorBoundary)&&(i.isReset()||(o.retryOnMount=!1));var a,u,s=p.useState((function(){return new t(r,o)})),d=Object(c.a)(s,1)[0],h=d.getOptimisticResult(o);if(He(p.useCallback((function(e){return n?function(){}:d.subscribe(W.batchCalls(e))}),[d,n]),(function(){return d.getCurrentResult()}),(function(){return d.getCurrentResult()})),p.useEffect((function(){i.clearReset()}),[i]),p.useEffect((function(){d.setOptions(o,{listeners:!1})}),[o,d]),o.suspense&&h.isLoading&&h.isFetching&&!n)throw d.fetchOptimistic(o).then((function(e){var t,r,n=e.data;null===(t=o.onSuccess)||void 0===t||t.call(o,n),null===(r=o.onSettled)||void 0===r||r.call(o,n,null)})).catch((function(e){var t,r;i.clearReset(),null===(t=o.onError)||void 0===t||t.call(o,e),null===(r=o.onSettled)||void 0===r||r.call(o,void 0,e)}));if(h.isError&&!i.isReset()&&!h.isFetching&&(a=o.useErrorBoundary,u=[h.error,d.getCurrentQuery()],"function"===typeof a?a.apply(void 0,Object(l.a)(u)):a))throw h.error;var v="loading"===h.status&&"idle"===h.fetchStatus?"idle":h.status,m="idle"===v,g="loading"===v&&"fetching"===h.fetchStatus;return Object(f.a)(Object(f.a)({},h),{},{defaultedOptions:o,isIdle:m,isLoading:g,observer:d,status:v})}var Ge=p.createContext(void 0),qe=p.createContext(void 0);function Ve(e){var t=e.children,r=e.client;return p.createElement(Ge.Provider,{value:r},p.createElement(y,{client:r.queryClient,context:qe},t))}function Qe(){var e=p.useContext(Ge);if(!e)throw new Error(["`useClient` must be used within `WagmiConfig`.\n","Read more: https://wagmi.sh/docs/WagmiConfig"].join("\n"));return e}function Je(e,t,r){var n=P(e,t,r);return Oe(Object(f.a)({context:qe},n))}function Ye(e,t,r){var n=ze(e,t,r),i=We(Object(f.a)({context:qe},n),ae),o={data:i.data,error:i.error,fetchStatus:i.fetchStatus,isError:i.isError,isFetched:i.isFetched,isFetching:i.isFetching,isIdle:i.isIdle,isLoading:i.isLoading,isRefetching:i.isRefetching,isSuccess:i.isSuccess,refetch:i.refetch,status:i.status,internal:{dataUpdatedAt:i.dataUpdatedAt,errorUpdatedAt:i.errorUpdatedAt,failureCount:i.failureCount,isFetchedAfterMount:i.isFetchedAfterMount,isLoadingError:i.isLoadingError,isPaused:i.isPaused,isPlaceholderData:i.isPlaceholderData,isPreviousData:i.isPreviousData,isRefetchError:i.isRefetchError,isStale:i.isStale,remove:i.remove}};return i.defaultedOptions.notifyOnChangeProps?o:Ke(o,i.observer)}var Xe=function(){return b({context:qe})};function Ze(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.chainId;return Object(Ue.useSyncExternalStoreWithSelector)((function(e){return Object(Be.G)({chainId:t},e)}),(function(){return Object(De.j)({chainId:t})}),(function(){return Object(De.j)({chainId:t})}),(function(e){return e}),(function(e,t){return e.network.chainId===t.network.chainId}))}function et(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.chainId;return Object(Ue.useSyncExternalStoreWithSelector)((function(e){return Object(Be.I)({chainId:t},e)}),(function(){return Object(Be.t)({chainId:t})}),(function(){return Object(Be.t)({chainId:t})}),(function(e){return e}),(function(e,t){return(null===e||void 0===e?void 0:e.network.chainId)===(null===t||void 0===t?void 0:t.network.chainId)}))}function tt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.chainId,r=Ze({chainId:t});return r.network.chainId}var rt=function(e){return[{entity:"blockNumber",chainId:e.chainId}]},nt=function(e){var t=Object(c.a)(e.queryKey,1)[0].chainId;return Object(Be.h)({chainId:t})};function it(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cacheTime,r=void 0===t?0:t,n=e.chainId,i=e.enabled,o=void 0===i||i,a=e.staleTime,u=e.suspense,s=e.watch,c=void 0!==s&&s,l=e.onBlock,f=e.onError,d=e.onSettled,h=e.onSuccess,v=tt({chainId:n}),m=Ze({chainId:v}),g=et({chainId:v}),b=Xe();return p.useEffect((function(){if(c||l){var e=Object($e.a)((function(e){c&&b.setQueryData(rt({chainId:v}),e),l&&l(e)}),1),t=null!==g&&void 0!==g?g:m;return t.on("block",e),function(){t.off("block",e)}}}),[v,l,m,b,c,g]),Ye(rt({chainId:v}),nt,{cacheTime:r,enabled:o,staleTime:a,suspense:u,onError:f,onSettled:d,onSuccess:h})}var ot=function(e){return"object"===typeof e&&!Array.isArray(e)};function at(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(e,t){return Object(Be.b)(e,t)},i=p.useRef([]),o=Object(Ue.useSyncExternalStoreWithSelector)(e,t,r,(function(e){return e}),(function(e,t){if(ot(e)&&ot(t)){var r,o=Object(s.a)(i.current);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(!n(e[a],t[a]))return!1}}catch(u){o.e(u)}finally{o.f()}return!0}return n(e,t)}));if(ot(o)){var a=Object(f.a)({},o);return Object.defineProperties(a,Object.entries(a).reduce((function(e,t){var r=Object(c.a)(t,2),n=r[0],o=r[1];return Object(f.a)(Object(f.a)({},e),{},Object(u.a)({},n,{configurable:!1,enumerable:!0,get:function(){return i.current.includes(n)||i.current.push(n),o}}))}),{})),a}return o}var ut=function(){return Object(Be.n)()};function st(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.suspense,r=e.onError,n=e.onSettled,i=e.onSuccess,o=Ye([{entity:"signer"}],ut,{cacheTime:0,staleTime:1/0,suspense:t,onError:r,onSettled:n,onSuccess:i}),a=Xe();return p.useEffect((function(){return Object(Be.H)((function(e){return a.setQueryData([{entity:"signer"}],e)}))}),[a]),o}var ct=function e(t,r){var n=r.find,i=r.replace;return t&&n(t)?i(t):"object"!==typeof t?t:Array.isArray(t)?t.map((function(t){return e(t,{find:n,replace:i})})):t instanceof Object?Object.entries(t).reduce((function(t,r){var o=Object(c.a)(r,2),a=o[0],s=o[1];return Object(f.a)(Object(f.a)({},t),{},Object(u.a)({},a,e(s,{find:n,replace:i})))}),{}):t};function lt(e){var t=JSON.parse(e);return ct(t,{find:function(e){return"BigNumber"===e.type},replace:function(e){return Fe.BigNumber.from(e.hex)}})}function ft(e,t){return e.slice(0,t).join(".")||"."}function dt(e,t){for(var r=e.length,n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.onConnect,r=e.onDisconnect,n=at(Be.E,Be.q),i=Qe(),o=i.subscribe;return p.useEffect((function(){if(t||r)return o((function(e){return e.status}),(function(e,n){if(t&&"connected"===e){var i=Object(Be.q)(),o=i.address,a=i.connector;t({address:o,connector:a,isReconnected:"reconnecting"===n})}r&&"connecting"!==n&&"disconnected"===e&&r()}))}),[t,r,o]),n}var mt=function(e){return[{entity:"balance",addressOrName:e.addressOrName,chainId:e.chainId,formatUnits:e.formatUnits,token:e.token}]},gt=function(e){var t=Object(c.a)(e.queryKey,1)[0],r=t.addressOrName,n=t.chainId,i=t.formatUnits,o=t.token;if(!r)throw new Error("address is required");return Object(Be.g)({addressOrName:r,chainId:n,formatUnits:i,token:o})};function bt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.addressOrName,r=e.cacheTime,n=e.chainId,i=e.enabled,o=void 0===i||i,a=e.formatUnits,u=e.staleTime,s=e.suspense,c=e.token,l=e.watch,f=e.onError,d=e.onSettled,h=e.onSuccess,v=tt({chainId:n}),m=Ye(mt({addressOrName:t,chainId:v,formatUnits:a,token:c}),gt,{cacheTime:r,enabled:Boolean(o&&t),staleTime:u,suspense:s,onError:f,onSettled:d,onSuccess:h}),g=it({chainId:v,watch:l}),b=g.data;return p.useEffect((function(){o&&l&&b&&t&&m.refetch()}),[b]),m}var yt=function(e){return[Object(f.a)({entity:"connect"},e)]},wt=function(e){var t=e.connector,r=e.chainId;if(!t)throw new Error("connector is required");return Object(Be.a)({connector:t,chainId:r})};function Ot(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.chainId,r=e.connector,n=e.onError,i=e.onMutate,o=e.onSettled,a=e.onSuccess,u=Qe(),s=Je(yt({connector:r,chainId:t}),wt,{onError:n,onMutate:i,onSettled:o,onSuccess:a}),c=s.data,l=s.error,f=s.isError,d=s.isIdle,h=s.isLoading,v=s.isSuccess,m=s.mutate,g=s.mutateAsync,b=s.reset,y=s.status,w=s.variables,O=p.useCallback((function(e){var n,i;return m({chainId:null!==(n=null===e||void 0===e?void 0:e.chainId)&&void 0!==n?n:t,connector:null!==(i=null===e||void 0===e?void 0:e.connector)&&void 0!==i?i:r})}),[t,r,m]),k=p.useCallback((function(e){var n,i;return g({chainId:null!==(n=null===e||void 0===e?void 0:e.chainId)&&void 0!==n?n:t,connector:null!==(i=null===e||void 0===e?void 0:e.connector)&&void 0!==i?i:r})}),[t,r,g]);return{connect:O,connectAsync:k,connectors:u.connectors,data:c,error:l,isError:f,isIdle:d,isLoading:h,isSuccess:v,pendingConnector:null===w||void 0===w?void 0:w.connector,reset:b,status:y,variables:w}}function kt(){return at(Be.F,Be.s)}var Et=function(e){var t=e.addressOrName,r=e.contractInterface,n=e.signerOrProvider;return p.useMemo((function(){return Object(Be.r)({addressOrName:t,contractInterface:r,signerOrProvider:n})}),[t,r,n])}},function(e,t,r){"use strict";var n=r(81),i=r(144);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,c=t;return s+=(c=c+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,c){var l=0,f=t;return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,u,s,c){return t+n+o+u+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="abi/5.7.0"},function(e,t,r){"use strict";var n=r(1),i=r(103),o={fonts:{sans:"-apple-system, BlinkMacSystemFont, 'Segoe UI','Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans','Helvetica Neue', sans-serif;",mono:"Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono','Courier New', monospace;"},fontSizes:{xs:"0.75rem",sm:"0.875rem",base:"1rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xl2:"1.5rem",xl3:"1.875rem",xl4:"2.25rem",xl5:"3rem",xl6:"3.75rem",xl7:"4.5rem",xl8:"6rem",xl9:"8rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},lineHeights:{xs:1,sm:1.25,base:1.5,md:1.5,lg:1.75,xl:1.75,xl2:2,xl3:2.25,xl4:2.5,xl5:1,xl6:1,xl7:1,xl8:1,xl9:1},letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},space:{0:"0rem",xs:"0.5rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"2.25rem",px:"1px",1:"0.125rem",2:"0.25rem",3:"0.375rem",4:"0.5rem",5:"0.625rem",6:"0.75rem",7:"0.875rem",8:"1rem",9:"1.25rem",10:"1.5rem",11:"1.75rem",12:"2rem",13:"2.25rem",14:"2.5rem",15:"2.75rem",16:"3rem",17:"3.5rem",18:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},radii:{xs:"7px",sm:"9px",md:"12px",base:"14px",lg:"14px",xl:"18px",squared:"33%",rounded:"50%",pill:"9999px"},zIndices:{1:"100",2:"200",3:"300",4:"400",5:"500",10:"1000",max:"9999"},borderWeights:{light:"1px",normal:"2px",bold:"3px",extrabold:"4px",black:"5px"},transitions:{default:"all 250ms ease",button:"background 0.25s ease 0s, color 0.25s ease 0s, border-color 0.25s ease 0s, box-shadow 0.25s ease 0s, transform 0.25s ease 0s, opacity 0.25s ease 0s",avatar:"box-shadow 0.25s ease 0s, opacity 0.25s ease 0s",link:"opacity 0.25s ease 0s, background 0.25s ease 0s",card:"transform 0.25s ease 0s, filter 0.25s ease 0s, box-shadow 0.25s ease 0s",dropdownItem:"background 0.25s ease, transform 0.25s ease, color 0.15s ease, box-shadow 0.25s ease 0s"},breakpoints:{xs:"650px",sm:"960px",md:"1280px",lg:"1400px",xl:"1920px"}},a={xs:"(min-width: ".concat(o.breakpoints.xs,")"),sm:"(min-width: ".concat(o.breakpoints.sm,")"),md:"(min-width: ".concat(o.breakpoints.md,")"),lg:"(min-width: ".concat(o.breakpoints.lg,")"),xl:"(min-width: ".concat(o.breakpoints.xl,")"),xsMax:"(max-width: ".concat(o.breakpoints.xs,")"),smMax:"(max-width: ".concat(o.breakpoints.sm,")"),mdMax:"(max-width: ".concat(o.breakpoints.md,")"),lgMax:"(max-width: ".concat(o.breakpoints.lg,")"),xlMax:"(max-width: ".concat(o.breakpoints.xl,")"),motion:"(prefers-reduced-motion: reduce)",safari:"not all and (min-resolution:.001dpcm)",hover:"(any-hover: hover)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"},u=Object(n.a)(Object(n.a)({},i.b),{},{width:"space",height:"space",minWidth:"space",maxWidth:"space",minHeight:"space",maxHeight:"space",flexBasis:"space",gridTemplateColumns:"space",gridTemplateRows:"space",blockSize:"space",minBlockSize:"space",maxBlockSize:"space",inlineSize:"space",minInlineSize:"space",maxInlineSize:"space",borderWidth:"borderWeights"});t.a={prefix:"nextui",theme:Object(n.a)(Object(n.a)({},o),{},{colors:{white:"#ffffff",black:"#000000",primaryLight:"$blue200",primaryLightHover:"$blue300",primaryLightActive:"$blue400",primaryLightContrast:"$blue600",primary:"$blue600",primaryBorder:"$blue500",primaryBorderHover:"$blue600",primarySolidHover:"$blue700",primarySolidContrast:"$white",primaryShadow:"$blue500",secondaryLight:"$purple200",secondaryLightHover:"$purple300",secondaryLightActive:"$purple400",secondaryLightContrast:"$purple600",secondary:"$purple600",secondaryBorder:"$purple500",secondaryBorderHover:"$purple600",secondarySolidHover:"$purple700",secondarySolidContrast:"$white",secondaryShadow:"$purple500",successLight:"$green200",successLightHover:"$green300",successLightActive:"$green400",successLightContrast:"$green700",success:"$green600",successBorder:"$green500",successBorderHover:"$green600",successSolidHover:"$green700",successSolidContrast:"$white",successShadow:"$green500",warningLight:"$yellow200",warningLightHover:"$yellow300",warningLightActive:"$yellow400",warningLightContrast:"$yellow700",warning:"$yellow600",warningBorder:"$yellow500",warningBorderHover:"$yellow600",warningSolidHover:"$yellow700",warningSolidContrast:"$white",warningShadow:"$yellow500",errorLight:"$red200",errorLightHover:"$red300",errorLightActive:"$red400",errorLightContrast:"$red600",error:"$red600",errorBorder:"$red500",errorBorderHover:"$red600",errorSolidHover:"$red700",errorSolidContrast:"$white",errorShadow:"$red500",neutralLight:"$gray100",neutralLightHover:"$gray200",neutralLightActive:"$gray300",neutralLightContrast:"$gray800",neutral:"$gray600",neutralBorder:"$gray400",neutralBorderHover:"$gray500",neutralSolidHover:"$gray600",neutralSolidContrast:"$white",neutralShadow:"$gray400",gradient:"linear-gradient(112deg, $cyan600 -63.59%, $pink600 -20.3%, $blue600 70.46%)",accents0:"$gray50",accents1:"$gray100",accents2:"$gray200",accents3:"$gray300",accents4:"$gray400",accents5:"$gray500",accents6:"$gray600",accents7:"$gray700",accents8:"$gray800",accents9:"$gray900",border:"$gray300"},shadows:{},dropShadows:{}}),media:a,utils:{p:function(e){return{padding:e}},pt:function(e){return{paddingTop:e}},pr:function(e){return{paddingRight:e}},pb:function(e){return{paddingBottom:e}},pl:function(e){return{paddingLeft:e}},px:function(e){return{paddingLeft:e,paddingRight:e}},py:function(e){return{paddingTop:e,paddingBottom:e}},m:function(e){return{margin:e}},mt:function(e){return{marginTop:e}},mr:function(e){return{marginRight:e}},mb:function(e){return{marginBottom:e}},ml:function(e){return{marginLeft:e}},mx:function(e){return{marginLeft:e,marginRight:e}},my:function(e){return{marginTop:e,marginBottom:e}},ta:function(e){return{textAlign:e}},tt:function(e){return{textTransform:e}},to:function(e){return{textOverflow:e}},d:function(e){return{display:e}},dflex:function(e){return{display:"flex",alignItems:e,justifyContent:e}},fd:function(e){return{flexDirection:e}},fw:function(e){return{flexWrap:e}},ai:function(e){return{alignItems:e}},ac:function(e){return{alignContent:e}},jc:function(e){return{justifyContent:e}},as:function(e){return{alignSelf:e}},fg:function(e){return{flexGrow:e}},fs:function(e){return{fontSize:e}},fb:function(e){return{flexBasis:e}},bc:function(e){return{backgroundColor:e}},bf:function(e){return{backdropFilter:e}},bg:function(e){return{background:e}},bgBlur:function(e){return{bf:"saturate(180%) blur(10px)",bg:e}},bgColor:function(e){return{backgroundColor:e}},backgroundClip:function(e){return{WebkitBackgroundClip:e,backgroundClip:e}},bgClip:function(e){return{WebkitBackgroundClip:e,backgroundClip:e}},br:function(e){return{borderRadius:e}},bw:function(e){return{borderWidth:e}},btrr:function(e){return{borderTopRightRadius:e}},bbrr:function(e){return{borderBottomRightRadius:e}},bblr:function(e){return{borderBottomLeftRadius:e}},btlr:function(e){return{borderTopLeftRadius:e}},bs:function(e){return{boxShadow:e}},ds:function(e){return{dropShadow:e}},shadow:function(e){return{boxShadow:e}},dshadow:function(e){return{dropShadow:e}},dropShadow:function(e){return{filter:"$dropShadows".concat(e)}},normalShadow:function(e){return{boxShadow:"0 4px 14px 0 $colors".concat(e)}},normalShadowVar:function(e){return{boxShadow:"0 4px 14px 0 ".concat(e)}},lh:function(e){return{lineHeight:e}},ov:function(e){return{overflow:e}},ox:function(e){return{overflowX:e}},oy:function(e){return{overflowY:e}},pe:function(e){return{pointerEvents:e}},events:function(e){return{pointerEvents:e}},us:function(e){return{WebkitUserSelect:e,userSelect:e}},userSelect:function(e){return{WebkitUserSelect:e,userSelect:e}},w:function(e){return{width:e}},h:function(e){return{height:e}},mw:function(e){return{maxWidth:e}},maxW:function(e){return{maxWidth:e}},mh:function(e){return{maxHeight:e}},maxH:function(e){return{maxHeight:e}},size:function(e){return{width:e,height:e}},minSize:function(e){return{minWidth:e,minHeight:e,width:e,height:e}},sizeMin:function(e){return{minWidth:e,minHeight:e,width:e,height:e}},maxSize:function(e){return{maxWidth:e,maxHeight:e}},sizeMax:function(e){return{maxWidth:e,maxHeight:e}},appearance:function(e){return{WebkitAppearance:e,appearance:e}},scale:function(e){return{transform:"scale(".concat(e,")")}},linearGradient:function(e){return{backgroundImage:"linear-gradient(".concat(e,")")}},tdl:function(e){return{textDecorationLine:e}},truncateText:function(e){return{maxWidth:e,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},textGradient:function(e){return{backgroundImage:"linear-gradient(".concat(e,")"),WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent","&::selection":{WebkitTextFillColor:"$colors$text"}}}},themeMap:u}},function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"h",(function(){return o})),r.d(t,"e",(function(){return a})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return s})),r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return f}));var n=r(28),i=n.a.from(-1),o=n.a.from(0),a=n.a.from(1),u=n.a.from(2),s=n.a.from("1000000000000000000"),c=n.a.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),l=n.a.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),f=n.a.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(26),i=r(34);function o(e){return Object(n.keccak256)(Object(i.f)(e))}},function(e,t,r){"use strict";r.r(t),r.d(t,"AddressZero",(function(){return n.a})),r.d(t,"NegativeOne",(function(){return i.d})),r.d(t,"Zero",(function(){return i.h})),r.d(t,"One",(function(){return i.e})),r.d(t,"Two",(function(){return i.f})),r.d(t,"WeiPerEther",(function(){return i.g})),r.d(t,"MaxUint256",(function(){return i.b})),r.d(t,"MinInt256",(function(){return i.c})),r.d(t,"MaxInt256",(function(){return i.a})),r.d(t,"HashZero",(function(){return o.a})),r.d(t,"EtherSymbol",(function(){return a}));var n=r(127),i=r(57),o=r(126),a="\u039e"},function(e,t,r){"use strict";r.r(t),r.d(t,"BaseX",(function(){return u})),r.d(t,"Base32",(function(){return s})),r.d(t,"Base58",(function(){return c}));var n=r(6),i=r(7),o=r(2),a=r(4),u=function(){function e(t){Object(n.a)(this,e),Object(a.defineReadOnly)(this,"alphabet",t),Object(a.defineReadOnly)(this,"base",t.length),Object(a.defineReadOnly)(this,"_alphabetMap",{}),Object(a.defineReadOnly)(this,"_leader",t.charAt(0));for(var r=0;r0;)r.push(i%this.base),i=i/this.base|0}for(var u="",s=0;0===t[s]&&s=0;--c)u+=this.alphabet[r[c]];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&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[K(e)]=!0}));var r=Object.keys(t);return r.sort(),r.join("|")}return K(e)})).join("&")}function G(e){if("string"===typeof e){if(e=e.toLowerCase(),32===Object(E.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+W(e);if(n.a.isForkEvent(e))throw z.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+W(e.topics||[])}throw new Error("invalid event - "+e)}function q(){return(new Date).getTime()}function V(e){return new Promise((function(t){setTimeout(t,e)}))}var Q=["block","network","pending","poll"],J=function(){function e(t,r,n){Object(b.a)(this,e),Object(S.defineReadOnly)(this,"tag",t),Object(S.defineReadOnly)(this,"listener",r),Object(S.defineReadOnly)(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return Object(y.a)(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||Q.indexOf(this.tag)>=0}}]),e}(),Y={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 X(e){return Object(E.hexZeroPad)(k.a.from(e).toHexString(),32)}function Z(e){return O.Base58.encode(Object(E.concat)([e,Object(E.hexDataSlice)(Object(A.c)(Object(A.c)(e)),0,4)]))}var ee=new RegExp("^(ipfs)://(.*)$","i"),te=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ee,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function re(e,t){try{return Object(P.h)(ne(e,t))}catch(r){}return null}function ne(e,t){if("0x"===e)return null;var r=k.a.from(Object(E.hexDataSlice)(e,t,t+32)).toNumber(),n=k.a.from(Object(E.hexDataSlice)(e,r,r+32)).toNumber();return Object(E.hexDataSlice)(e,r+32,r+32+n)}function ie(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):z.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function oe(e){var t=Object(E.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 ae(e){if(e.length%32===0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function ue(e){for(var t=[],r=0,n=0;n=1&&a<=75)return Z(Object(E.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 Z(Object(E.concat)([[r.p2sh],"0x"+u[2]]))}}if(null!=r.prefix){var c=n[1],l=n[0];if(0===l?20!==c&&32!==c&&(l=-1):l=-1,l>=0&&n.length===2+c&&c>=1&&c<=75){var f=M.a.toWords(n.slice(2));return f.unshift(l),M.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(e){return H(this,void 0,void 0,g.a.mark((function t(){var r,n,o;return g.a.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!==j.a){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",X(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))&&z.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 H(this,void 0,void 0,g.a.mark((function e(){var t,r,n,i,o,a,u,s,c,l,f,d,h,p,v,m;return g.a.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=0?null:JSON.stringify({data:a,sender:o}),n.next=12,Object(C.fetchJson)({url:l,errorPassThrough:!0},f,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(d=n.sent).data){n.next=15;break}return n.abrupt("return",d.data);case 15:if(h=d.message||"unknown error",!(d.status>=400&&d.status<500)){n.next=18;break}return n.abrupt("return",z.throwError("response not found during CCIP fetch: ".concat(h),i.Logger.errors.SERVER_ERROR,{url:c,errorMessage:h}));case 18:u.push(h);case 19:s++,n.next=6;break;case 22:return n.abrupt("return",z.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 H(this,void 0,void 0,g.a.mark((function t(){var r,n,i,o,a=this;return g.a.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,!(q()-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=q(),o=Object(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=q();return(t=k.a.from(t).toNumber())1e3)z.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",z.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 H(this,void 0,void 0,g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",z.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 H(this,void 0,void 0,g.a.mark((function e(){var t,r,n;return g.a.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,V(0);case 19:return e.abrupt("return",this._network);case 20:throw n=z.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=q();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&ðis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,r){return H(this,void 0,void 0,g.a.mark((function n(){return g.a.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 H(this,void 0,void 0,g.a.mark((function o(){var a,u=this;return g.a.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=[],c=!1,l=function(){return!!c||(c=!0,s.forEach((function(e){e()})),!1)},f=function(e){e.confirmations0){var v=setTimeout((function(){l()||a(z.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 H(this,void 0,void 0,g.a.mark((function e(){return g.a.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 H(this,void 0,void 0,g.a.mark((function e(){var t;return g.a.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.a.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",z.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 H(this,void 0,void 0,g.a.mark((function r(){var n,o;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,Object(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.a.from(o));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",z.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 H(this,void 0,void 0,g.a.mark((function r(){var n,o;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,Object(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.a.from(o).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",z.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 H(this,void 0,void 0,g.a.mark((function r(){var n,o;return g.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,Object(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",Object(E.hexlify)(o));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",z.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 H(this,void 0,void 0,g.a.mark((function n(){var o,a;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,Object(S.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((function(e){return Object(E.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",Object(E.hexlify)(a));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",z.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!==Object(E.hexDataLength)(t))throw new Error("invalid response - sendTransaction");var o=e;return null!=t&&e.hash!==t&&z.throwError("Transaction hash mismatch from Provider.sendTransaction.",i.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),o.wait=function(t,o){return H(n,void 0,void 0,g.a.mark((function n(){var a,u;return g.a.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&&z.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 H(this,void 0,void 0,g.a.mark((function t(){var r,n,i,o;return g.a.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 Object(E.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 H(this,void 0,void 0,g.a.mark((function t(){var r,n,i=this;return g.a.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.a.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?Object(E.hexlify)(e):null})))})),t.t0=this.formatter,t.next=12,Object(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 H(this,void 0,void 0,g.a.mark((function t(){var r,n=this;return g.a.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,Object(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 H(this,void 0,void 0,g.a.mark((function n(){var o,a,u,s,c,l,f,d,h,p,v,m,b,y,w;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&z.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)&&Object(E.hexDataLength)(a)%32===4)){n.next=31;break}for(n.prev=6,u=Object(E.hexDataSlice)(a,4),s=Object(E.hexDataSlice)(u,0,32),k.a.from(s).eq(o)||z.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}),c=[],l=k.a.from(Object(E.hexDataSlice)(u,32,64)).toNumber(),f=k.a.from(Object(E.hexDataSlice)(u,l,l+32)).toNumber(),d=Object(E.hexDataSlice)(u,l+32),h=0;hthis._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 J(G(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/)&&be.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 ke(e){return new Promise((function(t){setTimeout(t,e)}))}function Ee(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 je(e){return e?e.toLowerCase():e}var xe={},Se=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(e,n,i){var o;if(Object(b.a)(this,r),o=t.call(this),e!==xe)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return Object(S.defineReadOnly)(Object(h.a)(o),"provider",n),null==i&&(i=0),"string"===typeof i?(Object(S.defineReadOnly)(Object(h.a)(o),"_address",o.provider.formatter.address(i)),Object(S.defineReadOnly)(Object(h.a)(o),"_index",null)):"number"===typeof i?(Object(S.defineReadOnly)(Object(h.a)(o),"_index",i),Object(S.defineReadOnly)(Object(h.a)(o),"_address",null)):be.throwArgumentError("invalid address or index","addressOrIndex",i),o}return Object(y.a)(r,[{key:"connect",value:function(e){return be.throwError("cannot alter JSON-RPC Signer connection",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new Ae(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&&be.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=Object(S.shallowCopy)(e);var r=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var n=Object(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 ge(t,void 0,void 0,g.a.mark((function t(){var r;return g.a.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)&&be.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))}))),Object(S.resolveProperties)({tx:Object(S.resolveProperties)(e),sender:r}).then((function(r){var n=r.tx,o=r.sender;null!=n.from?n.from.toLowerCase()!==o&&be.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)&&be.throwError("user rejected transaction",i.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),Oe("sendTransaction",e,a)}))}))}},{key:"signTransaction",value:function(e){return be.throwError("signing transactions is unsupported",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return ge(this,void 0,void 0,g.a.mark((function t(){var r,n,i=this;return g.a.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,Object(C.poll)((function(){return ge(i,void 0,void 0,g.a.mark((function e(){var t;return g.a.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 ge(this,void 0,void 0,g.a.mark((function t(){var r,n;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"===typeof e?Object(P.f)(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[Object(E.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)&&be.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 ge(this,void 0,void 0,g.a.mark((function t(){var r,n;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"===typeof e?Object(P.f)(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(),Object(E.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)&&be.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 ge(this,void 0,void 0,g.a.mark((function n(){var o,a,u=this;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,me.a.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(me.a.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)&&be.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 ge(this,void 0,void 0,g.a.mark((function t(){var r,n;return g.a.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}(ve.Signer),Ae=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(){return Object(b.a)(this,r),t.apply(this,arguments)}return Object(y.a)(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}(Se),Pe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},Ce=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(e,n){var i;Object(b.a)(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=Object(S.getStatic)(i.constructor,"defaultUrl")()),"string"===typeof e?Object(S.defineReadOnly)(Object(h.a)(i),"connection",Object.freeze({url:e})):Object(S.defineReadOnly)(Object(h.a)(i),"connection",Object.freeze(Object(S.shallowCopy)(e))),i._nextId=42,i}return Object(y.a)(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 ge(this,void 0,void 0,g.a.mark((function e(){var t,r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ke(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=Object(S.getStatic)(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",r(k.a.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",be.throwError("could not detect network",i.Logger.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",be.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 Se(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:Object(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=Object(C.fetchJson)(this.connection,JSON.stringify(n),Ee).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",[je(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[je(t.address),t.blockTag]];case"getCode":return["eth_getCode",[je(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[je(t.address),Object(E.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",[Object(S.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[Object(S.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=je(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return ge(this,void 0,void 0,g.a.mark((function r(){var n,o,a;return g.a.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.a.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=Object(S.shallowCopy)(t)).transaction=Object(S.shallowCopy)(n),delete t.transaction.type);case 8:return null==(a=this.prepareRequest(e,t))&&be.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",Oe(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(),Object(he.a)(Object(pe.a)(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 ke(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),Object(he.a)(Object(pe.a)(r.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var r=Object(S.shallowCopy)(Pe);if(t)for(var n in t)t[n]&&(r[n]=!0);Object(S.checkProperties)(e,r);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var r=Object(E.hexValue)(k.a.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=Object(E.hexlify)(e[t]))})),e.accessList&&(i.accessList=Object(L.accessListify)(e.accessList)),i}}]),r}(fe),Te=null;try{if(null==(Te=WebSocket))throw new Error("inject please")}catch(Dt){var Me=new i.Logger(R);Te=function(){Me.throwError("WebSockets not supported in this environment",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Re=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())}))},Ne=new i.Logger(R),_e=1,Le=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(e,n){var o,a;Object(b.a)(this,r),"any"===n&&Ne.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?Object(S.defineReadOnly)(Object(h.a)(a),"_websocket",new Te(a.connection.url)):Object(S.defineReadOnly)(Object(h.a)(a),"_websocket",e),Object(S.defineReadOnly)(Object(h.a)(a),"_requests",{}),Object(S.defineReadOnly)(Object(h.a)(a),"_subs",{}),Object(S.defineReadOnly)(Object(h.a)(a),"_subIds",{}),Object(S.defineReadOnly)(Object(h.a)(a),"_detectNetwork",Object(he.a)((o=Object(h.a)(a),Object(pe.a)(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:Object(h.a)(a)});else{var o=null;r.error?(o=new Error(r.error.message||"unknown error"),Object(S.defineReadOnly)(o,"code",r.error.code||null),Object(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:Object(h.a)(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(),Object(de.a)(a)}return Object(y.a)(r,[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){Ne.throwError("cannot set polling interval on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){Ne.throwError("cannot reset events block on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return Re(this,void 0,void 0,g.a.mark((function e(){return g.a.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&&Ne.throwError("cannot set polling on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var r=this,n=_e++;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 Re(this,void 0,void 0,g.a.mark((function n(){var i,o,a=this;return g.a.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.a.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 Re(this,void 0,void 0,g.a.mark((function e(){var t=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.websocket.readyState!==Te.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}(Ce),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())}))},Be=new i.Logger(R),De=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(){return Object(b.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return Object(he.a)(Object(pe.a)(r.prototype),"detectNetwork",e)}}});return Ie(this,void 0,void 0,g.a.mark((function e(){var r;return g.a.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)||Be.throwError("no network detected",i.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(Object(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}(Ce),Fe=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(e,n){var i;Object(b.a)(this,r),Be.checkAbstract(this instanceof r?this.constructor:void 0,r),e=Object(S.getStatic)(this instanceof r?this.constructor:void 0,"getNetwork")(e),n=Object(S.getStatic)(this instanceof r?this.constructor:void 0,"getApiKey")(n);var o=Object(S.getStatic)(this instanceof r?this.constructor:void 0,"getUrl")(e,n);return i=t.call(this,o,e),"string"===typeof n?Object(S.defineReadOnly)(Object(h.a)(i),"apiKey",n):null!=n&&Object.keys(n).forEach((function(e){Object(S.defineReadOnly)(Object(h.a)(i),e,n[e])})),i}return Object(y.a)(r,[{key:"_startPending",value:function(){Be.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return Be.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 Be.throwError("not implemented; sub-classes must override getUrl",i.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),r}(De),Ue=new i.Logger(R),$e="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",He=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(e,n){var i;Object(b.a)(this,r);var o=new ze(e,n),a=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return i=t.call(this,a,o.network),Object(S.defineReadOnly)(Object(h.a)(i),"apiKey",o.apiKey),i}return Object(y.a)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===$e}}]),r}(Le),ze=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(){return Object(b.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===$e}}],[{key:"getWebSocketProvider",value:function(e,t){return new He(e,t)}},{key:"getApiKey",value:function(e){return null==e?$e:(e&&"string"!==typeof e&&Ue.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"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/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-rinkeby":r="arb-rinkeby.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-kovan":r="opt-kovan.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:Ue.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:function(e,r){return t===$e&&$(),Promise.resolve(!0)}}}}]),r}(Fe),Ke=new i.Logger(R),We="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Ge(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 Ke.throwArgumentError("unsupported network","name",e)}var qe=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(){return Object(b.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===We}}],[{key:"getApiKey",value:function(e){return null==e?We:e}},{key:"getUrl",value:function(e,t){null==t&&(t=We);var r={allowGzip:!0,url:"https://"+Ge(e.name)+t,throttleCallback:function(e,r){return t.apiKey===We&&$(),Promise.resolve(!0)}};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}]),r}(Fe),Ve=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(R),Je=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(){return Object(b.a)(this,r),t.apply(this,arguments)}return Object(y.a)(r,[{key:"perform",value:function(e,t){var n=this,i=Object.create(null,{perform:{get:function(){return Object(he.a)(Object(pe.a)(r.prototype),"perform",n)}}});return Ve(this,void 0,void 0,g.a.mark((function r(){var n;return g.a.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&&Qe.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var r=null;switch(e.name){case"homestead":r="https://cloudflare-eth.com/";break;default:Qe.throwArgumentError("unsupported network","network",arguments[0])}return r}}]),r}(Fe),Ye=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())}))},Xe=new i.Logger(R);function Ze(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]?Object(E.hexValue)(Object(E.hexlify)(n)):"accessList"===r?"["+Object(L.accessListify)(n).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(E.hexlify)(n),t[r]=n)}return t}function et(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 tt(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 rt(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function nt(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,"")),Object(E.isHexString)(o))return o;Xe.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/)&&Xe.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/)&&Xe.throwError("nonce has already been used",i.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),a.match(/another transaction with same nonce/)&&Xe.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/)&&Xe.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 it=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(e,n){var i;return Object(b.a)(this,r),i=t.call(this,e),Object(S.defineReadOnly)(Object(h.a)(i),"baseUrl",i.getBaseUrl()),Object(S.defineReadOnly)(Object(h.a)(i),"apiKey",n||null),i}return Object(y.a)(r,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-kovan":return"https://api-kovan-optimistic.etherscan.io"}return Xe.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 Ye(this,void 0,void 0,g.a.mark((function n(){var i,o,a,u,s,c,l=this;return g.a.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?tt:et,this.emit("debug",{action:"request",request:i,provider:this}),u={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return l.isCommunityResource()&&$(),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,Object(C.fetchJson)(u,s,a||tt);case 9:return c=n.sent,this.emit("debug",{action:"response",request:i,response:Object(S.deepCopy)(c),provider:this}),n.abrupt("return",c);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return Ye(this,void 0,void 0,g.a.mark((function e(){return g.a.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 Object(he.a)(Object(pe.a)(r.prototype),"perform",n)}}});return Ye(this,void 0,void 0,g.a.mark((function r(){var n,a,u,s,c,l,f,d,h;return g.a.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 nt("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=Ze(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",nt("call",r.t1,t.transaction));case 29:return(a=Ze(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",nt("estimateGas",r.t2,t.transaction));case 41:return u={action:"getLogs"},t.filter.fromBlock&&(u.fromBlock=rt(t.filter.fromBlock)),t.filter.toBlock&&(u.toBlock=rt(t.filter.toBlock)),t.filter.address&&(u.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Xe.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||Xe.throwError("unsupported topic format",i.Logger.errors.UNSUPPORTED_OPERATION,{topic0:s}),u.topic0=s)),r.next=48,this.fetch("logs",u);case 48:c=r.sent,l={},f=0;case 51:if(!(ft?null:(n+i)/2}function ft(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.a.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return ft(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]":ft(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var dt=1;function ht(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 pt=[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],vt=["address","args","errorArgs","errorSignature","method","transaction"];function mt(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 gt(e,t,r){var n=ft;switch(t){case"getBlockNumber":return function(t){var r=t.map((function(e){return e.result})),n=lt(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 lt(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=Object(S.shallowCopy)(e)).confirmations=-1,ft(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=Object(S.shallowCopy)(e)).transactions=e.transactions.map((function(e){return(e=Object(S.shallowCopy)(e)).confirmations=-1,e})),ft(e))}:function(e){return null==e?null:ft(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 bt(e,t){return at(this,void 0,void 0,g.a.mark((function r(){var n;return g.a.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",Object(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 yt(e,t,r,n){return at(this,void 0,void 0,g.a.mark((function o(){var a,u;return g.a.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||!Object(E.isHexString)(n.blockTag)){o.next=12;break}return o.next=11,bt(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||!Object(E.isHexString)(n.blockTag)){o.next=17;break}return o.next=16,bt(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||!Object(E.isHexString)(n.blockTag)){o.next=22;break}return o.next=21,bt(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||!Object(E.isHexString)(n.blockTag)){o.next=27;break}return o.next=26,bt(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&&Object(E.isHexString)(u.fromBlock)||u.toBlock&&Object(E.isHexString)(u.toBlock))){o.next=36;break}return o.next=35,bt(e,t);case 35:a=o.sent;case 36:return o.abrupt("return",a.getLogs(u));case 37:return o.abrupt("return",ut.throwError("unknown method error",i.Logger.errors.UNKNOWN_ERROR,{method:r,params:n}));case 38:case"end":return o.stop()}}),o)})))}var wt=function(e){Object(p.a)(r,e);var t=Object(v.a)(r);function r(e,i){var o;Object(b.a)(this,r),0===e.length&&ut.throwArgumentError("missing providers","providers",e);var a=e.map((function(e,t){if(n.b.isProvider(e)){var r=F(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}var i=Object(S.shallowCopy)(e);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=F(e)?2e3:750),null==i.weight&&(i.weight=1);var o=i.weight;return(o%1||o>512||o<1)&&ut.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&&ut.throwArgumentError("quorum will always fail; larger than total weight","quorum",i);var s=ct(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),Object(S.defineReadOnly)(Object(h.a)(o),"providerConfigs",Object.freeze(a)),Object(S.defineReadOnly)(Object(h.a)(o),"quorum",i),o._highestBlockNumber=-1,o}return Object(y.a)(r,[{key:"detectNetwork",value:function(){return at(this,void 0,void 0,g.a.mark((function e(){var t;return g.a.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",ct(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return at(this,void 0,void 0,g.a.mark((function r(){var n,o,a,u,s,c,l,f,d,h,p=this;return g.a.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=19;break}if(void 0===(h=u(d))){r.next=15;break}return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",{v:h});case 15:if(f){r.next=18;break}return r.next=18,ht(100).getPromise();case 18:f=!1;case 19:if(v=s.reduce((function(e,t){if(!t.done||null==t.error)return e;var r=t.error.code;return pt.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.weight0&&Array.isArray(t)?e(t,i-1):r.push(t)}))}(e,t),r}function d(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>--c&1}for(var d=Math.pow(2,31),h=d>>>1,p=h>>1,v=d-1,m=0,g=0;g<31;g++)m=m<<1|f();for(var b=[],y=0,w=d;;){for(var O=Math.floor(((m-y+1)*i-1)/w),k=0,E=n;E-k>1;){var j=k+E>>>1;O>>1|f(),x=x<<1^h,S=(S^h)<<1|h|1;y=x,w=1+S-x}var A=n-4;return b.map((function(t){switch(t-A){case 3:return A+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return A+256+(e[s++]<<8|e[s++]);case 1:return A+e[s++];default:return t-1}}))}(e))}function h(e){return 1&e?~e>>1:e>>1}function p(e,t){for(var r=Array(e),n=0,i=-1;n>=1),check:2==o}}()}(w);function x(e){return Object(i.g)(e)}function S(e){return e.filter((function(e){return 65039!=e}))}function A(e){var t,r=Object(c.a)(e.split("."));try{for(r.s();!(t=r.n()).done;){var n=t.value,i=x(n);try{for(var o=i.lastIndexOf(95)-1;o>=0;o--)if(95!==i[o])throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(e){return e<128}))&&45===i[2]&&45===i[3])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 P(e){return A(function(e,t){var r=x(e).reverse(),n=[];for(;r.length;){var i=C(r);if(i)n.push.apply(n,Object(s.a)(t(i)));else{var o=r.pop();if(O.has(o))n.push(o);else if(!k.has(o)){var a=E[o];if(!a)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));n.push.apply(n,Object(s.a)(a))}}}return A((u=String.fromCodePoint.apply(String,n),u.normalize("NFC")));var u}(e,S))}function C(e,t){var r,n,i,o=j,a=[],u=e.length;t&&(t.length=0);for(var c=function(){var c=e[--u];if(!(o=null===(r=o.branches.find((function(e){return e.set.has(c)})))||void 0===r?void 0:r.node))return"break";if(o.save)i=c;else if(o.check&&c===i)return"break";a.push(c),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,Object(s.a)(e.slice(u).reverse())),e.length=u)};u;){if("break"===c())break}return n}var T=new a.Logger(u.a),M=new Uint8Array(32);function R(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function N(e){var t=Object(i.f)(P(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 _(e){return N(e).map((function(e){return Object(i.h)(e)})).join(".")}function L(e){try{return 0!==N(e).length}catch(t){}return!1}function I(e){"string"!==typeof e&&T.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=M,r=N(e);r.length;)t=Object(o.keccak256)(Object(n.concat)([t,Object(o.keccak256)(r.pop())]));return Object(n.hexlify)(t)}function B(e){return Object(n.hexlify)(Object(n.concat)(N(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)},function(e,t,r){"use strict";r.r(t),r.d(t,"BaseContract",(function(){return B})),r.d(t,"Contract",(function(){return D})),r.d(t,"ContractFactory",(function(){return F}));var n=r(12),i=r(13),o=r(24),a=r(22),u=r(9),s=r(10),c=r(6),l=r(7),f=r(3),d=r.n(f),h=r(31),p=r(80),v=r(51),m=r(48),g=r(29),b=r(28),y=r(2),w=r(4),O=r(35),k=r(5),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())}))},j=new k.Logger("contracts/5.7.0"),x={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function S(e,t){return E(this,void 0,void 0,d.a.mark((function r(){var n,i;return d.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t;case 2:return"string"!==typeof(n=r.sent)&&j.throwArgumentError("invalid address or ENS name","name",n),r.prev=4,r.abrupt("return",Object(g.getAddress)(n));case 8:r.prev=8,r.t0=r.catch(4);case 10:return e||j.throwError("a provider or signer is needed to resolve ENS names",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),r.next=13,e.resolveName(n);case 13:return null==(i=r.sent)&&j.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r.abrupt("return",i);case 16:case"end":return r.stop()}}),r,null,[[4,8]])})))}function A(e,t,r){return E(this,void 0,void 0,d.a.mark((function n(){return d.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=4;break}return n.next=3,Promise.all(r.map((function(r,n){return A(e,Array.isArray(t)?t[n]:t[r.name],r)})));case 3:return n.abrupt("return",n.sent);case 4:if("address"!==r.type){n.next=8;break}return n.next=7,S(e,t);case 7:return n.abrupt("return",n.sent);case 8:if("tuple"!==r.type){n.next=12;break}return n.next=11,A(e,t,r.components);case 11:return n.abrupt("return",n.sent);case 12:if("array"!==r.baseType){n.next=18;break}if(Array.isArray(t)){n.next=15;break}return n.abrupt("return",Promise.reject(j.makeError("invalid value for array",k.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})));case 15:return n.next=17,Promise.all(t.map((function(t){return A(e,t,r.arrayChildren)})));case 17:return n.abrupt("return",n.sent);case 18:return n.abrupt("return",t);case 19:case"end":return n.stop()}}),n)})))}function P(e,t,r){return E(this,void 0,void 0,d.a.mark((function n(){var i,o,a,u,s,c,l,f,h,p,v=this;return d.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i={},r.length===t.inputs.length+1&&"object"===typeof r[r.length-1]&&(i=Object(w.shallowCopy)(r.pop())),j.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?i.from?i.from=Object(w.resolveProperties)({override:S(e.signer,i.from),signer:e.signer.getAddress()}).then((function(e){return E(v,void 0,void 0,d.a.mark((function t(){return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Object(g.getAddress)(e.signer)!==e.override&&j.throwError("Contract with a Signer cannot override from",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.abrupt("return",e.override);case 2:case"end":return t.stop()}}),t)})))})):i.from=e.signer.getAddress():i.from&&(i.from=S(e.provider,i.from)),n.next=6,Object(w.resolveProperties)({args:A(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:Object(w.resolveProperties)(i)||{}});case 6:if(o=n.sent,a=e.interface.encodeFunctionData(t,o.args),u={data:a,to:o.address},null!=(s=o.overrides).nonce&&(u.nonce=b.a.from(s.nonce).toNumber()),null!=s.gasLimit&&(u.gasLimit=b.a.from(s.gasLimit)),null!=s.gasPrice&&(u.gasPrice=b.a.from(s.gasPrice)),null!=s.maxFeePerGas&&(u.maxFeePerGas=b.a.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(u.maxPriorityFeePerGas=b.a.from(s.maxPriorityFeePerGas)),null!=s.from&&(u.from=s.from),null!=s.type&&(u.type=s.type),null!=s.accessList&&(u.accessList=Object(O.accessListify)(s.accessList)),null==u.gasLimit&&null!=t.gas){for(c=21e3,l=Object(y.arrayify)(a),f=0;f1)){e=e.substring(1);var r=t[0];try{null==i[e]&&Object(w.defineReadOnly)(i,e,i[r])}catch(n){}null==i.functions[e]&&Object(w.defineReadOnly)(i.functions,e,i.functions[r]),null==i.callStatic[e]&&Object(w.defineReadOnly)(i.callStatic,e,i.callStatic[r]),null==i.populateTransaction[e]&&Object(w.defineReadOnly)(i.populateTransaction,e,i.populateTransaction[r]),null==i.estimateGas[e]&&Object(w.defineReadOnly)(i.estimateGas,e,i.estimateGas[r])}}))}return Object(l.a)(e,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(e){var t=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return t})):this._deployedPromise=this.provider.getCode(this.address,e).then((function(e){return"0x"===e&&j.throwError("contract not deployed",k.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this;this.signer||j.throwError("sending a transactions require a signer",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=Object(w.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=r[e]&&j.throwError("cannot override "+e,k.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),r.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(r)}))}},{key:"connect",value:function(e){"string"===typeof e&&(e=new m.VoidSigner(e,this.provider));var t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Object(w.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}},{key:"attach",value:function(e){return new this.constructor(e,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}},{key:"_getRunningEvent",value:function(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new _);if("event"===e)return this._normalizeRunningEvent(new N("event",null));if("*"===e)return this._normalizeRunningEvent(new I(this.address,this.interface));var t=this.interface.getEvent(e);return this._normalizeRunningEvent(new L(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var r=e.topics[0];if("string"!==typeof r)throw new Error("invalid topic");var n=this.interface.getEvent(r);return this._normalizeRunningEvent(new L(this.address,this.interface,n,e.topics))}catch(o){}var i={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new N(R(i),i))}return this._normalizeRunningEvent(new I(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];var t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}},{key:"_wrapEvent",value:function(e,t,r){var n=this,i=Object(w.deepCopy)(t);return i.removeListener=function(){r&&(e.removeListener(r),n._checkRunningEvents(e))},i.getBlock=function(){return n.provider.getBlock(t.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(t.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(i),i}},{key:"_addEventListener",value:function(e,t,r){var i=this;if(this.provider||j.throwError("events require a provider or a signer with a provider",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var o=function(r){var o=i._wrapEvent(e,r,t);if(null==o.decodeError)try{var a=e.getEmit(o);i.emit.apply(i,[e.filter].concat(Object(n.a)(a)))}catch(u){o.decodeError=u.error}null!=e.filter&&i.emit("event",o),null!=o.decodeError&&i.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=o,null!=e.filter&&this.provider.on(e.filter,o)}}},{key:"queryFilter",value:function(e,t,r){var n=this,i=this._getRunningEvent(e),o=Object(w.shallowCopy)(i.filter);return"string"===typeof t&&Object(y.isHexString)(t,32)?(null!=r&&j.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((function(e){return e.map((function(e){return n._wrapEvent(i,e,null)}))}))}},{key:"on",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}},{key:"once",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}},{key:"emit",value:function(e){if(!this.provider)return!1;for(var t=this._getRunningEvent(e),r=arguments.length,n=new Array(r>1?r-1:0),i=1;i0;return this._checkRunningEvents(t),o}},{key:"listenerCount",value:function(e){var t=this;return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,r){return e+t._runningEvents[r].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){var t=this;if(!this.provider)return[];if(null==e){var r=function(){var e=[];for(var r in t._runningEvents)t._runningEvents[r].listeners().forEach((function(t){e.push(t)}));return{v:e}}();if("object"===typeof r)return r.v}return this._getRunningEvent(e).listeners()}},{key:"removeAllListeners",value:function(e){if(!this.provider)return this;if(null==e){for(var t in this._runningEvents){var r=this._runningEvents[t];r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(e);return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(e,t){if(!this.provider)return this;var r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return Object(g.getContractAddress)(e)}},{key:"getInterface",value:function(e){return p.b.isInterface(e)?e:new p.b(e)}},{key:"isIndexed",value:function(e){return p.a.isIndexed(e)}}]),e}(),D=function(e){Object(u.a)(r,e);var t=Object(s.a)(r);function r(){return Object(c.a)(this,r),t.apply(this,arguments)}return r}(B),F=function(){function e(t,r,n){Object(c.a)(this,e);var i=null;"0x"!==(i="string"===typeof r?r:Object(y.isBytes)(r)?Object(y.hexlify)(r):r&&"string"===typeof r.object?r.object:"!").substring(0,2)&&(i="0x"+i),(!Object(y.isHexString)(i)||i.length%2)&&j.throwArgumentError("invalid bytecode","bytecode",r),n&&!m.Signer.isSigner(n)&&j.throwArgumentError("invalid signer","signer",n),Object(w.defineReadOnly)(this,"bytecode",i),Object(w.defineReadOnly)(this,"interface",Object(w.getStatic)(this instanceof e?this.constructor:void 0,"getInterface")(t)),Object(w.defineReadOnly)(this,"signer",n||null)}return Object(l.a)(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,r=new Array(t),n=0;n1024||e%1||e!=e)&&a.throwArgumentError("invalid length","length",e);var t=new Uint8Array(e);return s.getRandomValues(t),Object(n.arrayify)(t)}s&&s.getRandomValues||(a.warn("WARNING: Missing strong random number source"),s={getRandomValues:function(e){return a.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(79))},function(e,t,r){"use strict";r.d(t,"b",(function(){return o}));var n=r(0),i=r.n(n),o={isDark:!1,theme:r(25).f,type:"light"},a=i.a.createContext(o);t.a=a},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.Wordlist=t.version=t.wordlists=t.utils=t.logger=t.errors=t.constants=t.FixedNumber=t.BigNumber=t.ContractFactory=t.Contract=t.BaseContract=t.providers=t.getDefaultProvider=t.VoidSigner=t.Wallet=t.Signer=void 0;var a=r(70);Object.defineProperty(t,"BaseContract",{enumerable:!0,get:function(){return a.BaseContract}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return a.Contract}}),Object.defineProperty(t,"ContractFactory",{enumerable:!0,get:function(){return a.ContractFactory}});var u=r(38);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return u.BigNumber}}),Object.defineProperty(t,"FixedNumber",{enumerable:!0,get:function(){return u.FixedNumber}});var s=r(48);Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return s.Signer}}),Object.defineProperty(t,"VoidSigner",{enumerable:!0,get:function(){return s.VoidSigner}});var c=r(93);Object.defineProperty(t,"Wallet",{enumerable:!0,get:function(){return c.Wallet}});var l=o(r(59));t.constants=l;var f=o(r(68));t.providers=f;var d=r(68);Object.defineProperty(t,"getDefaultProvider",{enumerable:!0,get:function(){return d.getDefaultProvider}});var h=r(112);Object.defineProperty(t,"Wordlist",{enumerable:!0,get:function(){return h.Wordlist}}),Object.defineProperty(t,"wordlists",{enumerable:!0,get:function(){return h.wordlists}});var p=o(r(37));t.utils=p;var v=r(5);Object.defineProperty(t,"errors",{enumerable:!0,get:function(){return v.ErrorCode}});var m=r(157);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return m.version}});var g=new v.Logger(m.version);t.logger=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(Object.is(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(var n=0;n1&&g.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[p.f.fromString(e).format()];return i||g.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if(Object(c.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.c.fromString(e).format()];return o||g.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if(Object(c.isHexString)(e)){var t=Object(d.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.f.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 Object(d.getStatic)(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"===typeof e&&(e=this.getEvent(e)),Object(d.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=Object(c.arrayify)(t);return Object(c.hexlify)(r.slice(0,4))!==this.getSighash(e)&&g.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(c.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"===typeof e&&(e=this.getError(e)),Object(c.hexlify)(Object(c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=Object(c.arrayify)(t);return Object(c.hexlify)(r.slice(0,4))!==this.getSighash(e)&&g.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(c.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),Object(c.hexlify)(Object(c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=Object(c.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=Object(c.hexlify)(r.slice(0,4)),l=k[s];if(l)o=this._abiCoder.decode(l.inputs,r.slice(4)),a=l.name,u=l.signature,l.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:Object(c.hexlify)(t),errorArgs:o,errorName:a,errorSignature:u,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),Object(c.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?Object(l.a)(t):"bytes"===e.type?Object(f.keccak256)(Object(c.hexlify)(t)):("bool"===e.type&&"boolean"===typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=s.a.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(c.hexZeroPad)(Object(c.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(Object(l.a)(u));else if("bytes"===e.type)n.push(Object(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);Object(c.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.g.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,Object(c.concat)(r)):null,s=this._abiCoder.decode(o,t,!0),l=[],f=0,d=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==u)l[t]=new O({_isIndexed:!0,hash:null});else if(a[t])l[t]=new O({_isIndexed:!0,hash:u[d++]});else try{l[t]=u[d++]}catch(n){l[t]=n}else try{l[t]=s[f++]}catch(n){l[t]=n}if(e.name&&null==l[e.name]){var r=l[t];r instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:function(){throw E("property ".concat(JSON.stringify(e.name)),r)}}):l[e.name]=r}}));for(var h=function(e){var t=l[e];t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:function(){throw E("index ".concat(e),t)}})},m=0;m=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;o=0&&e<=256&&!(e%1)?"1"+p.substring(0,e):c.throwArgumentError("invalid decimal size","decimals",e)}function m(e,t){null==t&&(t=0);var r=v(t),n=(e=s.a.from(e)).lt(f);n&&(e=e.mul(d));for(var i=e.mod(r).toString();i.length2&&c.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&&h("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length80&&c.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(l,r,n,i)}}]),e}(),y=function(){function e(t,r,i,o){Object(n.a)(this,e),t!==l&&c.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 Object(i.a)(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&c.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)&&c.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;var n=e.from("1"+p.substring(0,t),this.format),i=O.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&&c.throwArgumentError("invalid byte width","width",e);var t=s.a.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Object(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||Object(s.d)(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),e.fromString(m(t,r),b.from(n))}},{key:"fromString",value:function(t,r){null==r&&(r="fixed");var n=b.from(r),i=g(t,n.decimals);!n.signed&&i.lt(f)&&h("unsigned value cannot be negative","overflow","value",t);var a=null;n.signed?a=i.toTwos(n.width).toHexString():(a=i.toHexString(),a=Object(o.hexZeroPad)(a,n.width/8));var u=m(i,n.decimals);return new e(l,a,u,n)}},{key:"fromBytes",value:function(t,r){null==r&&(r="fixed");var n=b.from(r);if(Object(o.arrayify)(t).length>n.width/8)throw new Error("overflow");var i=s.a.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(l,a,u,n)}},{key:"from",value:function(t,r){if("string"===typeof t)return e.fromString(t,r);if(Object(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 c.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),w=y.from(1),O=y.from("0.5")},function(e,t,r){"use strict";r.d(t,"a",(function(){return I})),r.d(t,"b",(function(){return B}));var n=r(6),i=r(7),o=r(2),a=r(4),u=r(5),s=r(55),c=r(31),l=r(9),f=r(10),d=r(29),h=function(e){Object(l.a)(r,e);var t=Object(f.a)(r);function r(e){return Object(n.a)(this,r),t.call(this,"address","address",e,!1)}return Object(i.a)(r,[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=Object(d.getAddress)(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return Object(d.getAddress)(Object(o.hexZeroPad)(e.readValue().toHexString(),20))}}]),r}(c.a),p=function(e){Object(l.a)(r,e);var t=Object(f.a)(r);function r(e){var i;return Object(n.a)(this,r),(i=t.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,i}return Object(i.a)(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}(c.a),v=new u.Logger(s.a);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 c.c(e.wordSize),a=new c.c(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 l=e.appendWriter(o);return l+=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(e){var t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:function(){throw t}})},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 Object(i.a)(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)&&N.throwArgumentError("invalid "+r[1]+" bit length","param",e),new P(n/8,"int"===r[1],e.name)}if(r=e.type.match(_)){var i=parseInt(r[1]);return(0===i||i>32)&&N.throwArgumentError("invalid bytes length","param",e),new j(i,e.name)}return N.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new c.b(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new c.c(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(R.g.from(e))}));return new M(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&N.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(R.g.from(e))})),i=new M(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(R.g.from(e))}));return new M(i,"_").decode(this._getReader(Object(o.arrayify)(t),r))}}]),e}(),B=new I},function(e,t,r){"use strict";e.exports=r(155)},function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){for(o+=a,t=1;tr)throw Error(m+e)}function R(e,t,r,n){var i,o,a,u;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=O(10,7-t),u=e[i]%o|0,null==n?t<3?(0==t?u=u/100|0:1==t&&(u=u/10|0),a=r<4&&99999==u||r>3&&49999==u||5e4==u||0==u):a=(r<4&&u+1==o||r>3&&u+1==o/2)&&(e[i+1]/o/100|0)==O(10,t-2)-1||(u==o/2||0==u)&&0==(e[i+1]/o/100|0):t<4?(0==t?u=u/1e3|0:1==t?u=u/100|0:2==t&&(u=u/10|0),a=(n||r<4)&&9999==u||!n&&r>3&&4999==u):a=((n||r<4)&&u+1==o||!n&&r>3&&u+1==o/2)&&(e[i+1]/o/1e3|0)==O(10,t-3)-1,a}function N(e,t,r){for(var n,i,o=[0],a=0,u=e.length;ar-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}C.absoluteValue=C.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),L(e)},C.ceil=function(){return L(new this.constructor(this),this.e+1,2)},C.clampedTo=C.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(m+t);return r.cmp(e)<0?e:r.cmp(t)>0?t:new n(r)},C.comparedTo=C.cmp=function(e){var t,r,n,i,o=this,a=o.d,u=(e=new o.constructor(e)).d,s=o.s,c=e.s;if(!a||!u)return s&&c?s!==c?s:a===u?0:!a^s<0?1:-1:NaN;if(!a[0]||!u[0])return a[0]?s:u[0]?-c:0;if(s!==c)return s;if(o.e!==e.e)return o.e>e.e^s<0?1:-1;for(t=0,r=(n=a.length)<(i=u.length)?n:i;tu[t]^s<0?1:-1;return n===i?0:n>i^s<0?1:-1},C.cosine=C.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;(n=t.d.length)<32?i=(1/Y(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10");e.precision+=r,t=J(e,1,t.times(i),new e(1));for(var o=r;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=r,t}(n,X(n,r)),n.precision=e,n.rounding=t,L(2==u||3==u?r.neg():r,e,t,!0)):new n(1):new n(NaN)},C.cubeRoot=C.cbrt=function(){var e,t,r,n,i,o,a,u,s,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(p=!1,(o=l.s*O(l.s*l,1/3))&&Math.abs(o)!=1/0?n=new f(o.toString()):(r=T(l.d),(o=((e=l.e)-r.length+1)%3)&&(r+=1==o||-2==o?"0":"00"),o=O(r,1/3),e=w((e+1)/3)-(e%3==(e<0?-1:2)),(n=new f(r=o==1/0?"5e"+e:(r=o.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=l.s),a=(e=f.precision)+3;;)if(c=(s=(u=n).times(u).times(u)).plus(l),n=_(c.plus(l).times(u),c.plus(s),a+2,1),T(u.d).slice(0,a)===(r=T(n.d)).slice(0,a)){if("9999"!=(r=r.slice(a-3,a+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(L(n,e+1,1),t=!n.times(n).times(n).eq(l));break}if(!i&&(L(u,e+1,0),u.times(u).times(u).eq(l))){n=u;break}a+=4,i=1}return p=!0,L(n,e,f.rounding,t)},C.decimalPlaces=C.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=7*((e=t.length-1)-w(this.e/7)),e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},C.dividedBy=C.div=function(e){return _(this,new this.constructor(e))},C.dividedToIntegerBy=C.divToInt=function(e){var t=this.constructor;return L(_(this,new t(e),0,1,1),t.precision,t.rounding)},C.equals=C.eq=function(e){return 0===this.cmp(e)},C.floor=function(){return L(new this.constructor(this),this.e+1,3)},C.greaterThan=C.gt=function(e){return this.cmp(e)>0},C.greaterThanOrEqualTo=C.gte=function(e){var t=this.cmp(e);return 1==t||0===t},C.hyperbolicCosine=C.cosh=function(){var e,t,r,n,i,o=this,a=o.constructor,u=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return u;r=a.precision,n=a.rounding,a.precision=r+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/Y(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=J(a,1,o.times(t),new a(1),!0);for(var s,c=e,l=new a(8);c--;)s=o.times(o),o=u.minus(s.times(l.minus(s.times(l))));return L(o,a.precision=r,a.rounding=n,!0)},C.hyperbolicSine=C.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=J(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=J(o,2,i=i.times(1/Y(5,e)),i,!0);for(var a,u=new o(5),s=new o(16),c=new o(20);e--;)a=i.times(i),i=i.times(u.plus(a.times(s.times(a).plus(c))))}return o.precision=t,o.rounding=r,L(i,t,r,!0)},C.hyperbolicTangent=C.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,_(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},C.inverseCosine=C.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return-1!==n?0===n?t.isNeg()?F(r,i,o):new r(0):new r(NaN):t.isZero()?F(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=F(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))},C.inverseHyperbolicCosine=C.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,p=!1,r=r.times(r).minus(1).sqrt().plus(r),p=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},C.inverseHyperbolicSine=C.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,p=!1,r=r.times(r).plus(1).sqrt().plus(r),p=!0,n.precision=e,n.rounding=t,r.ln())},C.inverseHyperbolicTangent=C.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?L(new o(i),e,t,!0):(o.precision=r=n-i.e,i=_(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},C.inverseSine=C.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,-1!==t?0===t?((e=F(o,r+4,n).times(.5)).s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))},C.inverseTangent=C.atan=function(){var e,t,r,n,i,o,a,u,s,c=this,l=c.constructor,f=l.precision,d=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=P)return(a=F(l,f+4,d).times(.25)).s=c.s,a}else{if(!c.s)return new l(NaN);if(f+4<=P)return(a=F(l,f+4,d).times(.5)).s=c.s,a}for(l.precision=u=f+10,l.rounding=1,e=r=Math.min(28,u/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(p=!1,t=Math.ceil(u/7),n=1,s=c.times(c),a=new l(c),i=c;-1!==e;)if(i=i.times(s),o=a.minus(i.div(n+=2)),i=i.times(s),void 0!==(a=o.plus(i.div(n+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return r&&(a=a.times(2<this.d.length-2},C.isNaN=function(){return!this.s},C.isNegative=C.isNeg=function(){return this.s<0},C.isPositive=C.isPos=function(){return this.s>0},C.isZero=function(){return!!this.d&&0===this.d[0]},C.lessThan=C.lt=function(e){return this.cmp(e)<0},C.lessThanOrEqualTo=C.lte=function(e){return this.cmp(e)<1},C.logarithm=C.log=function(e){var t,r,n,i,o,a,u,s,c=this,l=c.constructor,f=l.precision,d=l.rounding;if(null==e)e=new l(10),t=!0;else{if(r=(e=new l(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new l(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=1!==i}if(p=!1,a=G(c,u=f+5),n=t?D(l,u+10):G(e,u),R((s=_(a,n,u,1)).d,i=f,d))do{if(a=G(c,u+=10),n=t?D(l,u+10):G(e,u),s=_(a,n,u,1),!o){+T(s.d).slice(i+1,i+15)+1==1e14&&(s=L(s,f+1,0));break}}while(R(s.d,i+=10,d));return p=!0,L(s,f,d)},C.minus=C.sub=function(e){var t,r,n,i,o,a,u,s,c,l,f,d,h=this,v=h.constructor;if(e=new v(e),!h.d||!e.d)return h.s&&e.s?h.d?e.s=-e.s:e=new v(e.d||h.s!==e.s?h:NaN):e=new v(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(c=h.d,d=e.d,u=v.precision,s=v.rounding,!c[0]||!d[0]){if(d[0])e.s=-e.s;else{if(!c[0])return new v(3===s?-0:0);e=new v(h)}return p?L(e,u,s):e}if(r=w(e.e/7),l=w(h.e/7),c=c.slice(),o=l-r){for((f=o<0)?(t=c,o=-o,a=d.length):(t=d,r=l,a=c.length),o>(n=Math.max(Math.ceil(u/7),a)+2)&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for((f=(n=c.length)<(a=d.length))&&(a=n),n=0;n0;--n)c[a++]=0;for(n=d.length;n>o;){if(c[--n](a=(o=Math.ceil(u/7))>a?o+1:a+1)&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((a=c.length)-(i=l.length)<0&&(i=a,r=l,l=c,c=r),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/S|0,c[i]%=S;for(t&&(c.unshift(t),++n),a=c.length;0==c[--a];)c.pop();return e.d=c,e.e=B(c,n),p?L(e,u,s):e},C.precision=C.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(m+e);return r.d?(t=U(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},C.round=function(){var e=this,t=e.constructor;return L(new t(e),e.e+1,t.rounding)},C.sine=C.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:J(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=t.times(1/Y(5,r)),t=J(e,2,t,t);for(var i,o=new e(5),a=new e(16),u=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(u))));return t}(n,X(n,r)),n.precision=e,n.rounding=t,L(u>2?r.neg():r,e,t,!0)):new n(NaN)},C.squareRoot=C.sqrt=function(){var e,t,r,n,i,o,a=this,u=a.d,s=a.e,c=a.s,l=a.constructor;if(1!==c||!u||!u[0])return new l(!c||c<0&&(!u||u[0])?NaN:u?a:1/0);for(p=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=T(u)).length+s)%2==0&&(t+="0"),c=Math.sqrt(t),s=w((s+1)/2)-(s<0||s%2),n=new l(t=c==1/0?"5e"+s:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new l(c.toString()),r=(s=l.precision)+3;;)if(n=(o=n).plus(_(a,o,r+2,1)).times(.5),T(o.d).slice(0,r)===(t=T(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(L(n,s+1,1),e=!n.times(n).eq(a));break}if(!i&&(L(o,s+1,0),o.times(o).eq(a))){n=o;break}r+=4,i=1}return p=!0,L(n,s,l.rounding,e)},C.tangent=C.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=_(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,L(2==u||4==u?r.neg():r,e,t,!0)):new n(NaN)},C.times=C.mul=function(e){var t,r,n,i,o,a,u,s,c,l=this,f=l.constructor,d=l.d,h=(e=new f(e)).d;if(e.s*=l.s,!d||!d[0]||!h||!h[0])return new f(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:d&&h?0*e.s:e.s/0);for(r=w(l.e/7)+w(e.e/7),(s=d.length)<(c=h.length)&&(o=d,d=h,h=o,a=s,s=c,c=a),o=[],n=a=s+c;n--;)o.push(0);for(n=c;--n>=0;){for(t=0,i=s+n;i>n;)u=o[i]+h[n]*d[i-n-1]+t,o[i--]=u%S|0,t=u/S|0;o[i]=(o[i]+t)%S|0}for(;!o[--a];)o.pop();return t?++r:o.shift(),e.d=o,e.e=B(o,r),p?L(e,f.precision,f.rounding):e},C.toBinary=function(e,t){return Z(this,2,e,t)},C.toDecimalPlaces=C.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(M(e,0,c),void 0===t?t=n.rounding:M(t,0,8),L(r,e+r.e+1,t))},C.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=I(n,!0):(M(e,0,c),void 0===t?t=i.rounding:M(t,0,8),r=I(n=L(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},C.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return void 0===e?r=I(i):(M(e,0,c),void 0===t?t=o.rounding:M(t,0,8),r=I(n=L(new o(i),e+i.e+1,t),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},C.toFraction=function(e){var t,r,n,i,o,a,u,s,c,l,f,d,h=this,v=h.d,g=h.constructor;if(!v)return new g(h);if(c=r=new g(1),n=s=new g(0),a=(o=(t=new g(n)).e=U(v)-h.e-1)%7,t.d[0]=O(10,a<0?7+a:a),null==e)e=o>0?t:c;else{if(!(u=new g(e)).isInt()||u.lt(c))throw Error(m+u);e=u.gt(t)?o>0?t:c:u}for(p=!1,u=new g(T(v)),l=g.precision,g.precision=o=7*v.length*2;f=_(u,t,0,1,1),1!=(i=r.plus(f.times(n))).cmp(e);)r=n,n=i,i=c,c=s.plus(f.times(i)),s=i,i=t,t=u.minus(f.times(i)),u=i;return i=_(e.minus(r),n,0,1,1),s=s.plus(i.times(c)),r=r.plus(i.times(n)),s.s=c.s=h.s,d=_(c,n,o,1).minus(h).abs().cmp(_(s,r,o,1).minus(h).abs())<1?[c,n]:[s,r],g.precision=l,p=!0,d},C.toHexadecimal=C.toHex=function(e,t){return Z(this,16,e,t)},C.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:M(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(p=!1,r=_(r,e,0,t,1).times(e),p=!0,L(r)):(e.s=r.s,r=e),r},C.toNumber=function(){return+this},C.toOctal=function(e,t){return Z(this,8,e,t)},C.toPower=C.pow=function(e){var t,r,n,i,o,a,u=this,s=u.constructor,c=+(e=new s(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new s(O(+u,c));if((u=new s(u)).eq(1))return u;if(n=s.precision,o=s.rounding,e.eq(1))return L(u,n,o);if((t=w(e.e/7))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=H(s,u,r,n),e.s<0?new s(1).div(i):L(i,n,o);if((a=u.s)<0){if(ts.maxE+1||t0?a/0:0):(p=!1,s.rounding=u.s=1,r=Math.min(12,(t+"").length),(i=W(e.times(G(u,n+r)),n)).d&&R((i=L(i,n+5,1)).d,n,o)&&(t=n+10,+T((i=L(W(e.times(G(u,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=L(i,n+1,0))),i.s=a,p=!0,s.rounding=o,L(i,n,o))},C.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=I(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(M(e,1,c),void 0===t?t=i.rounding:M(t,0,8),r=I(n=L(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},C.toSignificantDigits=C.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(M(e,1,c),void 0===t?t=r.rounding:M(t,0,8)),L(new r(this),e,t)},C.toString=function(){var e=this,t=e.constructor,r=I(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},C.truncated=C.trunc=function(){return L(new this.constructor(this),this.e+1,1)},C.valueOf=C.toJSON=function(){var e=this,t=e.constructor,r=I(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var _=function(){function e(e,t,r){var n,i=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+i,e[o]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;)e.shift()}return function(n,i,o,u,s,c){var l,f,d,h,p,v,m,g,b,y,O,k,E,j,x,A,P,C,T,M,R=n.constructor,N=n.s==i.s?1:-1,_=n.d,I=i.d;if(!_||!_[0]||!I||!I[0])return new R(n.s&&i.s&&(_?!I||_[0]!=I[0]:I)?_&&0==_[0]||!I?0*N:N/0:NaN);for(c?(p=1,f=n.e-i.e):(c=S,p=7,f=w(n.e/p)-w(i.e/p)),T=I.length,P=_.length,y=(b=new R(N)).d=[],d=0;I[d]==(_[d]||0);d++);if(I[d]>(_[d]||0)&&f--,null==o?(j=o=R.precision,u=R.rounding):j=s?o+(n.e-i.e)+1:o,j<0)y.push(1),v=!0;else{if(j=j/p+2|0,d=0,1==T){for(h=0,I=I[0],j++;(d1&&(I=e(I,h,c),_=e(_,h,c),T=I.length,P=_.length),A=T,k=(O=_.slice(0,T)).length;k=c/2&&++C;do{h=0,(l=t(I,O,T,k))<0?(E=O[0],T!=k&&(E=E*c+(O[1]||0)),(h=E/C|0)>1?(h>=c&&(h=c-1),1==(l=t(m=e(I,h,c),O,g=m.length,k=O.length))&&(h--,r(m,T=10;h/=10)d++;b.e=d+f*p-1,L(b,s?o+b.e+1:o,u,v)}return b}}();function L(e,t,r,n){var i,o,a,u,s,c,l,f,d,h=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(i=1,u=f[0];u>=10;u/=10)i++;if((o=t-i)<0)o+=7,a=t,s=(l=f[d=0])/O(10,i-a-1)%10|0;else if((d=Math.ceil((o+1)/7))>=(u=f.length)){if(!n)break e;for(;u++<=d;)f.push(0);l=s=0,i=1,a=(o%=7)-7+1}else{for(l=u=f[d],i=1;u>=10;u/=10)i++;s=(a=(o%=7)-7+i)<0?0:l/O(10,i-a-1)%10|0}if(n=n||t<0||void 0!==f[d+1]||(a<0?l:l%O(10,i-a-1)),c=r<4?(s||n)&&(0==r||r==(e.s<0?3:2)):s>5||5==s&&(4==r||n||6==r&&(o>0?a>0?l/O(10,i-a):0:f[d-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=O(10,(7-t%7)%7),e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=d,u=1,d--):(f.length=d+1,u=O(10,7-o),f[d]=a>0?(l/O(10,i-a)%O(10,a)|0)*u:0),c)for(;;){if(0==d){for(o=1,a=f[0];a>=10;a/=10)o++;for(a=f[0]+=u,u=1;a>=10;a/=10)u++;o!=u&&(e.e++,f[0]==S&&(f[0]=1));break}if(f[d]+=u,f[d]!=S)break;f[d--]=0,u=1}for(o=f.length;0===f[--o];)f.pop()}return p&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+$(n):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+$(-i-1)+o,r&&(n=r-a)>0&&(o+=$(n))):i>=a?(o+=$(i+1-a),r&&(n=r-i-1)>0&&(o=o+"."+$(n))):((n=i+1)0&&(i+1===a&&(o+="."),o+=$(n))),o}function B(e,t){var r=e[0];for(t*=7;r>=10;r/=10)t++;return t}function D(e,t,r){if(t>A)throw p=!0,r&&(e.precision=r),Error(g);return L(new e(f),t,1,!0)}function F(e,t,r){if(t>P)throw Error(g);return L(new e(d),t,r,!0)}function U(e){var t=e.length-1,r=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function $(e){for(var t="";e--;)t+="0";return t}function H(e,t,r,n){var i,o=new e(1),a=Math.ceil(n/7+4);for(p=!1;;){if(r%2&&ee((o=o.times(t)).d,a)&&(i=!0),0===(r=w(r/2))){r=o.d.length-1,i&&0===o.d[r]&&++o.d[r];break}ee((t=t.times(t)).d,a)}return p=!0,o}function z(e){return 1&e.d[e.d.length-1]}function K(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(p=!1,s=v):s=t,u=new d(.03125);e.e>-2;)e=e.times(u),f+=5;for(s+=n=Math.log(O(2,f))/Math.LN10*2+5|0,r=o=a=new d(1),d.precision=s;;){if(o=L(o.times(e),s,1),r=r.times(++l),T((u=a.plus(_(o,r,s,1))).d).slice(0,s)===T(a.d).slice(0,s)){for(i=f;i--;)a=L(a.times(a),s,1);if(null!=t)return d.precision=v,a;if(!(c<3&&R(a.d,s-n,h,c)))return L(a,d.precision=v,h,p=!0);d.precision=s+=10,r=o=u=new d(1),l=0,c++}a=u}}function G(e,t){var r,n,i,o,a,u,s,c,l,f,d,h=1,v=e,m=v.d,g=v.constructor,b=g.rounding,y=g.precision;if(v.s<0||!m||!m[0]||!v.e&&1==m[0]&&1==m.length)return new g(m&&!m[0]?-1/0:1!=v.s?NaN:m?0:v);if(null==t?(p=!1,l=y):l=t,g.precision=l+=10,n=(r=T(m)).charAt(0),!(Math.abs(o=v.e)<15e14))return c=D(g,l+2,y).times(o+""),v=G(new g(n+"."+r.slice(1)),l-10).plus(c),g.precision=y,null==t?L(v,y,b,p=!0):v;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=T((v=v.times(e)).d)).charAt(0),h++;for(o=v.e,n>1?(v=new g("0."+r),o++):v=new g(n+"."+r.slice(1)),f=v,s=a=v=_(v.minus(1),v.plus(1),l,1),d=L(v.times(v),l,1),i=3;;){if(a=L(a.times(d),l,1),T((c=s.plus(_(a,new g(i),l,1))).d).slice(0,l)===T(s.d).slice(0,l)){if(s=s.times(2),0!==o&&(s=s.plus(D(g,l+2,y).times(o+""))),s=_(s,new g(h),l,1),null!=t)return g.precision=y,s;if(!R(s.d,l-10,b,u))return L(s,g.precision=y,b,p=!0);g.precision=l+=10,c=a=v=_(f.minus(1),f.plus(1),l,1),d=L(v.times(v),l,1),i=u=1}s=c,i+=2}}function q(e){return String(e.s*e.s/0)}function V(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%7,r<0&&(n+=7),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),x.test(t))return V(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(E.test(t))r=16,t=t.toLowerCase();else if(k.test(t))r=2;else{if(!j.test(t))throw Error(m+t);r=8}for((a=t.search(/p/i))>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),u=(a=t.indexOf("."))>=0,n=e.constructor,u&&(a=(s=(t=t.replace(".","")).length)-a,i=H(n,new n(r),a,2*a)),a=f=(l=N(t,r,S)).length-1;0===l[a];--a)l.pop();return a<0?new n(0*e.s):(e.e=B(l,f),e.d=l,p=!1,u&&(e=_(e,i,4*s)),c&&(e=e.times(Math.abs(c)<54?O(2,c):o.pow(2,c))),p=!0,e)}function J(e,t,r,n,i){var o,a,u,s,c=e.precision,l=Math.ceil(c/7);for(p=!1,s=r.times(r),u=new e(n);;){if(a=_(u.times(s),new e(t++*t++),c,1),u=i?n.plus(a):n.minus(a),n=_(a.times(s),new e(t++*t++),c,1),void 0!==(a=u.plus(n)).d[l]){for(o=l;a.d[o]===u.d[o]&&o--;);if(-1==o)break}o=u,u=n,n=a,a=o}return p=!0,a.d.length=l+1,a}function Y(e,t){for(var r=e;--t;)r*=e;return r}function X(e,t){var r,n=t.s<0,i=F(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return u=n?4:1,t;if((r=t.divToInt(i)).isZero())u=n?3:2;else{if((t=t.minus(r.times(i))).lte(o))return u=z(r)?n?2:3:n?4:1,t;u=z(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Z(e,t,r,n){var i,o,u,s,f,d,h,p,v,m=e.constructor,g=void 0!==r;if(g?(M(r,1,c),void 0===n?n=m.rounding:M(n,0,8)):(r=m.precision,n=m.rounding),e.isFinite()){for(g?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,(u=(h=I(e)).indexOf("."))>=0&&(h=h.replace(".",""),(v=new m(1)).e=h.length-u,v.d=N(I(v),10,i),v.e=v.d.length),o=f=(p=N(h,10,i)).length;0==p[--f];)p.pop();if(p[0]){if(u<0?o--:((e=new m(e)).d=p,e.e=o,p=(e=_(e,v,r,n,0,i)).d,o=e.e,d=a),u=p[r],s=i/2,d=d||void 0!==p[r+1],d=n<4?(void 0!==u||d)&&(0===n||n===(e.s<0?3:2)):u>s||u===s&&(4===n||d||6===n&&1&p[r-1]||n===(e.s<0?8:7)),p.length=r,d)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(f=p.length;!p[f-1];--f);for(u=0,h="";u1)if(16==t||8==t){for(u=16==t?4:3,--f;f%u;f++)h+="0";for(f=(p=N(h,i,t)).length;!p[f-1];--f);for(u=1,h="1.";uf)for(o-=f;o--;)h+="0";else ot)return e.length=t,!0}function te(e){return new this(e).abs()}function re(e){return new this(e).acos()}function ne(e){return new this(e).acosh()}function ie(e,t){return new this(e).plus(t)}function oe(e){return new this(e).asin()}function ae(e){return new this(e).asinh()}function ue(e){return new this(e).atan()}function se(e){return new this(e).atanh()}function ce(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?F(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=F(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,r=this.atan(_(e,t,o,1)),t=F(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(_(e,t,o,1)):(r=F(this,o,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function le(e){return new this(e).cbrt()}function fe(e){return L(e=new this(e),e.e+1,2)}function de(e,t,r){return new this(e).clamp(t,r)}function he(e){if(!e||"object"!==typeof e)throw Error(v+"Object expected");var t,r,n,i=!0===e.defaults,o=["precision",1,c,"rounding",0,8,"toExpNeg",-s,0,"toExpPos",0,s,"maxE",0,s,"minE",-s,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2]))throw Error(m+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=h[r]),void 0!==(n=e[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(m+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(b);this[r]=!0}else this[r]=!1}return this}function pe(e){return new this(e).cos()}function ve(e){return new this(e).cosh()}function me(e,t){return new this(e).div(t)}function ge(e){return new this(e).exp()}function be(e){return L(e=new this(e),e.e+1,3)}function ye(){var e,t,r=new this(0);for(p=!1,e=0;e=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(b);for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(u.push(i%1e7),o+=4);o=n/4}else for(;o=10;i/=10)n++;n<7&&(r-=7-n)}return a.e=r,a.d=u,a}function Me(e){return L(e=new this(e),e.e+1,this.rounding)}function Re(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ne(e){return new this(e).sin()}function _e(e){return new this(e).sinh()}function Le(e){return new this(e).sqrt()}function Ie(e,t){return new this(e).sub(t)}function Be(){var e=0,t=arguments,r=new this(t[e]);for(p=!1;r.s&&++eo.maxE?(i.e=NaN,i.d=null):e.e=10;r/=10)t++;return void(p?t>o.maxE?(i.e=NaN,i.d=null):t1&&void 0!==arguments[1]?arguments[1]:0;return function(){for(var n=arguments.length,i=new Array(n),o=0;o=0||(i[r]=e[r]);return i}(s,o);try{a=null!=c&&c&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(g){}if(!a)return e(r,n,i);var d=a.connect(f),h=!0;i.setState=function(e,t,i){var o=r(e,t);return h?(d.send(void 0===i?{type:l||"anonymous"}:"string"===typeof i?{type:i}:i,n()),o):o};var p=function(){var e=h;h=!1,r.apply(void 0,arguments),h=e},v=e(i.setState,n,i);if(d.init(v),i.dispatchFromDevtools&&"function"===typeof i.dispatch){var m=i.dispatch;i.dispatch=function(){for(var e=arguments.length,t=new Array(e),r=0;r2?i-2:0),a=2;a|~]/.test(r)&&/&.*&/.test(e)?":is(".concat(r,")"):r):r+" "+e})))),e}),[]):t},P=function(e,t){return e in C&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(function(t,r,n,i){return r+("stretch"===n?"-moz-available".concat(i,";").concat(k(e),":").concat(r,"-webkit-fill-available"):"-moz-fit-content".concat(i,";").concat(k(e),":").concat(r,"fit-content"))+i})):String(t)},C={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},T=function(e){return e?e+"-":""},M=function(e,t,r){return e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(function(e,n,i,o,a){return"$"==o==!!i?e:(n||"--"==o?"calc(":"")+"var(--"+("$"===o?T(t)+(a.includes("$")?"":T(r))+a.replace(/\$/g,"-"):a)+")"+(n||"--"==o?"*"+(n||"")+(i||"1")+")":"")}))},R=/\s*,\s*(?![^()]*\))/,N=Object.prototype.toString,_=function(e,t,r,n,i){var o,a,u;!function e(t,r,f){var d,h;(function t(p){for(d in p){var v,m=64===d.charCodeAt(0),g=m&&Array.isArray(p[d])?p[d]:[p[d]],b=Object(c.a)(g);try{for(b.s();!(v=b.n()).done;){h=v.value;var y=/[A-Z]/.test(B=d)?B:B.replace(/-[^]/g,(function(e){return e[1].toUpperCase()})),w="object"==typeof h&&h&&h.toString===N&&(!n.utils[y]||!r.length);if(y in n.utils&&!w){var O=n.utils[y];if(O!==a){a=O,t(O(h)),a=null;continue}}else if(y in x){var E=x[y];if(E!==u){u=E,t(E(h)),u=null;continue}}if(m&&(_=d.slice(1)in n.media?"@media "+n.media[d.slice(1)]:d,d=_.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(function(e,t,r,n,i,o){var a=S.test(t),u=.0625*(a?-1:1),c=a?[n,t]:[t,n],l=Object(s.a)(c,2),f=l[0],d=l[1];return"("+("="===r[0]?"":">"===r[0]===a?"max-":"min-")+f+":"+("="!==r[0]&&1===r.length?d.replace(S,(function(e,t,n){return Number(t)+u*(">"===r?1:-1)+n})):d)+(i?") and ("+(">"===i[0]?"min-":"max-")+f+":"+(1===i.length?o.replace(S,(function(e,t,r){return Number(t)+u*(">"===i?-1:1)+r})):o):"")+")"}))),w){var j=m?f.concat(d):Object(l.a)(f),C=m?Object(l.a)(r):A(r,d.split(R));void 0!==o&&i(L.apply(void 0,Object(l.a)(o))),o=void 0,e(h,C,j)}else void 0===o&&(o=[[],r,f]),d=m||36!==d.charCodeAt(0)?d:"--".concat(T(n.prefix)).concat(d.slice(1).replace(/\$/g,"-")),h=w?h:"number"==typeof h?h&&y in I?String(h)+"px":String(h):M(P(y,null==h?"":h),n.prefix,n.themeMap[y]),o[0].push("".concat(m?"".concat(d," "):"".concat(k(d),":")).concat(h))}}catch(D){b.e(D)}finally{b.f()}}var _,B})(t),void 0!==o&&i(L.apply(void 0,Object(l.a)(o))),o=void 0}(e,t,r)},L=function(e,t,r){return"".concat(r.map((function(e){return"".concat(e,"{")})).join("")).concat(t.length?"".concat(t.join(","),"{"):"").concat(e.join(";")).concat(t.length?"}":"").concat(Array(r.length?r.length+1:0).join("}"))},I={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},B=function(e){return String.fromCharCode(e+(e>25?39:97))},D=function(e){return function(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=B(t%52)+r;return B(t%52)+r}(function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e}(5381,JSON.stringify(e))>>>0)},F=["themed","global","styled","onevar","resonevar","allvar","inline"],U=function(e){if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch(e){return!1}},$=function(e){var t=e.group,r=t.cssRules.length;e.apply=function(e){try{t.insertRule(e,r),++r}catch(e){}}},H=Symbol(),z=g(),K=function(e,t){return z(e,(function(){return function(){for(var r={type:null,composers:new Set},n=arguments.length,i=new Array(n),o=0;o1?":where(.".concat(h.slice(1).join("."),")"):""),O=function(n){var i=n="object"==typeof n&&n||Q,a=i.css,f=Object(u.a)(i,["css"]),b={};for(var y in p)if(delete f[y],y in n){var O=n[y];"object"==typeof O&&O?b[y]=Object(o.a)({"@initial":p[y]},O):(O=String(O),b[y]="undefined"!==O||v.has(y)?O:p[y])}else b[y]=p[y];var k,E=new Set(Object(l.a)(h)),j=Object(c.a)(t.composers);try{for(j.s();!(k=j.n()).done;){var x=Object(s.a)(k.value,4),S=x[0],A=x[1],P=x[2],C=x[3];r.rules.styled.cache.has(S)||(r.rules.styled.cache.add(S),_(A,[".".concat(S)],[],e,(function(e){g.styled.apply(e)})));var T,M=V(P,b,e.media),R=V(C,b,e.media,!0),N=Object(c.a)(M);try{for(N.s();!(T=N.n()).done;){var L=T.value;if(void 0!==L){var I,B=Object(c.a)(L);try{var F=function(){var t=Object(s.a)(I.value,3),n=t[0],i=t[1],o=t[2],a="".concat(S,"-").concat(D(i),"-").concat(n);E.add(a);var u=(o?r.rules.resonevar:r.rules.onevar).cache,c=o?g.resonevar:g.onevar;u.has(a)||(u.add(a),_(i,[".".concat(a)],[],e,(function(e){c.apply(e)})))};for(B.s();!(I=B.n()).done;)F()}catch(re){B.e(re)}finally{B.f()}}}}catch(re){N.e(re)}finally{N.f()}var U,$=Object(c.a)(R);try{for($.s();!(U=$.n()).done;){var H=U.value;if(void 0!==H){var z,K=Object(c.a)(H);try{for(K.s();!(z=K.n()).done;){var W=Object(s.a)(z.value,2),G=W[0],q=W[1],J="".concat(S,"-").concat(D(q),"-").concat(G);E.add(J),r.rules.allvar.cache.has(J)||(r.rules.allvar.cache.add(J),_(q,[".".concat(J)],[],e,(function(e){g.allvar.apply(e)})))}}catch(re){K.e(re)}finally{K.f()}}}}catch(re){$.e(re)}finally{$.f()}}}catch(re){j.e(re)}finally{j.f()}if("object"==typeof a&&a){var Y="".concat(d,"-i").concat(D(a),"-css");E.add(Y),r.rules.inline.cache.has(Y)||(r.rules.inline.cache.add(Y),_(a,[".".concat(Y)],[],e,(function(e){g.inline.apply(e)})))}var X,Z=Object(c.a)(String(n.className||"").trim().split(/\s+/));try{for(Z.s();!(X=Z.n()).done;){var ee=X.value;ee&&E.add(ee)}}catch(re){Z.e(re)}finally{Z.f()}var te=f.className=Object(l.a)(E).join(" ");return{type:t.type,className:te,selector:w,props:f,toString:function(){return te},deferredInjector:m}};return y(O,(n={className:d,selector:w},Object(a.a)(n,b,t),Object(a.a)(n,"toString",(function(){return r.rules.styled.cache.has(d)||O(),d})),n))},q=function(e){var t,r="",n=[],i={},o=[],a=Object(c.a)(e);try{for(a.s();!(t=a.n()).done;){var u=Object(s.a)(t.value,6),f=u[0],d=u[4],h=u[5];for(var p in""===r&&(r=f),n.push(f),o.push.apply(o,Object(l.a)(h)),d){var v=d[p];(void 0===i[p]||"undefined"!==v||h.includes(v))&&(i[p]=v)}}}catch(m){a.e(m)}finally{a.f()}return[r,n,i,new Set(o)]},V=function(e,t,r,n){var i,o=[],u=Object(c.a)(e);try{e:for(u.s();!(i=u.n()).done;){var l=Object(s.a)(i.value,3),f=l[0],d=l[1];if(!l[2]){var h=void 0,p=0,v=!1;for(h in f){var m=f[h],g=t[h];if(g!==m){if("object"!=typeof g||!g)continue e;var b=void 0,y=void 0,w=0;for(var O in g){if(m===String(g[O])){if("@initial"!==O){var k=O.slice(1);(y=y||[]).push(k in r?r[k]:O.replace(/^@media ?/,"")),v=!0}p+=w,b=!0}++w}if(y&&y.length&&(d=Object(a.a)({},"@media "+y.join(", "),d)),!b)continue e}}(o[p]=o[p]||[]).push([n?"cv":"".concat(h,"-").concat(f[h]),d,v])}}}catch(E){u.e(E)}finally{u.f()}return o},Q={},J=g(),Y=function(e,t){return J(e,(function(){return function(){for(var r=arguments.length,n=new Array(r),i=0;i=0;--E){var j=F[E];if(!k[j]){var x=F[E+1],S=k[x]?k[x].index:O.cssRules.length;O.insertRule("@media{}",S),O.insertRule("--sxs{--sxs:".concat(E,"}"),S),k[j]={group:O.cssRules[S+1],index:S,cache:new Set([E])}}$(k[j])}}(),t}(i),f={css:K(u,s),globalCss:Y(u,s),keyframes:Z(u,s),createTheme:re(u,s),reset:function(){s.reset(),f.theme.toString()},theme:{},sheet:s,config:u,prefix:r,getCssText:s.toString,toString:s.toString};return String(f.theme=f.createTheme(a)),f}));return t||r.reset(),r}(e);return t.styled=function(e){var t=e.config,r=e.sheet;return ie(t,(function(){var e=K(t,r);return function(){var t=e.apply(void 0,arguments),r=t[b].type,n=f.forwardRef((function(e,n){var i=e&&e.as||r,o=t(e),a=o.props,u=o.deferredInjector;return delete a.as,a.ref=n,u?f.createElement(f.Fragment,null,f.createElement(i,a),f.createElement(u,null)):f.createElement(i,a)}));return n.className=t.className,n.displayName="Styled.".concat(r.displayName||r.name||r),n.selector=t.selector,n.toString=function(){return t.selector},n[b]=t[b],n}}))}(t),t}},function(e,t,r){"use strict";r.r(t),r.d(t,"decryptCrowdsale",(function(){return w})),r.d(t,"decryptKeystore",(function(){return j.a})),r.d(t,"decryptKeystoreSync",(function(){return j.b})),r.d(t,"encryptKeystore",(function(){return j.c})),r.d(t,"isCrowdsaleWallet",(function(){return O})),r.d(t,"isKeystoreWallet",(function(){return k})),r.d(t,"getJsonWalletAddress",(function(){return E})),r.d(t,"decryptJsonWallet",(function(){return x})),r.d(t,"decryptJsonWalletSync",(function(){return S}));var n=r(6),i=r(7),o=r(9),a=r(10),u=r(50),s=r.n(u),c=r(29),l=r(2),f=r(26),d=r(161),h=r(34),p=r(4),v=r(5),m=r(101),g=r(27),b=new v.Logger(m.a),y=function(e){Object(o.a)(r,e);var t=Object(a.a)(r);function r(){return Object(n.a)(this,r),t.apply(this,arguments)}return Object(i.a)(r,[{key:"isCrowdsaleAccount",value:function(e){return!(!e||!e._isCrowdsaleAccount)}}]),r}(p.Description);function w(e,t){var r=JSON.parse(e);t=Object(g.a)(t);var n=Object(c.getAddress)(Object(g.c)(r,"ethaddr")),i=Object(g.b)(Object(g.c)(r,"encseed"));i&&i.length%16===0||b.throwArgumentError("invalid encseed","json",e);for(var o=Object(l.arrayify)(Object(d.a)(t,t,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),u=i.slice(16),p=new s.a.ModeOfOperation.cbc(o,a),v=s.a.padding.pkcs7.strip(Object(l.arrayify)(p.decrypt(u))),m="",w=0;w=64;){var h=r,p=n,v=i,m=o,g=a,b=u,y=s,w=c,O=void 0,k=void 0,E=void 0,j=void 0,x=void 0;for(k=0;k<16;k++)E=f+4*k,l[k]=(255&e[E])<<24|(255&e[E+1])<<16|(255&e[E+2])<<8|255&e[E+3];for(k=16;k<64;k++)j=((O=l[k-2])>>>17|O<<15)^(O>>>19|O<<13)^O>>>10,x=((O=l[k-15])>>>7|O<<25)^(O>>>18|O<<14)^O>>>3,l[k]=(j+l[k-7]|0)+(x+l[k-16]|0)|0;for(k=0;k<64;k++)j=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&b^~g&y)|0)+(w+(t[k]+l[k]|0)|0)|0,x=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&p^h&v^p&v)|0,w=y,y=b,b=g,g=m+j|0,m=v,v=p,p=h,h=j+x|0;r=r+h|0,n=n+p|0,i=i+v|0,o=o+m|0,a=a+g|0,u=u+b|0,s=s+y|0,c=c+w|0,f+=64,d-=64}}f(e);var d,h=e.length%64,p=e.length/536870912|0,v=e.length<<3,m=h<56?56:120,g=e.slice(e.length-h,e.length);for(g.push(128),d=h+1;d>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),g.push(v>>>24&255),g.push(v>>>16&255),g.push(v>>>8&255),g.push(v>>>0&255),f(g),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function o(e,t,r){e=e.length<=64?e:i(e);var n,o=64+t.length+4,a=new Array(o),u=new Array(64),s=[];for(n=0;n<64;n++)a[n]=54;for(n=0;n=o-4;e--){if(a[e]++,a[e]<=255)return;a[e]=0}}for(;r>=32;)c(),s=s.concat(i(u.concat(i(a)))),r-=32;return r>0&&(c(),s=s.concat(i(u.concat(i(a))).slice(0,r))),s}function a(e,t,r,n,i){var o;for(l(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),s(i,n),l(i,0,e,t+16*o,16);for(o=0;o>>32-t}function s(e,t){l(e,0,t,0,16);for(var r=8;r>0;r-=2)t[4]^=u(t[0]+t[12],7),t[8]^=u(t[4]+t[0],9),t[12]^=u(t[8]+t[4],13),t[0]^=u(t[12]+t[8],18),t[9]^=u(t[5]+t[1],7),t[13]^=u(t[9]+t[5],9),t[1]^=u(t[13]+t[9],13),t[5]^=u(t[1]+t[13],18),t[14]^=u(t[10]+t[6],7),t[2]^=u(t[14]+t[10],9),t[6]^=u(t[2]+t[14],13),t[10]^=u(t[6]+t[2],18),t[3]^=u(t[15]+t[11],7),t[7]^=u(t[3]+t[15],9),t[11]^=u(t[7]+t[3],13),t[15]^=u(t[11]+t[7],18),t[1]^=u(t[0]+t[3],7),t[2]^=u(t[1]+t[0],9),t[3]^=u(t[2]+t[1],13),t[0]^=u(t[3]+t[2],18),t[6]^=u(t[5]+t[4],7),t[7]^=u(t[6]+t[5],9),t[4]^=u(t[7]+t[6],13),t[5]^=u(t[4]+t[7],18),t[11]^=u(t[10]+t[9],7),t[8]^=u(t[11]+t[10],9),t[9]^=u(t[8]+t[11],13),t[10]^=u(t[9]+t[8],18),t[12]^=u(t[15]+t[14],7),t[13]^=u(t[12]+t[15],9),t[14]^=u(t[13]+t[12],13),t[15]^=u(t[14]+t[13],18);for(var n=0;n<16;++n)e[n]+=t[n]}function c(e,t,r,n){for(var i=0;i=256)return!1}return!0}function d(e,t){if("number"!==typeof e||e%1)throw new Error("invalid "+t);return e}function h(e,r,i,u,s,h,p){if(i=d(i,"N"),u=d(u,"r"),s=d(s,"p"),h=d(h,"dkLen"),0===i||0!==(i&i-1))throw new Error("N must be power of 2");if(i>n/128/u)throw new Error("N too large");if(u>n/128/s)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!f(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);for(var v=o(e,r,128*s*u),m=new Uint32Array(32*s*u),g=0;gR&&(r=R);for(var n=0;nR&&(r=R);for(var d=0;d>0&255),v.push(m[_]>>8&255),v.push(m[_]>>16&255),v.push(m[_]>>24&255);var L=o(e,v,h);return p&&p(null,1,L),L}p&&N(t)};if(!p)for(;;){var L=_();if(void 0!=L)return L}_()}var p={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(u,s){var c=0;a&&a(0),h(e,t,r,n,i,o,(function(e,t,r){if(e)s(e);else if(r)a&&1!==c&&a(1),u(new Uint8Array(r));else if(a&&t!==c)return c=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(h(e,t,r,n,i,o))}};e.exports=p}()}).call(this,r(152).setImmediate)},function(e,t,r){"use strict";e.exports=r(156)},,,function(e,t,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var r,u,s=a(e),c=1;c>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 s(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=u(t)^n>>5}for(t=u(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var a=e.slice(0,o),c=e.slice(o+1);if(c.length<6)return"Data too short";var l=s(a);if("string"===typeof l)return l;for(var f=[],d=0;d=c.length||f.push(p)}return 1!==l?"Invalid checksum for "+e:{prefix:a,words:f}}function l(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<r)throw new TypeError("Exceeds length limit");var i=s(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var o=e+"1",a=0;a>5!==0)throw new Error("Non 5-bit word");i=u(i)^c,o+=n.charAt(c)}for(a=0;a<6;++a)i=u(i);for(i^=1,a=0;a<6;++a){o+=n.charAt(i>>5*(5-a)&31)}return o},toWordsUnsafe:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n.b})),r.d(t,"b",(function(){return n.c}));var n=r(30)},,function(e,t,r){"use strict";r.r(t);var n=r(36);r.d(t,"ConstructorFragment",(function(){return n.a})),r.d(t,"ErrorFragment",(function(){return n.b})),r.d(t,"EventFragment",(function(){return n.c})),r.d(t,"Fragment",(function(){return n.e})),r.d(t,"FunctionFragment",(function(){return n.f})),r.d(t,"ParamType",(function(){return n.g})),r.d(t,"FormatTypes",(function(){return n.d}));var i=r(84);r.d(t,"AbiCoder",(function(){return i.a})),r.d(t,"defaultAbiCoder",(function(){return i.b}));var o=r(80);r.d(t,"Interface",(function(){return o.b})),r.d(t,"Indexed",(function(){return o.a}));var a=r(31);r.d(t,"checkResultErrors",(function(){return a.d})),r.d(t,"LogDescription",(function(){return o.c})),r.d(t,"TransactionDescription",(function(){return o.d}))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"===typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"===typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,c=[],l=!1,f=-1;function d(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=u(d);l=!0;for(var t=c.length;t;){for(s=c,c=[];++f1)for(var r=1;r256||t[2]&&t[2]!==String(n))&&m.throwArgumentError("invalid numeric width","type",e);var i=O.mask(r?n-1:n),o=r?i.add(w).mul(b):y;return function(t){var r=s.a.from(t);return(r.lt(o)||r.gt(i))&&m.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(c.hexZeroPad)(r.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var f=parseInt(a[1]);return(0===f||f>32||a[1]!==String(f))&&m.throwArgumentError("invalid bytes width","type",e),function(t){return Object(c.arrayify)(t).length!==f&&m.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(c.arrayify)(e),r=t.length%32;return r?Object(c.hexConcat)([t,g.slice(r)]):Object(c.hexlify)(t)}(t)}}switch(e){case"address":return function(e){return Object(c.hexZeroPad)(Object(u.getAddress)(e),32)};case"bool":return function(e){return e?k:E};case"bytes":return function(e){return Object(l.keccak256)(e)};case"string":return function(e){return Object(p.a)(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 T=function(){function e(t){Object(o.a)(this,e),Object(f.defineReadOnly)(this,"types",Object.freeze(Object(f.deepCopy)(t))),Object(f.defineReadOnly)(this,"_encoderCache",{}),Object(f.defineReadOnly)(this,"_types",{});var r={},n={},i={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],i[e]={}}));var a=function(e){var i={};t[e].forEach((function(o){i[o.name]&&m.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&&m.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),P(a)||(n[a]||m.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 c in 0===s.length?m.throwArgumentError("missing primary type","types",t):s.length>1&&m.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),Object(f.defineReadOnly)(this,"primaryType",s[0]),function e(o,a){a[o]&&m.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(r[o]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var l=Object.keys(i[c]);l.sort(),this._types[c]=C(c,t[c])+l.map((function(e){return C(e,t[e])})).join("")}}return Object(a.a)(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=P(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&&m.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(o);return t._types[i]&&(r=r.map(l.keccak256)),Object(l.keccak256)(Object(c.hexConcat)(r))}}var u=this.types[e];if(u){var s=Object(p.a)(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]?Object(l.keccak256)(o):o}));return r.unshift(s),Object(c.hexConcat)(r)}}return m.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||m.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 Object(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(P(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&&m.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}),{}):m.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=j[n];i||m.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 x.indexOf(e.name)-x.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return Object(c.hexConcat)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return Object(l.keccak256)(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,n,o){return v(this,void 0,void 0,i.a.mark((function a(){var u,s,l;return i.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:t=Object(f.shallowCopy)(t),u={},t.verifyingContract&&!Object(c.isHexString)(t.verifyingContract,20)&&(u[t.verifyingContract]="0x"),(s=e.from(r)).visit(n,(function(e,t){return"address"!==e||Object(c.isHexString)(t,20)||(u[t]="0x"),t})),a.t0=i.a.keys(u);case 6:if((a.t1=a.t0()).done){a.next=13;break}return l=a.t1.value,a.next=10,o(l);case 10:u[l]=a.sent,a.next=6;break;case 13:return t.verifyingContract&&u[t.verifyingContract]&&(t.verifyingContract=u[t.verifyingContract]),n=s.visit(n,(function(e,t){return"address"===e&&u[t]?u[t]:t})),a.abrupt("return",{domain:t,value:n});case 16:case"end":return a.stop()}}),a)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var i={},o=[];x.forEach((function(e){var r=t[e];null!=r&&(i[e]=A[e](r),o.push({name:e,type:j[e]}))}));var a=e.from(r),u=Object(f.shallowCopy)(r);return u.EIP712Domain?m.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):u.EIP712Domain=o,a.encode(n),{types:u,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(c.hexlify)(Object(c.arrayify)(t));if(e.match(/^u?int/))return s.a.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&m.throwArgumentError("invalid string","value",t),t}return m.throwArgumentError("unsupported type","type",e)}))}}}]),e}()},function(e,t,r){"use strict";var n=r(54).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(54),i=r(82),o=r(122),a=r(81),u=n.sum32,s=n.sum32_4,c=n.sum32_5,l=o.ch32,f=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,v=o.g1_256,m=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(b,m),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="0x0000000000000000000000000000000000000000000000000000000000000000"},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="0x0000000000000000000000000000000000000000"},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(6),i=r(7),o=r(9),a=r(10),u=r(64),s=null;function c(e){if(null==s&&(s="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==u.a.check(e)))throw s=null,new Error("BIP39 Wordlist for en (English) FAILED")}var l=new(function(e){Object(o.a)(r,e);var t=Object(a.a)(r);function r(){return Object(n.a)(this,r),t.call(this,"en")}return Object(i.a)(r,[{key:"getWord",value:function(e){return c(this),s[e]}},{key:"getWordIndex",value:function(e){return c(this),s.indexOf(e)}}]),r}(u.a));u.a.register(l);var f={en:l}},function(e,t,r){"use strict";var n=r(14);r.d(t,"a",(function(){return n.b}))},function(e,t,r){(function(e){!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(142).Buffer}catch(P){}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 c(e,t,r,i){for(var o=0,a=0,u=Math.min(e.length,r),s=t;s=49?c-49+10:c>=17?c-17+10:c,n(c>=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,l=r;l1&&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(P){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],h=[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?d[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 c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?v+r:d[c-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 c=1;c>>26,f=67108863&s,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,s=0|l}return 0!==s?r.words[c]=0|s:r.length--,r._strip()}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,h=0|a[1],p=8191&h,v=h>>>13,m=0|a[2],g=8191&m,b=m>>>13,y=0|a[3],w=8191&y,O=y>>>13,k=0|a[4],E=8191&k,j=k>>>13,x=0|a[5],S=8191&x,A=x>>>13,P=0|a[6],C=8191&P,T=P>>>13,M=0|a[7],R=8191&M,N=M>>>13,_=0|a[8],L=8191&_,I=_>>>13,B=0|a[9],D=8191&B,F=B>>>13,U=0|u[0],$=8191&U,H=U>>>13,z=0|u[1],K=8191&z,W=z>>>13,G=0|u[2],q=8191&G,V=G>>>13,Q=0|u[3],J=8191&Q,Y=Q>>>13,X=0|u[4],Z=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,ce=ue>>>13,le=0|u[8],fe=8191&le,de=le>>>13,he=0|u[9],pe=8191&he,ve=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(f,$))|0)+((8191&(i=(i=Math.imul(f,H))+Math.imul(d,$)|0))<<13)|0;c=((o=Math.imul(d,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,$),i=(i=Math.imul(p,H))+Math.imul(v,$)|0,o=Math.imul(v,H);var ge=(c+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,K)|0))<<13)|0;c=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,$),i=(i=Math.imul(g,H))+Math.imul(b,$)|0,o=Math.imul(b,H),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,W)|0;var be=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,$),i=(i=Math.imul(w,H))+Math.imul(O,$)|0,o=Math.imul(O,H),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0;var ye=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(E,$),i=(i=Math.imul(E,H))+Math.imul(j,$)|0,o=Math.imul(j,H),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(g,q)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,V)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0;var we=(c+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,$),i=(i=Math.imul(S,H))+Math.imul(A,$)|0,o=Math.imul(A,H),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,ee)|0;var Oe=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(C,$),i=(i=Math.imul(C,H))+Math.imul(T,$)|0,o=Math.imul(T,H),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,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 ke=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,$),i=(i=Math.imul(R,H))+Math.imul(N,$)|0,o=Math.imul(N,H),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,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 Ee=(c+(n=n+Math.imul(f,se)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,se)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,$),i=(i=Math.imul(L,H))+Math.imul(I,$)|0,o=Math.imul(I,H),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(C,q)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,se)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(v,se)|0,o=o+Math.imul(v,ce)|0;var je=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,H))+Math.imul(F,$)|0,o=Math.imul(F,H),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(g,se)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(b,se)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var xe=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(d,pe)|0))<<13)|0;c=((o=o+Math.imul(d,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,W))+Math.imul(F,K)|0,o=Math.imul(F,W),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(w,se)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(O,se)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(F,q)|0,o=Math.imul(F,V),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(E,se)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(j,se)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Ae=(c+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,Y))+Math.imul(F,J)|0,o=Math.imul(F,Y),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(S,se)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(A,se)|0,o=o+Math.imul(A,ce)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var Pe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,ee))+Math.imul(F,Z)|0,o=Math.imul(F,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(C,se)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(T,se)|0,o=o+Math.imul(T,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,de)|0;var Ce=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(R,se)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,se)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,de)|0;var Te=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ve)|0)+Math.imul(A,pe)|0))<<13)|0;c=((o=o+Math.imul(A,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(L,se)|0,i=(i=i+Math.imul(L,ce)|0)+Math.imul(I,se)|0,o=o+Math.imul(I,ce)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,fe)|0,o=o+Math.imul(N,de)|0;var Me=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,se),i=(i=Math.imul(D,ce))+Math.imul(F,se)|0,o=Math.imul(F,ce),n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(I,fe)|0,o=o+Math.imul(I,de)|0;var Re=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ve)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(F,fe)|0,o=Math.imul(F,de);var Ne=(c+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ve)|0)+Math.imul(I,pe)|0))<<13)|0;c=((o=o+Math.imul(I,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(c+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,ve))+Math.imul(F,pe)|0))<<13)|0;return c=((o=Math.imul(F,ve))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,s[0]=me,s[1]=ge,s[2]=be,s[3]=ye,s[4]=we,s[5]=Oe,s[6]=ke,s[7]=Ee,s[8]=je,s[9]=xe,s[10]=Se,s[11]=Ae,s[12]=Pe,s[13]=Ce,s[14]=Te,s[15]=Me,s[16]=Re,s[17]=Ne,s[18]=_e,0!==c&&(s[19]=c,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 b(e,t,r){return g(e,t,r)}function y(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):b(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},y.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,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&u}return s&&0!==l&&(s.words[s.length++]=l),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 c=0;c=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);u&&(u.words[f]=d)}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),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0===(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),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(l),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(c)}},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 c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var f=0,d=1;0===(r.words[0]&d)&&f<26;++f,d<<=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 S(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 O(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 k(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){O.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function j(){O.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){O.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(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 A(e){S.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)}O.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},O.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t